-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathGraph.hpp
50 lines (40 loc) · 1.32 KB
/
Graph.hpp
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
/*
* ID: 53036281
* Email: [email protected]
* @author Samuel Lazareanu
*/
#pragma once
#include <vector>
using namespace std;
namespace ariel {
class Graph{
// private: by default
vector<vector<int>> adjMatrix;
bool negativeCycles;
bool cycles;
public:
// Inline Constructors
Graph(){ negativeCycles = false; cycles = false; adjMatrix = {}; }
Graph(vector<vector<int>> adjMatrix){ Graph(); loadGraph(adjMatrix); }
// Declaring Functions:
/*
* Load the received adjacency matrix to the object.
* Returns 1 if succeeds, 0 if fails.
*/
void loadGraph(vector<vector<int>>);
/*
* Prints the adjMatrix and the number of verices and edges in the graph.
*/
void printGraph();
/*
* Returns the size of the AdjMatrix of the graph.
* Size represents the number vertices = number of rows and cols (square matrix).
*/
size_t getSize();
int getWeight(size_t, size_t) const;
bool getCycles() const;
bool getNegativeCycles() const;
void setCycles(bool);
void setNegativeCycles(bool);
};
}