[Lemon-commits] [lemon_svn] marci: r1169 - hugo/trunk/src/demo
Lemon SVN
svn at lemon.cs.elte.hu
Mon Nov 6 20:43:38 CET 2006
Author: marci
Date: Thu Sep 16 16:27:27 2004
New Revision: 1169
Modified:
hugo/trunk/src/demo/sub_graph_wrapper_demo.cc
Log:
more docs
Modified: hugo/trunk/src/demo/sub_graph_wrapper_demo.cc
==============================================================================
--- hugo/trunk/src/demo/sub_graph_wrapper_demo.cc (original)
+++ hugo/trunk/src/demo/sub_graph_wrapper_demo.cc Thu Sep 16 16:27:27 2004
@@ -2,6 +2,8 @@
// Use a DIMACS max flow file as stdin.
// sub_graph_wrapper_demo < dimacs_max_flow_file
+// This program computes a maximum number of disjoint shortest paths
+// between s and t.
#include <iostream>
#include <fstream>
@@ -46,16 +48,21 @@
Dijkstra dijkstra(g, length);
dijkstra.run(s);
+ // This map returns true exactly for those edges which are
+ // tight w.r.t the length funcion and the potential
+ // given by the dijkstra algorithm.
typedef TightEdgeFilterMap<Graph, const Dijkstra::DistMap, LengthMap>
TightEdgeFilter;
TightEdgeFilter tight_edge_filter(g, dijkstra.distMap(), length);
ConstMap<Node, bool> const_true_map(true);
+ // This graph contains exaclty the tight edges.
typedef SubGraphWrapper<Graph, ConstMap<Node, bool>, TightEdgeFilter> SubGW;
SubGW gw(g, const_true_map, tight_edge_filter);
ConstMap<Edge, int> const_1_map(1);
Graph::EdgeMap<int> flow(g, 0);
+ // Max flow between s and t in the graph of tight edges.
Preflow<SubGW, int, ConstMap<Edge, int>, Graph::EdgeMap<int> >
preflow(gw, s, t, const_1_map, flow);
preflow.run();
More information about the Lemon-commits
mailing list