Changeset 551:d167149bde95 in lemon-0.x for src
- Timestamp:
- 05/06/04 17:19:59 (21 years ago)
- Branch:
- default
- Phase:
- public
- Convert:
- svn:c9d7d8f5-90d6-0310-b91f-818b3a526b0e/lemon/trunk@724
- Location:
- src/work
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
src/work/athos/makefile
r527 r551 1 1 BINARIES = suurballe minlength_demo mincostflows_test 2 INCLUDEDIRS= -I../.. /include-I.. -I../{athos,klao,marci,jacint,alpar,johanna,akos}2 INCLUDEDIRS= -I../.. -I.. -I../{athos,klao,marci,jacint,alpar,johanna,akos} 3 3 include ../makefile 4 4 -
src/work/athos/mincostflows.h
r547 r551 8 8 9 9 #include <iostream> 10 #include < dijkstra.h>10 #include <hugo/dijkstra.h> 11 11 #include <graph_wrapper.h> 12 #include < maps.h>13 #include <vector .h>12 #include <hugo/maps.h> 13 #include <vector> 14 14 #include <for_each_macros.h> 15 15 … … 86 86 //auxiliary variables 87 87 88 //The value is 1 iff the edge is reversed. 89 //If the algorithm has finished, the edges of the seeked paths are 90 //exactly those that are reversed 88 //To store the flow 91 89 EdgeIntMap flow; 90 //To store the potentila (dual variables) 92 91 typename Graph::template NodeMap<Length> potential; 93 92 94 93 //Container to store found paths 95 std::vector< std::vector<Edge> > paths;94 //std::vector< std::vector<Edge> > paths; 96 95 //typedef DirPath<Graph> DPath; 97 96 //DPath paths; … … 187 186 } 188 187 188 //This function checks, whether the given solution is optimal 189 //Running after a \c run() should return with true 190 bool checkSolution(){ 191 Length mod_pot; 192 Length fl_e; 193 FOR_EACH_LOC(typename Graph::EdgeIt, e, G){ 194 //C^{\Pi}_{i,j} 195 mod_pot = length[e]-potential[G.head(e)]+potential[G.head(e)]; 196 fl_e = flow[e]; 197 if (0<fl_e && fl_e<capacity[e]){ 198 if (mod_pot != 0) 199 return false; 200 } 201 else{ 202 if (mod_pot > 0 && fl_e != 0) 203 return false; 204 if (mod_pot < 0 && fl_e != capacity[e]) 205 return false; 206 } 207 } 208 return true; 209 } 210 189 211 /* 190 212 ///\todo To be implemented later -
src/work/athos/mincostflows_test.cc
r530 r551 3 3 #include <mincostflows.h> 4 4 //#include <path.h> 5 #include <maps.h>5 //#include <maps.h> 6 6 7 7 using namespace std; -
src/work/list_graph.h
r443 r551 6 6 #include <vector> 7 7 8 #include < invalid.h>8 #include <hugo/invalid.h> 9 9 10 10 namespace hugo { -
src/work/marci/graph_wrapper.h
r526 r551 11 11 ///\author Marton Makai 12 12 13 #include < invalid.h>13 #include <hugo/invalid.h> 14 14 //#include <iter_map.h> 15 15
Note: See TracChangeset
for help on using the changeset viewer.