1.1 --- a/lemon/network_simplex.h Fri Jun 15 14:32:48 2007 +0000
1.2 +++ b/lemon/network_simplex.h Fri Jun 15 14:36:24 2007 +0000
1.3 @@ -275,6 +275,8 @@
1.4 if (!(valid_supply = sum == 0)) return;
1.5
1.6 // Copying graph_ref to graph
1.7 + graph.reserveNode(countNodes(graph_ref) + 1);
1.8 + graph.reserveEdge(countEdges(graph_ref) + countNodes(graph_ref));
1.9 copyGraph(graph, graph_ref)
1.10 .edgeMap(cost, _cost)
1.11 .nodeRef(node_ref)
1.12 @@ -477,7 +479,9 @@
1.13 root = graph.addNode();
1.14 parent[root] = INVALID;
1.15 pred_edge[root] = INVALID;
1.16 - depth[root] = supply[root] = potential[root] = 0;
1.17 + depth[root] = 0;
1.18 + supply[root] = 0;
1.19 + potential[root] = 0;
1.20
1.21 // Adding artificial edges to the graph and initializing the node
1.22 // maps of the spanning tree data structure
1.23 @@ -513,7 +517,7 @@
1.24 #ifdef EDGE_BLOCK_PIVOT
1.25 // Initializing block_size for the edge block pivot rule
1.26 int edge_num = countEdges(graph);
1.27 - block_size = edge_num >= BLOCK_NUM * MIN_BLOCK_SIZE ?
1.28 + block_size = edge_num >= BLOCK_NUM * MIN_BLOCK_SIZE ?
1.29 edge_num / BLOCK_NUM : MIN_BLOCK_SIZE;
1.30 #endif
1.31 #ifdef CANDIDATE_LIST_PIVOT