# HG changeset patch # User marci # Date 1082650037 0 # Node ID 5c12f35154528f231df649c72e3b2ec83a6541e8 # Parent d9a58896ab431415cb66572dc0ba1a2d413fcdb1 preflow mods diff -r d9a58896ab43 -r 5c12f3515452 src/work/jacint/preflowproba.h --- a/src/work/jacint/preflowproba.h Thu Apr 22 15:58:08 2004 +0000 +++ b/src/work/jacint/preflowproba.h Thu Apr 22 16:07:17 2004 +0000 @@ -40,8 +40,8 @@ */ -#ifndef HUGO_PREFLOW_H -#define HUGO_PREFLOW_H +#ifndef HUGO_PREFLOW_PROBA_H +#define HUGO_PREFLOW_PROBA_H #define H0 20 #define H1 1 @@ -55,7 +55,7 @@ template , typename FlowMap=typename Graph::EdgeMap > - class Preflow { + class PreflowProba { typedef typename Graph::Node Node; typedef typename Graph::Edge Edge; @@ -78,7 +78,7 @@ typedef typename ResGW::Edge ResEdge; public: - Preflow(Graph& _G, Node _s, Node _t, CapMap& _capacity, + PreflowProba(Graph& _G, Node _s, Node _t, CapMap& _capacity, FlowMap& _flow, bool _constzero, bool _res ) : G(_G), s(_s), t(_t), capacity(_capacity), flow(_flow), constzero(_constzero), res(_res) {} @@ -682,7 +682,7 @@ } //namespace hugo -#endif //PREFLOW_H +#endif //PREFLOW_PROBA_H diff -r d9a58896ab43 -r 5c12f3515452 src/work/marci/edmonds_karp_demo.cc --- a/src/work/marci/edmonds_karp_demo.cc Thu Apr 22 15:58:08 2004 +0000 +++ b/src/work/marci/edmonds_karp_demo.cc Thu Apr 22 16:07:17 2004 +0000 @@ -9,6 +9,7 @@ #include //#include #include +#include #include using namespace hugo; @@ -70,7 +71,9 @@ Timer ts; Graph::EdgeMap flow(G); //0 flow Preflow, Graph::EdgeMap > - pre_flow_test(G, s, t, cap, flow); + pre_flow_test(G, s, t, cap, flow, true); + PreflowProba, Graph::EdgeMap > + pre_flow_proba(G, s, t, cap, flow, true, true); MaxFlow, Graph::EdgeMap > max_flow_test(G, s, t, cap, flow); @@ -83,6 +86,15 @@ } { + std::cout << "wrapped preflow ..." << std::endl; + FOR_EACH_LOC(Graph::EdgeIt, e, G) flow.set(e, 0); + ts.reset(); + pre_flow_proba.run(); + std::cout << "elapsed time: " << ts << std::endl; + std::cout << "flow value: "<< pre_flow_test.flowValue() << std::endl; + } + + { std::cout << "physical blocking flow augmentation ..." << std::endl; FOR_EACH_LOC(Graph::EdgeIt, e, G) flow.set(e, 0); ts.reset(); diff -r d9a58896ab43 -r 5c12f3515452 src/work/marci/graph_wrapper.h --- a/src/work/marci/graph_wrapper.h Thu Apr 22 15:58:08 2004 +0000 +++ b/src/work/marci/graph_wrapper.h Thu Apr 22 16:07:17 2004 +0000 @@ -696,6 +696,11 @@ Node bNode(OutEdgeIt e) const { return ((e.forward) ? graph->bNode(e.out) : graph->bNode(e.in)); } + Node aNode(InEdgeIt e) const { + return ((e.forward) ? graph->aNode(e.in) : graph->aNode(e.out)); } + Node bNode(InEdgeIt e) const { + return ((e.forward) ? graph->bNode(e.in) : graph->bNode(e.out)); } + // int nodeNum() const { return graph->nodeNum(); } //FIXME void edgeNum() const { } diff -r d9a58896ab43 -r 5c12f3515452 src/work/marci/makefile --- a/src/work/marci/makefile Thu Apr 22 15:58:08 2004 +0000 +++ b/src/work/marci/makefile Thu Apr 22 16:07:17 2004 +0000 @@ -6,7 +6,7 @@ BOOSTROOT ?= /home/marci/boost INCLUDEDIRS ?= -I../../include -I.. -I../{marci,jacint,alpar,klao,akos,athos} -I$(BOOSTROOT) LEDAINCLUDE ?= -I$(LEDAROOT)/incl -CXXFLAGS = -g -O -W -Wall $(INCLUDEDIRS) -ansi -pedantic -ftemplate-depth-30 +CXXFLAGS = -g -O3 -W -Wall $(INCLUDEDIRS) -ansi -pedantic -ftemplate-depth-30 LEDABINARIES = leda_graph_demo leda_bfs_dfs max_bipartite_matching_demo BINARIES = edmonds_karp_demo iterator_bfs_demo macro_test lg_vs_sg bfsit_vs_byhand bipartite_graph_wrapper_test @@ -41,8 +41,8 @@ leda_bfs_dfs: leda_bfs_dfs.o $(CXX3) -Wall -O -L$(LEDAROOT) -o leda_bfs_dfs leda_bfs_dfs.o -lG -lL -lm -edmonds_karp_demo: - $(CXX3) $(CXXFLAGS) -o edmonds_karp_demo edmonds_karp_demo.cc +#edmonds_karp_demo: +# $(CXX3) $(CXXFLAGS) -o edmonds_karp_demo edmonds_karp_demo.cc # $(CXX3) $(CXXFLAGS) -pg -o edmonds_karp_demo_prof edmonds_karp_demo.cc gw_vs_not: