16 # ifndef SEARCH_MEMORY_LEAKS_ENABLED
17 # error SEARCH NOT ENABLED
19 # define new DEBUG_NEW
21 static char THIS_FILE[] = __FILE__;
49 const node& net_source,
const node& net_target)
68 while (edge_it != edges_end)
84 bool source_found =
false;
85 bool target_found =
false;
88 while (node_it != nodes_end)
90 if ((*node_it).indeg() == 0)
94 if ((*node_it).outdeg() == 0)
100 if (!(source_found && target_found))
127 vector<int> numb(number_of_nodes, 0);
146 go_on =
retreat(number_of_nodes, cur_node, last_edge, numb);
187 while (node_it != nodes_end)
194 (*node_it).out_edges_begin();
196 (*node_it).out_edges_end();
197 while (out_edge_it != out_edges_end)
208 (*node_it).in_edges_begin();
210 (*node_it).in_edges_end();
211 while (in_edge_it != in_edges_end)
233 queue<node> next_nodes;
241 while (!next_nodes.empty())
243 cur_node = next_nodes.front();
247 while (in_edge_it != in_edges_end)
252 next_nodes.push(next);
253 visited[
next] =
true;
267 while (out_edge_it != out_edges_end)
283 while (out_edge_it != out_edges_end)
287 last_edge[(*out_edge_it).target()] = *out_edge_it;
288 cur_node = (*out_edge_it).target();
326 cur_node = last_edge[cur_node].source();
338 if (numb[dist_label[cur_node]] == 0)
344 dist_label[cur_node] =
346 ++numb[dist_label[cur_node]];
349 cur_node = last_edge[cur_node].source();
357 const node cur_node)
const
359 int min_value = number_of_nodes;
363 while (out_edge_it != out_edges_end)
365 if (min_value >
dist_label[(*out_edge_it).target()])
367 min_value =
dist_label[(*out_edge_it).target()];
389 if (cur_capacity < min_value)
391 min_value = cur_capacity;
393 cur_node = last_edge[cur_node].source();
420 while (out_edge_it != out_edges_end)