[Lemon-commits] [lemon_svn] athos: r724 - in hugo/trunk/src/work: . athos marci
Lemon SVN
svn at lemon.cs.elte.hu
Mon Nov 6 20:41:09 CET 2006
Author: athos
Date: Thu May 6 17:19:59 2004
New Revision: 724
Modified:
hugo/trunk/src/work/athos/makefile
hugo/trunk/src/work/athos/mincostflows.h
hugo/trunk/src/work/athos/mincostflows_test.cc
hugo/trunk/src/work/list_graph.h
hugo/trunk/src/work/marci/graph_wrapper.h
Log:
Written hugo/ into includes.
Modified: hugo/trunk/src/work/athos/makefile
==============================================================================
--- hugo/trunk/src/work/athos/makefile (original)
+++ hugo/trunk/src/work/athos/makefile Thu May 6 17:19:59 2004
@@ -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
Modified: hugo/trunk/src/work/athos/mincostflows.h
==============================================================================
--- hugo/trunk/src/work/athos/mincostflows.h (original)
+++ hugo/trunk/src/work/athos/mincostflows.h Thu May 6 17:19:59 2004
@@ -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 <iostream>
-#include <dijkstra.h>
+#include <hugo/dijkstra.h>
#include <graph_wrapper.h>
-#include <maps.h>
-#include <vector.h>
+#include <hugo/maps.h>
+#include <vector>
#include <for_each_macros.h>
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<Length> potential;
//Container to store found paths
- std::vector< std::vector<Edge> > paths;
+ //std::vector< std::vector<Edge> > paths;
//typedef DirPath<Graph> 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<fl_e && fl_e<capacity[e]){
+ if (mod_pot != 0)
+ return false;
+ }
+ else{
+ if (mod_pot > 0 && fl_e != 0)
+ return false;
+ if (mod_pot < 0 && fl_e != capacity[e])
+ return false;
+ }
+ }
+ return true;
+ }
+
/*
///\todo To be implemented later
Modified: hugo/trunk/src/work/athos/mincostflows_test.cc
==============================================================================
--- hugo/trunk/src/work/athos/mincostflows_test.cc (original)
+++ hugo/trunk/src/work/athos/mincostflows_test.cc Thu May 6 17:19:59 2004
@@ -2,7 +2,7 @@
#include <list_graph.h>
#include <mincostflows.h>
//#include <path.h>
-#include <maps.h>
+//#include <maps.h>
using namespace std;
using namespace hugo;
Modified: hugo/trunk/src/work/list_graph.h
==============================================================================
--- hugo/trunk/src/work/list_graph.h (original)
+++ hugo/trunk/src/work/list_graph.h Thu May 6 17:19:59 2004
@@ -5,7 +5,7 @@
#include <iostream>
#include <vector>
-#include <invalid.h>
+#include <hugo/invalid.h>
namespace hugo {
Modified: hugo/trunk/src/work/marci/graph_wrapper.h
==============================================================================
--- hugo/trunk/src/work/marci/graph_wrapper.h (original)
+++ hugo/trunk/src/work/marci/graph_wrapper.h Thu May 6 17:19:59 2004
@@ -10,7 +10,7 @@
///
///\author Marton Makai
-#include <invalid.h>
+#include <hugo/invalid.h>
//#include <iter_map.h>
namespace hugo {
More information about the Lemon-commits
mailing list