
6 Jun
2011
6 Jun
'11
11:42 p.m.
I am trying to assign names to vertices. I made a typedef boost::property<boost::vertex_name_t, std::string> VertexProperty; and tried to set a label for vertex 0 in two ways: A) g[0] = "Vertex0"; and B) boost::property_map<Graph, boost::vertex_name_t>::type value = boost::get(boost::vertex_name_t(), g); boost::put(value, 0, "Vertex0"); Neither compiles. In the second one, the problem with this: boost::put(value, 0, "Vertex0"); is that "0" is not the right type - I guess the vertex IDs should be vertex_descriptor's instead of ints? How do I get the descriptor of vertex #0 ? Here is the full code: http://codepad.org/7VYELJan Thanks, David