-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathPushRelableAlgo.h
More file actions
44 lines (29 loc) · 887 Bytes
/
PushRelableAlgo.h
File metadata and controls
44 lines (29 loc) · 887 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
#ifndef PushRelableAlgo_h
#define PushRelableAlgo_h
#include <vector>
#include <queue>
#include <list>
#include "Network.h"
#include "MaxFlowFinder.h"
using namespace std;
class PushRelabelAlgo : public MaxFlowFinder {
private:
std::vector <size_t> height, currentEdge;
std::vector <long long> excess;
size_t doIt;
std::queue <size_t> q;
std::list< size_t > verteces;
const long long INF = 1e16;
void initialize();
void discharge(size_t v, Network& networkGraph);
bool push(size_t _u, Network& networkGraph);
void relabel(size_t _u, size_t degU, Network& networkGraph);
public:
~PushRelabelAlgo() {}
Network networkGraph;
vector < pair <size_t, size_t> > inputEdgesOrder;
void findMaxFlow(Network& networkGraph);
void output(std::vector < std::pair <size_t, size_t> > inputEdgesOrder);
};
ostream& operator << (ostream& stream, PushRelabelAlgo algo);
#endif