Problem while using Dijkstra algorithm
Hi
Considering the example that comes with BGL i.e
examples/dijkstra-example.cpp.
I have already a graph which is undirected now i want to apply dijkstra
algorithm on it.
My vertex discriptor is "Vertex_name" and edge discriptor is "edge_value".
The following is the code provided in the example. :-
std::vector
On Sep 12, 2007, at 1:39 AM, abhishek.v@tcs.com wrote:
My code for the corresponding code is as follows :-
std::vector
p(num_vertices(g)); std::vector<int> d(num_vertices(g)); vertex_descriptor s = vertex(L1, g); //Giving error Undeclared identifier L1. Here L1 is the name of my vertex. Also i tried Vertex_name(u) to this parameter but it is giving compilation error. What parameter need to be passed for this.
What do you mean by the "name" of your vertex? In the example code, 'A' is an enumerator value (which ends up being the integer 0, I believe). the "vertex" function requires an integer and the graph to retrieve a vertex descriptor. - Doug
participants (2)
-
abhishek.v@tcs.com
-
Douglas Gregor