I'm using boost graph_traits and defined a graph like this:
typedef boost::adjacency_list <boost::setS, boost::vecS, boost::undirectedS, NodeInfo, EdgeInfo> Graph;
typedef boost::graph_traits<Graph>::vertex_descriptor Vertex;
Each of my vertices has coordinates attatched and I intend to find duplicate vertices (vertices in the same location). So I build a list that contains these "clusters":
std::vector<std::vector<Vertex>> clusters;
Now I tried to merge each cluster in one single vertex (list of vertices). To do this I call for each vertex of a cluster clusters[i]
:
boost::clear_vertex(v, graph)
boost::remove_vertex(v, graph);
However I noticed that still duplicates remain. I guess that it's related to a changes in indices while deleting as I use vecS
for the vertex-list.
What is the reason for this and how can I solve it?