From the implementation I get that is possible to swap the vertex you want to delete with the "last" one and delete it. By last one I mean
Dear list, I am using boost graph with vecS both as edge-list and vertex-list and I need to delete some nodes. In my case nodes have no incoming or outgoing edges, but I'd like to understand how to do it in general. In vectors normally you simply swap the unwanted element with the last one and pop back. This way only the last element index is changed, all others are fine. The generalization of this idea is the base of the "remove erase idiom". It possible to apply it to adjacency_list (vecS,vecS)? I need this because I keep vertex index elsewhere, so I'd like to be able to update only the last one and not all of them. the one returned by *(--vertices(g).second) It is really safe? And how to delete edges, it is possible? Yours faithfully, Paolo