Hi,
I am building a graph class based on the following suggestion: http://stackoverflow.com/questions/671714/modifying-vertex-properties-in-a-boostgraph
Unfortunately, I realized an unexpected behavior. When using my own vertex-properties (for simplicity please ignore the edge properties), the built-in properties seem not to be used. So for example, when I have:
typedef adjacency_list<
setS, // disallow parallel edges
listS, // vertex container
undirectedS, // undirected graph
property<vertex_properties_t, VERTEXPROPERTIES>,
property<edge_properties_t, EDGEPROPERTIES>
> GraphContainer;
I can retrieve my custom properties without any problem, but when I want to retrieve the vertex_index-property I always get the same value for each vertex, meaning a value of 0. The nodes are distinct, which is confirmed by num_vertices(MyGraph). Then I thought that this might be due to missing the built-in properties, so I tried:
typedef adjacency_list<
setS, // disallow parallel edges
listS, // vertex container
undirectedS, // undirected graph
property<vertex_index_t, unsigned int , property< vertex_properties_t, VERTEXPROPERTIES> >,
property<edge_properties_t, EDGEPROPERTIES>
> GraphContainer;
Again, when wanting to retrieve the index of whatever vertex, I get a value of 0. Is this behavior normal? Does one have to set the built-in properties also, when using custom properties?