Boost logo

Boost Users :

Subject: [Boost-users] Print boost graph with custom vertex label
From: Saha, Shambwaditya (ssaha6_at_[hidden])
Date: 2013-12-03 23:54:45


Hi All,

I want to print a Boost Graph having custom(string) vertex labels instead
of the default vertex numbering label 0,1,2...

I have initialized the graph as :

typedef adjacency_list <vecS, vecS,
directedS, property<vertex_name_t,string>> Graph;

Graph g;
set<string> names;
map<string,Graph::vertex_descriptor> vertex ;

for(auto it = names.begin() ; it != names.end(); ++it )
       vertex[*it] = add_vertex(*it,g) ;

Now how should I print this graph such that I get edges of the form abc ->
xyz; instead of 1->2;

Thanks and Regards,
Shambwaditya



Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net