Open
Graph Drawing
Framework

 v.2012.05
 

MinCostFlowModule.h
Go to the documentation of this file.
00001 /*
00002  * $Revision: 2299 $
00003  * 
00004  * last checkin:
00005  *   $Author: gutwenger $ 
00006  *   $Date: 2012-05-07 15:57:08 +0200 (Mon, 07 May 2012) $ 
00007  ***************************************************************/
00008  
00046 #ifdef _MSC_VER
00047 #pragma once
00048 #endif
00049 
00050 #ifndef OGDF_MIN_COST_FLOW_MODULE_H
00051 #define OGDF_MIN_COST_FLOW_MODULE_H
00052 
00053 
00054 #include <ogdf/basic/Graph.h>
00055 
00056 
00057 namespace ogdf {
00058 
00059 
00063 class OGDF_EXPORT MinCostFlowModule
00064 {
00065 public:
00067     MinCostFlowModule() { }
00068 
00069     // destruction
00070     virtual ~MinCostFlowModule() { }
00071 
00087     virtual bool call(
00088         const Graph &G,                   // directed graph
00089         const EdgeArray<int> &lowerBound, // lower bound for flow
00090         const EdgeArray<int> &upperBound, // upper bound for flow
00091         const EdgeArray<int> &cost,       // cost of an edge
00092         const NodeArray<int> &supply,     // supply (if neg. demand) of a node
00093         EdgeArray<int> &flow,             // computed flow
00094         NodeArray<int> &dual            // computed dual variables
00095         ) = 0;
00096 
00097 
00098     //
00099     // static functions
00100     //
00101 
00106     static void generateProblem(
00107         Graph &G,
00108         int n,
00109         int m,
00110         EdgeArray<int> &lowerBound,
00111         EdgeArray<int> &upperBound,
00112         EdgeArray<int> &cost,
00113         NodeArray<int> &supply);
00114 
00115 
00129     static bool checkProblem(
00130         const Graph &G,
00131         const EdgeArray<int> &lowerBound,
00132         const EdgeArray<int> &upperBound,
00133         const NodeArray<int> &supply);
00134 
00135 
00136 
00156     static bool checkComputedFlow(
00157         const Graph &G,
00158         EdgeArray<int> &lowerBound,
00159         EdgeArray<int> &upperBound,
00160         EdgeArray<int> &cost,
00161         NodeArray<int> &supply,
00162         EdgeArray<int> &flow,
00163         int &value);
00164 
00183     static bool checkComputedFlow(
00184         const Graph &G,
00185         EdgeArray<int> &lowerBound,
00186         EdgeArray<int> &upperBound,
00187         EdgeArray<int> &cost,
00188         NodeArray<int> &supply,
00189         EdgeArray<int> &flow)
00190     {
00191         int value;
00192         return checkComputedFlow(
00193             G,lowerBound,upperBound,cost,supply,flow,value);
00194     }
00195 };
00196 
00197 
00198 } // end namespace ogdf
00199 
00200 
00201 #endif