public function createGraphGroups()
    {
        $colors = $this->getColors();

        $graph = $this->graph->createGraphClone();
        foreach ($graph->getVertices()->getMap() as $vid => $vertex) {
            $vertex->setGroup($colors[$vid]);
        }

        return $graph;
    }
public function createGraphGroups()
    {
        $colors = $this->getColors();

        $graph = $this->graph->createGraphClone();
        foreach ($graph->getVertices()->getMap() as $vid => $vertex) {
            $vertex->setGroup($colors[$vid]);
        }

        return $graph;
    }
public function createGraphGroups ( ) { $ colors = $ this -> getColors ( ) ; $ graph = $ this -> graph -> createGraphClone ( ) ; foreach ( $ graph -> getVertices ( ) -> getMap ( ) as $ vid => $ vertex ) { $ vertex -> setGroup ( $ colors [ $ vid ] ) ; } return $ graph ; }
create new graph with valid groups set according to bipartition colors

@return Graph
@throws UnexpectedValueException if graph is not bipartit
@uses AlgorithmBipartit::getColors()
@uses Graph::createGraphClone()
@uses Vertex::setGroup()
create new graph with valid groups set according to bipartition colors