[BGL] Making GraphvizDigraph bidirectional
Hi, For convenience, I am using Graphviz digraphs, reading them into BGL, running my algorithms and writing them out to view the results (with Graphviz dotty ). My compiling environment is VC6. After some compilation failures, I realized that Graphviz digraphs did not support in_edges and other functionality of the bidirectional graphs. Graphviz digraphs is currently defined in graphviz.hpp as : typedef subgraph<adjacency_list<boost::vecS, boost::vecS, boost::directedS, GraphvizVertexProperty, GraphvizEdgeProperty, GraphvizGraphProperty> > GraphvizDigraph; There are 2 potential solutions I see ( there may be others ): Solution 1 : ------------ - Read in Graphviz digraph and then copy it into a working bidirectional graph to run the algorithms. - Copy back to Graphviz digraph to view the results. Solution 2 : ------------ - Change the definition of GraphvizDigraph to : typedef subgraph<adjacency_list<boost::vecS, boost::vecS, boost::bidirectonalS, GraphvizVertexProperty, GraphvizEdgeProperty, GraphvizGraphProperty> > GraphvizDigraph; - Recompile bglviz.lib - Now GraphvizDigraph is bidirectional I prefer Solution 2 because it leverages the generic way that BGL has been written. I am able to rebuild bglviz.lib and my minimal testing shows the bidrectional GraphvizDigraph seems to work so far. I would like feedback whether there are any gotchas with Solution 2. Thanks,
Hi Kweeheong, Solution 2 is what I would have suggested. I can't think of any obvious gotchas. Cheers, Jeremy On Sat, 26 Oct 2002, kweeheong wrote: tan.k.> tan.k.> Solution 2 : tan.k.> ------------ tan.k.> - Change the definition of GraphvizDigraph to : tan.k.> typedef subgraph<adjacency_list<boost::vecS, boost::vecS, boost::bidirectonalS, GraphvizVertexProperty, GraphvizEdgeProperty, GraphvizGraphProperty> > GraphvizDigraph; tan.k.> - Recompile bglviz.lib tan.k.> - Now GraphvizDigraph is bidirectional tan.k.> tan.k.> I prefer Solution 2 because it leverages the generic way that BGL tan.k.> has been written. I am able to rebuild bglviz.lib and my minimal tan.k.> testing shows the bidrectional GraphvizDigraph seems to work so tan.k.> far. tan.k.> tan.k.> I would like feedback whether there are any gotchas with Solution tan.k.> 2. tan.k.> tan.k.> Thanks, tan.k.> tan.k.> ---------------------------------------------------------------------- Jeremy Siek http://php.indiana.edu/~jsiek/ Ph.D. Student, Indiana Univ. B'ton email: jsiek@osl.iu.edu C++ Booster (http://www.boost.org) office phone: (812) 855-3608 ----------------------------------------------------------------------
participants (2)
-
Jeremy Siek
-
kweeheong