# HG changeset patch # User marci # Date 1079539833 0 # Node ID 8a9b9360463e641694e5c22418301ccf420e2e08 # Parent 19f8bd411014b7bb542898cb1124897435f8c635 . diff -r 19f8bd411014 -r 8a9b9360463e src/work/edmonds_karp.h --- a/src/work/edmonds_karp.h Wed Mar 17 15:41:00 2004 +0000 +++ b/src/work/edmonds_karp.h Wed Mar 17 16:10:33 2004 +0000 @@ -563,12 +563,14 @@ BfsIterator5< AugGraph, /*AugOutEdgeIt,*/ ReachedMap > res_bfs(res_graph); typename AugGraph::NodeMap pred(res_graph); for(NodeIt s=G->template first(); G->valid(s); G->next(s)) { - Number f=0; - for(OutEdgeIt e=G->template first(s); G->valid(e); G->next(e)) - f+=flow->get(e); - if (f<1) { - res_bfs.pushAndSetReached(s); - pred.set(s, AugEdge(INVALID)); + if (S->get(s)) { + Number f=0; + for(OutEdgeIt e=G->template first(s); G->valid(e); G->next(e)) + f+=flow->get(e); + if (f<1) { + res_bfs.pushAndSetReached(s); + pred.set(s, AugEdge(INVALID)); + } } } diff -r 19f8bd411014 -r 8a9b9360463e src/work/marci/makefile --- a/src/work/marci/makefile Wed Mar 17 15:41:00 2004 +0000 +++ b/src/work/marci/makefile Wed Mar 17 16:10:33 2004 +0000 @@ -3,14 +3,14 @@ #CXX3.3 = g++ CXX3 := $(shell type -p g++-3.3 || type -p g++-3.2 || type -p g++-3.0 || type -p g++-3 || echo g++) #CXXFLAGS = -W -Wall -ansi -pedantic -I. -I.. -I../alpar -LEDAROOT ?= /ledasrc/LEDA-4.1 +#LEDAROOT ?= /ledasrc/LEDA-4.1 BOOSTROOT ?= /home/marci/boost INCLUDEDIRS ?= -I../../include -I.. -I. -I../{marci,jacint,alpar,klao,akos,athos} -I$(LEDAROOT)/incl -I$(BOOSTROOT) CXXFLAGS = -g -O -W -Wall $(INCLUDEDIRS) -ansi -pedantic - -BINARIES = edmonds_karp_demo preflow_demo_leda lg_vs_sg leda_graph_demo leda_bfs_dfs max_bipartite_matching_demo -#preflow_demo_boost edmonds_karp_demo_boost preflow_demo_jacint preflow_demo_athos edmonds_karp_demo_alpar +LEDABINARIES = lg_vs_sg leda_graph_demo leda_bfs_dfs +BINARIES = edmonds_karp_demo max_bipartite_matching_demo +#preflow_demo_boost edmonds_karp_demo_boost preflow_demo_jacint preflow_demo_athos edmonds_karp_demo_alpar preflow_demo_leda all: $(BINARIES) diff -r 19f8bd411014 -r 8a9b9360463e src/work/marci/max_bipartite_matching_demo.cc --- a/src/work/marci/max_bipartite_matching_demo.cc Wed Mar 17 15:41:00 2004 +0000 +++ b/src/work/marci/max_bipartite_matching_demo.cc Wed Mar 17 16:10:33 2004 +0000 @@ -4,8 +4,9 @@ #include #include -#include -#include +//#include +//#include +#include #include #include #include @@ -38,9 +39,11 @@ using std::endl; int main() { - leda::graph g; - typedef LedaGraphWrapper Graph; - Graph G(g); +// leda::graph g; +// typedef LedaGraphWrapper Graph; +// Graph G(g); + typedef ListGraph Graph; + Graph G; typedef Graph::Node Node; typedef Graph::NodeIt NodeIt; @@ -61,17 +64,17 @@ for(int i=0; i<4; ++i) { t_nodes.push_back(G.addNode()); } -// random_init(); -// for(int i=0; i<6; ++i) { -// G.addEdge(s_nodes[random(4)], t_nodes[random(4)]); -// } + random_init(); + for(int i=0; i<6; ++i) { + G.addEdge(s_nodes[random(4)], t_nodes[random(4)]); + } - G.addEdge(s_nodes[2], t_nodes[4-4]); - G.addEdge(s_nodes[2], t_nodes[7-4]); - G.addEdge(s_nodes[2], t_nodes[4-4]); - G.addEdge(s_nodes[3], t_nodes[6-4]); - G.addEdge(s_nodes[3], t_nodes[5-4]); - G.addEdge(s_nodes[3], t_nodes[5-4]); +// G.addEdge(s_nodes[2], t_nodes[4-4]); +// G.addEdge(s_nodes[2], t_nodes[7-4]); +// G.addEdge(s_nodes[2], t_nodes[4-4]); +// G.addEdge(s_nodes[3], t_nodes[6-4]); +// G.addEdge(s_nodes[3], t_nodes[5-4]); +// G.addEdge(s_nodes[3], t_nodes[5-4]); Graph::NodeMap s_map(G); //false