src/work/marci/augmenting_flow.h
changeset 944 4f064aff855e
parent 921 818510fa3d99
child 970 09f9abe22df2
equal deleted inserted replaced
7:eb6d5c311be7 8:cbb2923ab761
     4 
     4 
     5 #include <vector>
     5 #include <vector>
     6 #include <iostream>
     6 #include <iostream>
     7 
     7 
     8 #include <lemon/graph_wrapper.h>
     8 #include <lemon/graph_wrapper.h>
     9 #include <bfs_dfs.h>
     9 //#include <bfs_dfs.h>
       
    10 #include <bfs_mm.h>
    10 #include <lemon/invalid.h>
    11 #include <lemon/invalid.h>
    11 #include <lemon/maps.h>
    12 #include <lemon/maps.h>
    12 #include <lemon/tight_edge_filter_map.h>
    13 #include <demo/tight_edge_filter_map.h>
    13 
    14 
    14 /// \file
    15 /// \file
    15 /// \brief Maximum flow algorithms.
    16 /// \brief Maximum flow algorithms.
    16 /// \ingroup galgs
    17 /// \ingroup galgs
    17 
    18 
    18 namespace lemon {
    19 namespace lemon {
       
    20   using lemon::marci::BfsIterator;
       
    21   using lemon::marci::DfsIterator;
    19 
    22 
    20   /// \addtogroup galgs
    23   /// \addtogroup galgs
    21   /// @{                                                                                                                                        
    24   /// @{                                                                                                                                        
    22   /// Class for augmenting path flow algorithms.
    25   /// Class for augmenting path flow algorithms.
    23 
    26 
   107     class TrickyReachedMap {
   110     class TrickyReachedMap {
   108     protected:
   111     protected:
   109       IntMap* map;
   112       IntMap* map;
   110       int* number_of_augmentations;
   113       int* number_of_augmentations;
   111     public:
   114     public:
       
   115       typedef Node KeyType;
       
   116       typedef bool ValueType;
   112       TrickyReachedMap(IntMap& _map, int& _number_of_augmentations) : 
   117       TrickyReachedMap(IntMap& _map, int& _number_of_augmentations) : 
   113 	map(&_map), number_of_augmentations(&_number_of_augmentations) { }
   118 	map(&_map), number_of_augmentations(&_number_of_augmentations) { }
   114       void set(const Node& n, bool b) {
   119       void set(const Node& n, bool b) {
   115 	if (b)
   120 	if (b)
   116 	  map->set(n, *number_of_augmentations);
   121 	  map->set(n, *number_of_augmentations);