1.1 --- a/src/demo/sub_graph_wrapper_demo.cc Thu Sep 16 14:01:36 2004 +0000
1.2 +++ b/src/demo/sub_graph_wrapper_demo.cc Thu Sep 16 14:27:27 2004 +0000
1.3 @@ -2,6 +2,8 @@
1.4
1.5 // Use a DIMACS max flow file as stdin.
1.6 // sub_graph_wrapper_demo < dimacs_max_flow_file
1.7 +// This program computes a maximum number of disjoint shortest paths
1.8 +// between s and t.
1.9
1.10 #include <iostream>
1.11 #include <fstream>
1.12 @@ -46,16 +48,21 @@
1.13 Dijkstra dijkstra(g, length);
1.14 dijkstra.run(s);
1.15
1.16 + // This map returns true exactly for those edges which are
1.17 + // tight w.r.t the length funcion and the potential
1.18 + // given by the dijkstra algorithm.
1.19 typedef TightEdgeFilterMap<Graph, const Dijkstra::DistMap, LengthMap>
1.20 TightEdgeFilter;
1.21 TightEdgeFilter tight_edge_filter(g, dijkstra.distMap(), length);
1.22
1.23 ConstMap<Node, bool> const_true_map(true);
1.24 + // This graph contains exaclty the tight edges.
1.25 typedef SubGraphWrapper<Graph, ConstMap<Node, bool>, TightEdgeFilter> SubGW;
1.26 SubGW gw(g, const_true_map, tight_edge_filter);
1.27
1.28 ConstMap<Edge, int> const_1_map(1);
1.29 Graph::EdgeMap<int> flow(g, 0);
1.30 + // Max flow between s and t in the graph of tight edges.
1.31 Preflow<SubGW, int, ConstMap<Edge, int>, Graph::EdgeMap<int> >
1.32 preflow(gw, s, t, const_1_map, flow);
1.33 preflow.run();