src/work/jacint/max_flow.h
changeset 875 fda944f15ca7
parent 656 9971eb8bfbe8
child 921 818510fa3d99
equal deleted inserted replaced
17:5cf15410ac8a 18:000020cac70e
   149       bool operator[](const Node& n) const { 
   149       bool operator[](const Node& n) const { 
   150 	return (*map)[n]==*number_of_augmentations; 
   150 	return (*map)[n]==*number_of_augmentations; 
   151       }
   151       }
   152     };
   152     };
   153     
   153     
       
   154     ///Constructor
       
   155 
       
   156     ///\todo Document, please.
       
   157     ///
   154     MaxFlow(const Graph& _G, Node _s, Node _t, const CapMap& _capacity,
   158     MaxFlow(const Graph& _G, Node _s, Node _t, const CapMap& _capacity,
   155 	    FlowMap& _flow) :
   159 	    FlowMap& _flow) :
   156       g(&_G), s(_s), t(_t), capacity(&_capacity),
   160       g(&_G), s(_s), t(_t), capacity(&_capacity),
   157       flow(&_flow), n(_G.nodeNum()), level(_G), excess(_G,0), 
   161       flow(&_flow), n(_G.nodeNum()), level(_G), excess(_G,0), 
   158       status(AFTER_NOTHING), number_of_augmentations(0) { }
   162       status(AFTER_NOTHING), number_of_augmentations(0) { }
   178     ///\pre The starting flow must be
   182     ///\pre The starting flow must be
   179     /// - a constant zero flow if \c fe is \c ZERO_FLOW,
   183     /// - a constant zero flow if \c fe is \c ZERO_FLOW,
   180     /// - an arbitary flow if \c fe is \c GEN_FLOW,
   184     /// - an arbitary flow if \c fe is \c GEN_FLOW,
   181     /// - an arbitary preflow if \c fe is \c PRE_FLOW,
   185     /// - an arbitary preflow if \c fe is \c PRE_FLOW,
   182     /// - any map if \c fe is NO_FLOW.
   186     /// - any map if \c fe is NO_FLOW.
       
   187     ///
       
   188     ///\todo NO_FLOW should be the default flow.
   183     void preflow(FlowEnum fe) {
   189     void preflow(FlowEnum fe) {
   184       preflowPhase1(fe);
   190       preflowPhase1(fe);
   185       preflowPhase2();
   191       preflowPhase2();
   186     }
   192     }
   187     // Heuristics:
   193     // Heuristics: