COIN-OR::LEMON - Graph Library

Changeset 551:d167149bde95 in lemon-0.x for src/work


Ignore:
Timestamp:
05/06/04 17:19:59 (20 years ago)
Author:
athos
Branch:
default
Phase:
public
Convert:
svn:c9d7d8f5-90d6-0310-b91f-818b3a526b0e/lemon/trunk@724
Message:

Written hugo/ into includes.

Location:
src/work
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • src/work/athos/makefile

    r527 r551  
    11BINARIES = suurballe minlength_demo mincostflows_test
    2 INCLUDEDIRS= -I../../include -I.. -I../{athos,klao,marci,jacint,alpar,johanna,akos}
     2INCLUDEDIRS= -I../.. -I.. -I../{athos,klao,marci,jacint,alpar,johanna,akos}
    33include ../makefile
    44
  • src/work/athos/mincostflows.h

    r547 r551  
    88
    99#include <iostream>
    10 #include <dijkstra.h>
     10#include <hugo/dijkstra.h>
    1111#include <graph_wrapper.h>
    12 #include <maps.h>
    13 #include <vector.h>
     12#include <hugo/maps.h>
     13#include <vector>
    1414#include <for_each_macros.h>
    1515
     
    8686    //auxiliary variables
    8787
    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
    9189    EdgeIntMap flow;
     90    //To store the potentila (dual variables)
    9291    typename Graph::template NodeMap<Length> potential;
    9392   
    9493    //Container to store found paths
    95     std::vector< std::vector<Edge> > paths;
     94    //std::vector< std::vector<Edge> > paths;
    9695    //typedef DirPath<Graph> DPath;
    9796    //DPath paths;
     
    187186    }
    188187
     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   
    189211    /*
    190212      ///\todo To be implemented later
  • src/work/athos/mincostflows_test.cc

    r530 r551  
    33#include <mincostflows.h>
    44//#include <path.h>
    5 #include <maps.h>
     5//#include <maps.h>
    66
    77using namespace std;
  • src/work/list_graph.h

    r443 r551  
    66#include <vector>
    77
    8 #include <invalid.h>
     8#include <hugo/invalid.h>
    99
    1010namespace hugo {
  • src/work/marci/graph_wrapper.h

    r526 r551  
    1111///\author Marton Makai
    1212
    13 #include <invalid.h>
     13#include <hugo/invalid.h>
    1414//#include <iter_map.h>
    1515
Note: See TracChangeset for help on using the changeset viewer.