I have a function which take an input from the user whether the graph is directed or undirected. I'm declaring graph as follows :-
typedef adjacency_list < vecS, vecS,* undirectedS*, property < vertex_name_t,std::string >, property < edge_name_t, std::string > > Graph; Graph g;
Now here the parameter in Bold need to be varied as the user input changes. One method could be i could have two different function say,CreateDirected() and CreateUndirected(). But this is not working in my case as i want the declaration should be global so that i can use it throughout my application. Please help. That's actually a bit tricky in the BGL, as you've noted. My suggestion would be to use bidirectionalS as the directedness tag, which gives you a directed graph with access to both the incoming and the outgoing edges. Then, it is relatively easy to write a graph adaptor that views an existing bidirectional graph as an undirected graph. I that someone
abhishek.v@tcs.com wrote: posted on to the Boost mailing list recently, but I can't find it now :( - Doug