-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathGraphProjectEdge.cpp
More file actions
47 lines (38 loc) · 804 Bytes
/
GraphProjectEdge.cpp
File metadata and controls
47 lines (38 loc) · 804 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
46
47
#include <iostream>
#include <string>
using namespace std;
//
class Edges {
public:
Edges(int node1, int node2, int weight) {
this->node1 = node1;
this->node2 =node2;
this->weight =weight;
}
int getNode1() {return node1;};
int getNode2() {return node2;};
int getWeight() {return weight;};
void setNode1(int node1){
this->node1 = node1;
}
void setNode2(int node2){
this->node2 = node2;
}
void setWeight(int weight){
this->weight = weight;
}
void initialize(numNodes){ // hàm tao mot graph trong (graph toan 0)
edges.resize(numNodes);
for (int i=0;i<numNodes;i++){
edges[i].resize(numNodes);
}
}
private:
int node1;
int node2;
int weight;
vector<vector<int>> edges;
};
int main()
{
}