-
Notifications
You must be signed in to change notification settings - Fork 0
/
graph.h
61 lines (59 loc) · 1.34 KB
/
graph.h
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
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
#pragma once
#include "matrix.h"
#include <map>
#include <vector>
#include <list>
const int INF = 1000000000;
class Graph {
public:
Graph() {
numNode = 0;
numEdge = 0;
k = 0;
numLine = 0;
numColumn = 0;
num = 0;
minimality = 0;
minContraction = 0;
}//èíèöèàëèçàöèÿ
~Graph() {}
Graph(int numNode_, int k_);
bool algorithmEven();
bool algorithmGalil();
void extraMatrix(int numI, int numJ);
Matrix get_Matrix();
Matrix get_ExtraMatrix();
bool checkMinGraph();
bool checkContractionMinmality();
int get_k();
int get_numNode();
int get_numEdge();
int get_numLine();
int get_numColumn();
int get_num();
void set_Matrix(Matrix m);
void set_ExtraMatrix(Matrix m);
void set_k(int k_);
void set_numNode(int nN);
void set_numEdge(int nE);
void set_numLine(int nL);
void set_numColumn(int nC);
void set_num(int n);
bool bfs(Matrix f, std::vector<int>& d, int s, int t);
int dfs(int u, int minFlow, Matrix& f, std::vector<int> ptr, std::vector<int> d, std::vector<int> &vertex, int t);
int dinic(int s, int t);
void set_minimality(bool res);
void set_minContraction(bool res);
void addEdge(int J, int pos_s);
private:
Matrix matrix;
Matrix extra_matrix;
int numNode;
int numEdge;
int k;
int numLine;
int numColumn;
int num;
bool minimality;
bool minContraction;
};