1.1 --- a/src/work/marci/bipartite_graphs.h Thu May 06 13:21:24 2004 +0000
1.2 +++ b/src/work/marci/bipartite_graphs.h Thu May 06 13:44:48 2004 +0000
1.3 @@ -35,5 +35,26 @@
1.4 }
1.5 return true;
1.6 }
1.7 +
1.8 + /// experimental topsort,
1.9 + /// I think the final version will work as an iterator
1.10 + template<typename Graph>
1.11 + void topSort(Graph& g, std::list<typename Graph::Node>& l) {
1.12 + l.clear();
1.13 + typedef typename Graph::template NodeMap<bool> ReachedMap;
1.14 + ReachedMap reached(g/*, false*/);
1.15 + DfsIterator<Graph, ReachedMap> dfs(g, reached);
1.16 + FOR_EACH_LOC(typename Graph::NodeIt, n, g) {
1.17 + if (!reached[n]) {
1.18 + dfs.pushAndSetReached(n);
1.19 + while (!bfs.finished()) {
1.20 + if (bfs.isANodeExamined()) {
1.21 + l.push_back(bfs.aNode());
1.22 + }
1.23 + ++bfs;
1.24 + }
1.25 + }
1.26 + }
1.27 + }
1.28 }
1.29 #endif //HUGO_BIPARTITE_GRAPHS_H
2.1 --- a/src/work/marci/makefile Thu May 06 13:21:24 2004 +0000
2.2 +++ b/src/work/marci/makefile Thu May 06 13:44:48 2004 +0000
2.3 @@ -1,7 +1,7 @@
2.4 CXX2 = g++-2.95
2.5 CXX3=$(CXX)
2.6 BOOSTROOT ?= /home/marci/boost
2.7 -INCLUDEDIRS ?= -I../../include -I.. -I../{marci,jacint,alpar,klao,akos,athos} -I$(BOOSTROOT)
2.8 +INCLUDEDIRS ?= -I../../hugo -I.. -I../{marci,jacint,alpar,klao,akos,athos} -I$(BOOSTROOT)
2.9
2.10 LEDABINARIES = leda_graph_demo leda_bfs_dfs max_bipartite_matching_demo
2.11 BINARIES = max_flow_demo iterator_bfs_demo macro_test lg_vs_sg bfsit_vs_byhand bipartite_graph_wrapper_test bipartite_matching_try bipartite_matching_try_2 bipartite_matching_try_3