Just trying to plunge into the Boost Graph library, and I have a few questions. I am writing code that is a wrapper class around a BGL graph. The idea is that I can manipulate the graph, but I want, and then call the wrapper method to output the graph in GEXF (XML) format.
My code looks something like this:
struct Vertex { std::string label; ... }; struct Edge { std::string label; double weight; ... }; typedef boost::adjacency_list<boost::vecS, boost::vecS, boost::directedS, Vertex, Edge> GraphType; template <typename Graph> class GEXF { private: Graph graph; ... }; template <typename Graph> void GEXF<Graph>::buildXML() { ...
Here are my questions:
When I use related properties, I can access vertex_index, but I can not access edge_index. How to access edge indices?
In the above code, I wanted to keep the generic GEXF class, but I had a problem when I tried to declare Graph::edge_iterator e, e_end;
. The above code works, but it uses a specific type. How should I declare edge_iterator in general?
source share