Grafalgo
Library of useful data structures and algorithms
|
00001 // lcapc class encapsulates data and routines used by least cost aug path 00002 // algorithm for min cost flow. Use constructor to invoke algorithm. 00003 00004 #ifndef LCAP_H 00005 #define LCAP_H 00006 00007 #include "stdinc.h" 00008 #include "Wflograph.h" 00009 #include "List.h" 00010 #include "Dheap.h" 00011 00012 using namespace grafalgo; 00013 00014 class lcap { 00015 public: 00016 lcap(Wflograph&, flow&, floCost&, bool); 00017 protected: 00018 Wflograph* wfg; // graph we're finding flow on 00019 int* lab; // lab[u] is label used to transform costs 00020 edge* pEdge; // pEdge[u] is edge to parent of u in spt 00021 00022 void pathRcapCost(flow&,floCost&); // return path res cap and cost 00023 void augment(flow&); // add flow to augmenting path 00024 void initLabels(); // initialize labels for transformed costs 00025 bool findpath(); // find a least cost augmenting path 00026 }; 00027 00028 #endif