-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathPushRelabel_2.h
More file actions
36 lines (28 loc) · 887 Bytes
/
PushRelabel_2.h
File metadata and controls
36 lines (28 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
#pragma once
#include "Graph.h"
#include <queue>
#include "FifoQueue.h"
class PushRelabel_2
{
public:
PushRelabel_2(void);
~PushRelabel_2(void);
static int calc(Graph* g);
static int recalc(Graph* gr, Node* preflowNodes, int from, int to, int by);
static EdgeEntry* findLowestLabelEdge(Node* node);
static unsigned long numOfPushes;
static unsigned long numOfRelables;
bool isActive(Node* node);
private:
static int updateLabels(bool fromTarget);
static Graph *g;
static Node* nodeArr;
static int preflow();
static int flow();
static int discharge(Node* node); //for the preflow
static int discharge_back(Node* node); //for the flow
static int findClosestPushBack(Node* node);
static bool isAdmissible(Node* start, EdgeEntry* edge);
static int push(int start, EdgeEntry* edge, int value);
static int relabel(Node* node);
};