-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathGraph.h
More file actions
50 lines (33 loc) · 1.06 KB
/
Graph.h
File metadata and controls
50 lines (33 loc) · 1.06 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
50
//
// Created by Max on 19/04/2020.
//
#ifndef GRAPH_PROJECT_GRAPH_H
#define GRAPH_PROJECT_GRAPH_H
#include <vector>
#include <string>
#include <iostream>
#include <fstream>
#include <sstream>
using namespace std;
class Graph {
private:
vector<vector<unsigned int>> matrix;
unsigned int nbVertices = 0;
public: // Constructors
Graph() = default;
Graph(const string& directory, const string& instance);
public: // Getters
unsigned int getDistance(unsigned int i, unsigned int j) const;
unsigned int getNbVertices() const;
public: // Functions
void splitString(const string& str, char delimiter, vector<unsigned int>& node);
/*!
* \brief Fill the matrix with a .in file. Don't put the extension in the instance string
* \param directory : Put "" if the file is in the main directory
*/
void generateWithFile(const string& directory, const string& instance);
void printNbVertices();
void printMatrix();
unsigned int getValueOfMatrix(unsigned int x, unsigned int y) const;
};
#endif //GRAPH_PROJECT_GRAPH_H