src/work/edmonds_karp.hh
changeset 129 1630a5b631c8
parent 107 8d62f0072ff0
child 133 0631992fe7a1
equal deleted inserted replaced
7:3281bb354c9a 8:1bb8dd30d045
    10 
    10 
    11 namespace hugo {
    11 namespace hugo {
    12 
    12 
    13   template<typename Graph, typename Number, typename FlowMap, typename CapacityMap>
    13   template<typename Graph, typename Number, typename FlowMap, typename CapacityMap>
    14   class ResGraph {
    14   class ResGraph {
       
    15   public:
    15     typedef typename Graph::NodeIt NodeIt;
    16     typedef typename Graph::NodeIt NodeIt;
    16     typedef typename Graph::EachNodeIt EachNodeIt;
    17     typedef typename Graph::EachNodeIt EachNodeIt;
       
    18   private:
    17     typedef typename Graph::SymEdgeIt OldSymEdgeIt;
    19     typedef typename Graph::SymEdgeIt OldSymEdgeIt;
    18     const Graph& G;
    20     const Graph& G;
    19     FlowMap& flow;
    21     FlowMap& flow;
    20     const CapacityMap& capacity;
    22     const CapacityMap& capacity;
    21   public:
    23   public:
   116   };
   118   };
   117 
   119 
   118 
   120 
   119   template<typename Graph, typename Number, typename FlowMap, typename CapacityMap>
   121   template<typename Graph, typename Number, typename FlowMap, typename CapacityMap>
   120   class ResGraph2 {
   122   class ResGraph2 {
       
   123   public:
   121     typedef typename Graph::NodeIt NodeIt;
   124     typedef typename Graph::NodeIt NodeIt;
   122     typedef typename Graph::EachNodeIt EachNodeIt;
   125     typedef typename Graph::EachNodeIt EachNodeIt;
       
   126   private:
   123     //typedef typename Graph::SymEdgeIt OldSymEdgeIt;
   127     //typedef typename Graph::SymEdgeIt OldSymEdgeIt;
   124     typedef typename Graph::OutEdgeIt OldOutEdgeIt;
   128     typedef typename Graph::OutEdgeIt OldOutEdgeIt;
   125     typedef typename Graph::InEdgeIt OldInEdgeIt;
   129     typedef typename Graph::InEdgeIt OldInEdgeIt;
   126     
   130     
   127     const Graph& G;
   131     const Graph& G;
   241     };
   245     };
   242   };
   246   };
   243 
   247 
   244   template<typename Graph, typename Number, typename FlowMap, typename CapacityMap>
   248   template<typename Graph, typename Number, typename FlowMap, typename CapacityMap>
   245   class ResGraph3 {
   249   class ResGraph3 {
   246 public:
   250   public:
   247     typedef typename Graph::NodeIt NodeIt;
   251     typedef typename Graph::NodeIt NodeIt;
   248     typedef typename Graph::EachNodeIt EachNodeIt;
   252     typedef typename Graph::EachNodeIt EachNodeIt;
       
   253 
       
   254   private:
   249     //typedef typename Graph::SymEdgeIt OldSymEdgeIt;
   255     //typedef typename Graph::SymEdgeIt OldSymEdgeIt;
   250     typedef typename Graph::OutEdgeIt OldOutEdgeIt;
   256     typedef typename Graph::OutEdgeIt OldOutEdgeIt;
   251     typedef typename Graph::InEdgeIt OldInEdgeIt;
   257     typedef typename Graph::InEdgeIt OldInEdgeIt;
   252     
       
   253 private:
       
   254     const Graph& G;
   258     const Graph& G;
   255     FlowMap& flow;
   259     FlowMap& flow;
   256     const CapacityMap& capacity;
   260     const CapacityMap& capacity;
   257   public:
   261   public:
   258     ResGraph3(const Graph& _G, FlowMap& _flow, 
   262     ResGraph3(const Graph& _G, FlowMap& _flow, 
   375   };
   379   };
   376 
   380 
   377 
   381 
   378   template <typename Graph, typename Number, typename FlowMap, typename CapacityMap>
   382   template <typename Graph, typename Number, typename FlowMap, typename CapacityMap>
   379   class MaxFlow {
   383   class MaxFlow {
       
   384   public:
   380     typedef typename Graph::NodeIt NodeIt;
   385     typedef typename Graph::NodeIt NodeIt;
   381     typedef typename Graph::EdgeIt EdgeIt;
   386     typedef typename Graph::EdgeIt EdgeIt;
   382     typedef typename Graph::EachEdgeIt EachEdgeIt;
   387     typedef typename Graph::EachEdgeIt EachEdgeIt;
   383     typedef typename Graph::OutEdgeIt OutEdgeIt;
   388     typedef typename Graph::OutEdgeIt OutEdgeIt;
   384     typedef typename Graph::InEdgeIt InEdgeIt;
   389     typedef typename Graph::InEdgeIt InEdgeIt;
       
   390 
       
   391   private:
   385     const Graph& G;
   392     const Graph& G;
   386     NodeIt s;
   393     NodeIt s;
   387     NodeIt t;
   394     NodeIt t;
   388     FlowMap& flow;
   395     FlowMap& flow;
   389     const CapacityMap& capacity;
   396     const CapacityMap& capacity;
   546 */
   553 */
   547 
   554 
   548   
   555   
   549   template <typename Graph, typename Number, typename FlowMap, typename CapacityMap>
   556   template <typename Graph, typename Number, typename FlowMap, typename CapacityMap>
   550   class MaxFlow2 {
   557   class MaxFlow2 {
       
   558   public:
   551     typedef typename Graph::NodeIt NodeIt;
   559     typedef typename Graph::NodeIt NodeIt;
   552     typedef typename Graph::EdgeIt EdgeIt;
   560     typedef typename Graph::EdgeIt EdgeIt;
   553     typedef typename Graph::EachEdgeIt EachEdgeIt;
   561     typedef typename Graph::EachEdgeIt EachEdgeIt;
   554     typedef typename Graph::OutEdgeIt OutEdgeIt;
   562     typedef typename Graph::OutEdgeIt OutEdgeIt;
   555     typedef typename Graph::InEdgeIt InEdgeIt;
   563     typedef typename Graph::InEdgeIt InEdgeIt;
       
   564   private:
   556     const Graph& G;
   565     const Graph& G;
   557     std::list<NodeIt>& S;
   566     std::list<NodeIt>& S;
   558     std::list<NodeIt>& T;
   567     std::list<NodeIt>& T;
   559     FlowMap& flow;
   568     FlowMap& flow;
   560     const CapacityMap& capacity;
   569     const CapacityMap& capacity;