-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathGraph_FlowNetWorks.h
More file actions
31 lines (25 loc) · 846 Bytes
/
Graph_FlowNetWorks.h
File metadata and controls
31 lines (25 loc) · 846 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
#ifndef FLOW_H_
#define FLOW_H_
// C++ code
#include <iostream>
#include <vector>
#include <queue>
using namespace std;
class Graph_FlowNetWorks{
private:
int num_vertex;
std::vector<std::vector<int>> AdjMatrix;
int maxflow = 0;
public:
Graph_FlowNetWorks():num_vertex(0){};
Graph_FlowNetWorks(int n);
void AddEdge(int from, int to, int capacity);
std::vector<int> FordFulkerson(int source, int termination);
bool BFSfindExistingPath(std::vector<std::vector<int>> graphResidual,
int *predecessor, int source, int termination);
int MinCapacity(std::vector<std::vector<int>> graphResidual,
int *predecessor, int termination);
std::vector<bool> BFS(std::vector<std::vector<int> > matrix, int start);
int get_maxflow(){return maxflow; };
};
#endif