
On Wed, Jun 29, 2011 at 6:07 PM, Stephen Woodbridge
Hi all,
I am C programmer floundering in a C++ world! I have the function that I call from C that builds a graph, runs dijkstra_shortest_paths(), then extracts the results and passes them back to a C array of structs. Code is in pastebin:
This seems to work and everything looks ok, EXCEPT the edge ids are not correct. I suspect this is because I'm not doing something correctly and I have been messing with this for a couple weeks without success, so I think its time to ask for help.
So in the function:
graph_add_edge(G &graph, int id, int source, int target, float8 cost)
id is the edge id source is the node id at the start of the edge target is the node_id at the end of the edge cost is the cost to traverse the edge from source to target
I would really appreciate it if someone could look at this and point out what I might be doing wrong.
Thanks in advance, -Steve
There are a few Dijkstra examples here, do they help? http://programmingexamples.net/index.php?title=Boost#Boost_Graph_Library_.28... David