I have a map with many polygons. I want to do a pathfinding with the "center" of these polygones. So I try to use Lemon Graph Library in order to generate my graph and the Dijkstra 's algorithm.
I see in the Lemon Tutorial :
ListDigraph g;
ListDigraph::Node u = g.addNode();
ListDigraph::Node v = g.addNode();
ListDigraph::Arc a = g.addArc(u, v);
My question is : How can I add coordinates in a Node ?
Like :
ListDigraph::Node u = g.addNode(sf::Vector2f(10, 12));
You have to include the
lemon/dim2.h
header file and aListDigraph::NodeMap
. For example, to assign coordinate values to your nodes you would do this: