# HG changeset patch # User athos # Date 1083856799 0 # Node ID d167149bde9583892380f4b19e74e439a317dbb7 # Parent 9e7613fa6d27d7ad12a632eeaad9d9860cf572b7 Written hugo/ into includes. diff -r 9e7613fa6d27 -r d167149bde95 src/work/athos/makefile --- a/src/work/athos/makefile Thu May 06 15:14:13 2004 +0000 +++ b/src/work/athos/makefile Thu May 06 15:19:59 2004 +0000 @@ -1,4 +1,4 @@ BINARIES = suurballe minlength_demo mincostflows_test -INCLUDEDIRS= -I../../include -I.. -I../{athos,klao,marci,jacint,alpar,johanna,akos} +INCLUDEDIRS= -I../.. -I.. -I../{athos,klao,marci,jacint,alpar,johanna,akos} include ../makefile diff -r 9e7613fa6d27 -r d167149bde95 src/work/athos/mincostflows.h --- a/src/work/athos/mincostflows.h Thu May 06 15:14:13 2004 +0000 +++ b/src/work/athos/mincostflows.h Thu May 06 15:19:59 2004 +0000 @@ -7,10 +7,10 @@ ///\brief An algorithm for finding a flow of value \c k (for small values of \c k) having minimal total cost #include -#include +#include #include -#include -#include +#include +#include #include namespace hugo { @@ -85,14 +85,13 @@ //auxiliary variables - //The value is 1 iff the edge is reversed. - //If the algorithm has finished, the edges of the seeked paths are - //exactly those that are reversed + //To store the flow EdgeIntMap flow; + //To store the potentila (dual variables) typename Graph::template NodeMap potential; //Container to store found paths - std::vector< std::vector > paths; + //std::vector< std::vector > paths; //typedef DirPath DPath; //DPath paths; @@ -186,6 +185,29 @@ return total_length; } + //This function checks, whether the given solution is optimal + //Running after a \c run() should return with true + bool checkSolution(){ + Length mod_pot; + Length fl_e; + FOR_EACH_LOC(typename Graph::EdgeIt, e, G){ + //C^{\Pi}_{i,j} + mod_pot = length[e]-potential[G.head(e)]+potential[G.head(e)]; + fl_e = flow[e]; + if (0 0 && fl_e != 0) + return false; + if (mod_pot < 0 && fl_e != capacity[e]) + return false; + } + } + return true; + } + /* ///\todo To be implemented later diff -r 9e7613fa6d27 -r d167149bde95 src/work/athos/mincostflows_test.cc --- a/src/work/athos/mincostflows_test.cc Thu May 06 15:14:13 2004 +0000 +++ b/src/work/athos/mincostflows_test.cc Thu May 06 15:19:59 2004 +0000 @@ -2,7 +2,7 @@ #include #include //#include -#include +//#include using namespace std; using namespace hugo; diff -r 9e7613fa6d27 -r d167149bde95 src/work/list_graph.h --- a/src/work/list_graph.h Thu May 06 15:14:13 2004 +0000 +++ b/src/work/list_graph.h Thu May 06 15:19:59 2004 +0000 @@ -5,7 +5,7 @@ #include #include -#include +#include namespace hugo { diff -r 9e7613fa6d27 -r d167149bde95 src/work/marci/graph_wrapper.h --- a/src/work/marci/graph_wrapper.h Thu May 06 15:14:13 2004 +0000 +++ b/src/work/marci/graph_wrapper.h Thu May 06 15:19:59 2004 +0000 @@ -10,7 +10,7 @@ /// ///\author Marton Makai -#include +#include //#include namespace hugo {