aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSteinar H. Gunderson <sgunderson@bigfoot.com>2014-04-11 00:02:21 +0200
committerSteinar H. Gunderson <sgunderson@bigfoot.com>2014-04-11 00:02:21 +0200
commit1cec1db00a3bd4e5be6405a379edaa11992f8205 (patch)
tree9f599560a4371edaa0f0d4a1d3ef75d146b32661
parent61d02333b3369e5fcaa0c0f1386ba637eac1d9f9 (diff)
Fix a few loose bugs in planning.
-rw-r--r--planning/planning.cpp7
1 files changed, 3 insertions, 4 deletions
diff --git a/planning/planning.cpp b/planning/planning.cpp
index 04dde6f..1e71b7c 100644
--- a/planning/planning.cpp
+++ b/planning/planning.cpp
@@ -382,7 +382,7 @@ int Planner::do_work(int distro_placements[NUM_DISTRO])
}
source_node.cost_from_source = 0;
- for (unsigned i = 0; i < switches.size(); ++i) {
+ for ( ;; ) {
Node *cheapest_unseen_node = NULL;
for (unsigned i = 0; i < all_nodes.size(); ++i) {
Node *n = all_nodes[i];
@@ -402,10 +402,9 @@ int Planner::do_work(int distro_placements[NUM_DISTRO])
// Yay, we found a path to the sink.
break;
}
-
cheapest_unseen_node->seen = true;
- // See if any of the edges out from this are feasible.
+ // Relax outgoing edges from this node.
for (unsigned i = 0; i < cheapest_unseen_node->edges.size(); ++i) {
Edge *e = cheapest_unseen_node->edges[i];
if (e->flow + 1 > e->capacity || e->reverse->flow - 1 > e->reverse->capacity) {
@@ -438,7 +437,7 @@ int Planner::do_work(int distro_placements[NUM_DISTRO])
}
end:
- logprintf("Augmented using %d paths.\n", num_paths, (unsigned)switches.size());
+ logprintf("Augmented using %d paths.\n", num_paths);
int last_row = 0, last_num = -1;
#if OUTPUT_FILES
in_addr_t subnet_address = inet_addr(FIRST_SUBNET_ADDRESS);