-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathGraphNode.h
More file actions
50 lines (41 loc) · 1.08 KB
/
Copy pathGraphNode.h
File metadata and controls
50 lines (41 loc) · 1.08 KB
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
#pragma once
#include <iostream>
using namespace std;
class GraphNode
{
private:
int vertexName;
int capacity;
int flow;
public:
GraphNode(int vertexName, int capacity, int flow) {
this->vertexName = vertexName;
this->capacity = capacity;
this->flow = flow;
}
const int getVertexName() const {
return this->vertexName;
}
const int getCapacity() const {
return this->capacity;
}
const int getFlow() const {
return this->flow;
}
void setVertexName(int vertexName) {
this->vertexName = vertexName;
}
void setCapacity(int capacity) {
this->capacity = capacity;
}
void setFlow(int flow) {
this->flow += flow;
}
friend bool operator<(const GraphNode& a, const GraphNode& b);
friend bool operator>(const GraphNode& a, const GraphNode& b);
friend bool operator==(const GraphNode& a, const int& i);
friend bool operator==(const GraphNode& a, const GraphNode& b);
friend bool operator<=(const GraphNode& a, const GraphNode& b);
friend bool operator>=(const GraphNode& a, const GraphNode& b);
friend ostream& operator<<(std::ostream& os, const GraphNode& p);
};