-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathGraph.h
56 lines (50 loc) · 1.14 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
#ifndef GRAPH_H
#define GRAPH_H
#include "Edge.h"
#include "Result.hpp"
#include <sstream>
#include <fstream>
#include <iostream>
#include <climits>
#include <queue>
#include <list>
#include <algorithm>
#include <random>
#include <iomanip>
class Graph {
public:
Graph();
Graph(int capMax, int effMax, int pMax, int plMax, int vtMax);
~Graph();
void load(char * filename);
void addSource(int v, float eff);
void addValve(int v, float capacity);
void addSink(int v);
void addEdge(int v1, int v2, float capacity);
void initFlow();
float maxFlow();
void splitValves();
void addRevEdges();
void printFlow();
void generate();
void printGraph();
void printResult();
private:
int mainSource;
int mainSink;
int vCount;
int eCount;
std::vector<std::list<Edge>> vertices;
std::vector<int> sources;
std::vector<int> valves;
std::vector<int> sinks;
std::vector<float> valveCap;
std::vector<float> sourceEff;
std::vector<std::pair<int, float>> result;
int CAP_MAX;
int EFF_MAX;
int P_MAX;
int PL_MAX; //maksymalna dlugosc sciezki
int VT_MAX; //liczba wierzcholkow danego typu
};
#endif