Boost logo

Boost :

Subject: [boost] [review] Heaps: mutability
From: Andrew Sutton (asutton.list_at_[hidden])
Date: 2011-06-03 10:50:34


Tim,

I'm trying to figure out how I can use a mutable queue to write
something like Dijkstra's SP. Here's a skeleton with the relevant
parts.

Queue<Vertex*, Comp> q;
Map<Vertex*, Queue::handle_type> h;
h[start] = q.push(start);

  v->distance += x;
  q.update(h[v]);

Comp is an indirect comparison of vertex distances (u->distance < v->distance).

Does the mutable heap support this application (i.e., where I'm not
directly updating the value type)? It's not clear from the examples
supplied with the program. I suspect that it is, but it's not clear.

Andrew


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk