Question

typedef adjacency_matrix<undirectedS,allow_parallel_edge_tag,edgeWeightProperty> UGraph;
UGraph ug(n);
add_edge(0,1,ug);
add_edge(0,1,ug);

only one edge can be drawn in the graph "ug"

Was it helpful?

Solution

Adjacency_matrix does not support the concept of parallel edges. Your usage of allow_parallel_edge_tag does not make the matrix to behave differently. It simply assigns allow_parallel_edge_tag as a vertex property, and Boost essentially ignore this property.

If you need parallel edges you should use adjacency_list instead.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top