Boost logo

Boost-Commit :

Subject: [Boost-commit] svn:boost r73009 - trunk/boost/graph
From: jewillco_at_[hidden]
Date: 2011-07-11 21:26:11


Author: jewillco
Date: 2011-07-11 21:26:09 EDT (Mon, 11 Jul 2011)
New Revision: 73009
URL: http://svn.boost.org/trac/boost/changeset/73009

Log:
Fixed to work with graphs whose vertex_index maps are not the identity
Text files modified:
   trunk/boost/graph/push_relabel_max_flow.hpp | 10 +++++-----
   1 files changed, 5 insertions(+), 5 deletions(-)

Modified: trunk/boost/graph/push_relabel_max_flow.hpp
==============================================================================
--- trunk/boost/graph/push_relabel_max_flow.hpp (original)
+++ trunk/boost/graph/push_relabel_max_flow.hpp 2011-07-11 21:26:09 EDT (Mon, 11 Jul 2011)
@@ -450,7 +450,7 @@
         for (boost::tie(u_iter, u_end) = vertices(g); u_iter != u_end; ++u_iter) {
           u = *u_iter;
           put(color, u, ColorTraits::white());
- parent[u] = u;
+ parent[get(index, u)] = u;
           current[u] = out_edges(u, g);
         }
         // eliminate flow cycles and topologically order the vertices
@@ -468,7 +468,7 @@
                   vertex_descriptor v = target(a, g);
                   if (get(color, v) == ColorTraits::white()) {
                     put(color, v, ColorTraits::gray());
- parent[v] = u;
+ parent[get(index, v)] = u;
                     u = v;
                     break;
                   } else if (get(color, v) == ColorTraits::gray()) {
@@ -523,12 +523,12 @@
                     bos_null = false;
                     tos = u;
                   } else {
- topo_next[u] = tos;
+ topo_next[get(index, u)] = tos;
                     tos = u;
                   }
                 }
                 if (u != r) {
- u = parent[u];
+ u = parent[get(index, u)];
                   ++current[u].first;
                 } else
                   break;
@@ -540,7 +540,7 @@
         // return excess flows
         // note that the sink is not on the stack
         if (! bos_null) {
- for (u = tos; u != bos; u = topo_next[u]) {
+ for (u = tos; u != bos; u = topo_next[get(index, u)]) {
             boost::tie(ai, a_end) = out_edges(u, g);
             while (get(excess_flow, u) > 0 && ai != a_end) {
               if (get(capacity, *ai) == 0 && is_residual_edge(*ai))


Boost-Commit list run by bdawes at acm.org, david.abrahams at rcn.com, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk