public function getMap()
    {
        $vertices = array();
        foreach ($this->vertices as $vertex) {
            $vertices[$vertex->getId()] = $vertex;
        }
        return $vertices;
    }
public function getMap()
    {
        $vertices = array();
        foreach ($this->vertices as $vertex) {
            $vertices[$vertex->getId()] = $vertex;
        }
        return $vertices;
    }
public function getMap ( ) { $ vertices = array ( ) ; foreach ( $ this -> vertices as $ vertex ) { $ vertices [ $ vertex -> getId ( ) ] = $ vertex ; } return $ vertices ; }
get a mapping array of Vertex ID => Vertex instance and thus remove duplicate vertices

@return Vertex[] Vertex ID => Vertex instance
@uses Vertex::getId()
get a mapping array of Vertex ID = > Vertex instance and thus remove duplicate vertices