-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathgraph.h
More file actions
45 lines (39 loc) · 775 Bytes
/
graph.h
File metadata and controls
45 lines (39 loc) · 775 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
45
#ifndef GRAPH_H
#define GRAPH_H
#include<vector>
#include<bits/stdc++.h>
using namespace std;
struct Vertex{
int h, e_flow;
Vertex(int h, int e_flow){
this->h = h;
this->e_flow = e_flow;
}
};
struct Edge{
int flow, capacity;
int u, v;
Edge(int flow, int capacity, int u, int v){
this->flow = flow;
this->capacity = capacity;
this->u = u;
this->v = v;
}
};
class Graph
{
public:
Graph(int V);
private:
int V;
vector<Vertex> ver;
vector<Edge> edge;
public:
bool push(int u);
void relabel(int u);
void preflow(int s);
void updateReverseEdgeFlow(int i, int flow);
void addEdge(int u, int v, int capacity);
int getMaxFlow(int s, int t);
};
#endif // GRAPH_H