
18 Mar
2005
18 Mar
'05
4:50 a.m.
On Mar 17, 2005, at 8:49 PM, Vikram Shrowty wrote:
If I am understanding this correctly, after erasing a vertex we go through all vertices in the graph and reindex their edges/ This is because there may be edges to/from vertices after u. But this can be avoided if u was the last vertex in the graph, right?
So this... //.... g.m_vertices.erase(g.m_vertices.begin() + u); //.... if (u != num_vertices(g)) { //all the re-indexing code }
is a valid optimization isn't it?
Yep, that's a valid optimization. I've just committed your changes to CVS. Thanks! Doug