How do i access graph property?

Suppose I have defined the following graph: typedef boost::adjacency_list< boost::setS, // Adjacency list boost::setS, // Vertex list boost::undirectedS, // Undirected graph unsigned int, // Vertex property (unique label) boost::no_property, // Edge property unsigned int, // Graph property (next unique label) boost::listS // Edge list
graph;
How do I access the graph property? For the vertex property this is a very simple operation: graph g = ...; vertex_descriptor u = ...; vertex_property label = g[u]; But I can't find a way to access property associated with my graph. How can I do this?

On Jan 31, 2006, at 6:37 AM, Jef Driesen wrote:
Suppose I have defined the following graph:
typedef boost::adjacency_list< boost::setS, // Adjacency list boost::setS, // Vertex list boost::undirectedS, // Undirected graph unsigned int, // Vertex property (unique label) boost::no_property, // Edge property unsigned int, // Graph property (next unique label) boost::listS // Edge list
graph;
But I can't find a way to access property associated with my graph. How can I do this?
This is an omission (bug) in the BGL. If you change your graph type
to this:
typedef boost::adjacency_list<
boost::setS, // Adjacency list
boost::setS, // Vertex list
boost::undirectedS, // Undirected graph
unsigned int, // Vertex property (unique label)
boost::no_property, // Edge property
boost::property
graph;
You can get at the graph property with: get_property(graph_instance, boost::graph_name()) We'll find a better way to handle this in the next Boost release. Doug
participants (2)
-
Douglas Gregor
-
Jef Driesen