Hi,
I am looking for a way to access vertex properties by using a key instead of vertex reference itself. For example, if I have
class Data
{
public:
std::string name;
unsigned int value;
};
typedef boost::adjacency_list< boost::vecS, boost::vecS, boost::directedS, Data > Graph;
typedef boost::graph_traits<Graph>::vertex_descriptor Vertex;
instead of using
Vertex vertex1 = boost::add_vertex( g );
g[vertex1].name = "Alpha";
g[vertex1].value = 10;
I would like to have
g["Alpha"].name = "Alpha";
g["Alpha"].value = 10;
Does a ready to use mechanism exist?
Thank you, Serge