Hi, I'm just starting to learn how to use BGL, and have a few questions.
Help would be much appreciated.
I'm currently trying to understand the add_vertex function where
properties can be assigned to the vertices as the graph is constructed.
The only info I've managed to find on the website is this:
---------
vertex_descriptor
add_vertex(const VertexProperties& p,
adjacency_list& g)
Adds a vertex to the graph with the specified properties. Returns the
vertex descriptor for the new vertex.
---------
Does anybody have any examples on how to use this? More specifically,
consider the following. I want to construct a graph dynamically, i.e.
the graph will grow and shrink during runtime. Let's say I have a Node
class with one member (which I want to represent as an "internal
property") as follows:
class Node {
public:
std::string name;
};
And an Edge class, again with internal properties:
class Edge {
public:
int weight1;
double weight2;
};
Then my graph object would look something like this, right?
typedef adjacency_list
< vecS, vecS, directedS,
property < vertex_name_t, std::string >,
property