Flowlessly  0.1
Minimum cost maximum cost solver
 All Classes Functions Pages
cycle_cancelling.h
1 // The Flowlessly project
2 // Copyright (c) 2013-2016 Ionel Gog <ionel.gog@cl.cam.ac.uk>
3 
4 #ifndef FLOWLESSLY_CYCLE_CANCELLING_H
5 #define FLOWLESSLY_CYCLE_CANCELLING_H
6 
7 #include "solvers/solver.h"
8 
9 #include <gtest/gtest_prod.h>
10 #include <vector>
11 
12 #include "graphs/adjacency_map_graph.h"
13 #include "misc/statistics.h"
14 
15 namespace flowlessly {
16 
20 class CycleCancelling : public Solver {
21  public:
23  ~CycleCancelling();
24 
25  void PrepareState();
30  bool Run();
31 
32  private:
33  FRIEND_TEST(CycleCancellingTests, AugmentFlow);
34 
35  void AugmentFlow(const vector<uint32_t>& predecessor, uint32_t src_node,
36  uint32_t dst_node);
37  // Returns true if it removes a negative cycle.
38  bool RemoveNegativeCycles(const vector<uint32_t>& predecessor);
39 
40  AdjacencyMapGraph* graph_;
41 };
42 
43 } // namespace flowlessly
44 #endif // FLOWLESSLY_CYCLE_CANCELLING_H
Definition: statistics.h:19
Definition: solver.h:14
Definition: cycle_cancelling.h:20
Definition: cycle_cancelling_tests.cc:18
bool Run()
Definition: cycle_cancelling.cc:108
Definition: adjacency_map_graph.h:22