Boost logo

Boost Users :

From: Abhijit Deshmukh (abhijit.deshmukh_at_[hidden])
Date: 2005-07-11 23:39:37


Hi,

I have a mutable property undirected graph. I want to delete all the
vertices and edges in the graph.

I tried using the for loop

        for( b = *vertices( databaseGraph ).first; b!= *vertices(
databaseGraph ).second; b++ ){
                clear_vertex( b, databaseGraph );
                remove_vertex( b, databaseGraph );
        }

This works fine for some extent, but then crashes. My guess is that
the loop crashes when it reaches a vertex whose edges have not been
deleted. But my speculation was that clear_vertex deletes all the
edges associated with a vertex and the function should not crash when
clear_vertex is called before remove_vertex.

Clearly, I am making a mistake, but am not able to point it out.

Can you let me know what is the correct way of deleting all edges and
vertices in a mutable property undirected graph.

Thanks in anticipation.

Regards,

Abhijit


Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net