[BGL] Visitor in dijkstra_shortest_paths
Hi, I want to modify the dijkstra behavior such as it doesn't consider special vertices. I think to create a visitor so when the examine_edge(u,v) method is called, I check if the vertex v can be considered (i.e, its property "trust" is true), if not, I want to skip the examination (and so the relaxation too). But, I don't know how to do this "skip". example: -=-=-=-=-=-=-=-=-=-=-=- DIJKSTRA (G, s, w) // initialization ... INSERT(Q, s) discover_vertex(s) while (Q != 0) u <- EXTRACT-MIN (Q) S <- S U {u} for each v in Adj[u] examine_edge(u,v) // what I would like to do: // if (not G[v].trust) continue; // thus, the next operations are skipped. if (w(u,v) + d[u] < d[v]) // edge (u,v) is relaxated ... end for finish_vertex(u) end while -=-=-=-=-=-=-=-=-=-=-=- Have you got an idea how I can do this ? Regards, -- Johan
participants (1)
-
Johan Oudinet