-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathgraph-mat.hpp
More file actions
36 lines (28 loc) · 777 Bytes
/
graph-mat.hpp
File metadata and controls
36 lines (28 loc) · 777 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
#ifndef GRAPH_H_
#define GRAPH_H_
#include <climits>
#include <list>
#include <utility>
#include <vector>
#define INF INT_MAX
using namespace std;
class Graph {
public:
int V;
int E; // # of directed edges
vector<vector<int>> adj;
// constructor
Graph(int _V);
// Graph() : V(0), E(0) { nodes.clear(); }
// Graph(int _nc, bool _d = false) : V(_nc), E(0){};
// copy constructor
// move constructor
// destructor
void addNode();
void addEdge(int v, int w, int weight); // v->w (directed)
bool isEdge(int v, int w); // returns 1 if there is an edge from v to w, otherwise 0.
void print();
int getNodeSize();
int getEdgeSize(bool isDirected);
};
#endif