I am the using LEMON Graph library and was wondering if there is an efficient way to receive a ListDigraph::Node
x via the value of its corresponding ListDigraph::NodeMap
?
I was thinking about something like:
lemon::ListDigraph lg;
lemon::ListDigraph::NodeMap<std::string> nodeColor(lg);
lemon::ListDigraph::Node n = lg.addNode();
nodeColor[n] = "red";
lemon::ListDigraph::Node m = lg.addNode();
nodeColor[m] = "green";
# now I'd like to have something like:
lemon::ListDigraph::Node x = nodeColor.getNodeFromColor("red");
Does something like this already exist in LEMON? If there is no other way than writing my own map, how do I return the key (Node)? Can I iterate over the underlying values of the map?