-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathGraph.h
More file actions
46 lines (32 loc) · 797 Bytes
/
Graph.h
File metadata and controls
46 lines (32 loc) · 797 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
//
// Created by Sparsh on 4/10/2021.
//
#ifndef PROJECT3_GRAPH_H
#define PROJECT3_GRAPH_H
using namespace std;
#include <vector>
#include "Vertex.h"
#include "Edge.h"
class Graph {
private:
Edge *** edgeMatrix;
int totalNumEdges = 0;
int edgeMatrixSize = 0;
public:
void createGraph(int m);
void createEdgeList(int m);
void insertEdge(int u, int v, double weight);
bool eraseEdge(int u, int v);
bool isAdjacent(int u, int v, double weight);
int edgeCount();
void clear();
double mst(int u);
Vertex * getVertex(int index);
int getAdjListSize();
int getVertexNum(int i);
int getAdjVertexNum(int i, int j);
int getNodeDegree(int i);
//debug
double getEdgeWeight(int u, int v);
};
#endif //PROJECT3_GRAPH_H