Boost logo

Boost Users :

From: Johan Oudinet (johan.oudinet_at_[hidden])
Date: 2005-12-15 06:09:06


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

Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net