Add support for GraphViz cgraph library #340
Open
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Hi,
GraphViz provides a native C API, called cgraph.
This adds supports for cgraph in a similar way to existing leda_graph.hpp and stanford_graph.hpp implementations.
The implementation already works well and fulfills all static
BOOST_CONCEPT_ASSERT
tests. However there are some issues remaining though. I tagged all issues in the source code with@todo
.Agraph_t
) can be made directed or undirected, and also strict (=disallow parallel edges) or not. This is a runtime setting, set during instantiation or determined when loading graphviz files. I found no suitable way to handle this runtime setting already in the template in order to define the typedefs forbidirectional_tag
andallow_parallel_edge_tag
. How can this be handled?BOOST_DEF_PROPERTY
,property_map<...>
,get
, ... implementations for each of them?add_edge(u, v, ep, g)
andadd_vertex(vp, g)
functions are currently configured to transport the edge's name inep
resp. the vertex's name invp
. But I could also feed in astd::map
, so thatadd_vertex("V", g)
becomesadd_vertex{{"name", "V"}, g)
. Would that make sense?using boost::out_edges;
, .... Any idea why this happens?But overall it already works quite well for me. I can copy an existing graph into the cgraph structure to get it visualized with GraphViz.
Bye
Tobias