Grafalgo
Library of useful data structures and algorithms
/Users/jst/src/grafalgo/cpp/include/dinic.h
00001 // Dinic class. Encapsulates data and routines used by Dinic's
00002 // algorithm for max flow. Use constructor to invoke algorithm.
00003 
00004 #ifndef DINIC_H
00005 #define DINIC_H
00006 
00007 #include "augPath.h"
00008 
00009 class dinic : public augPath {
00010 public:
00011                 dinic(Flograph&,int&);
00012                 dinic(Flograph&,int&,string&);
00013 private:
00014         int*    nextEdge;       // ignore edges before nextEdge[u] in adj. list
00015         int*    level;          // level[u]=# of edges in path from source
00016 
00017         bool    findPath() { return findPath(fg->src()); }
00018         bool    findPath(vertex); // find augmenting path
00019 
00020         bool    newPhase();     // prepare for a new phase
00021 
00022         // statistics
00023         int numPhase;
00024         int numPaths;
00025         long long int avgPathLength;
00026         uint32_t phaseTime;
00027         uint32_t pathTime;
00028 };
00029 
00030 #endif
 All Classes Files Functions Variables Typedefs Friends