-
Notifications
You must be signed in to change notification settings - Fork 1
/
grafo.h
61 lines (47 loc) · 1.59 KB
/
grafo.h
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
51
52
53
54
55
56
57
58
59
60
61
/**
*
* Trabalho 02 - Algoritmos com grafos
*
* Adriano de Araujo Abreu Mourao (mourao.aaa at gmail.com)
* Tamires Vargas Capanema Franco Santos (tamiresvargas at hotmail.com)
*
**/
#ifndef GRAFO_H
#define GRAFO_H
#include "gMatriz.h"
#include <vector>
#include <list>
#include <set>
#include <map>
#include <utility>
namespace graf_bib {
class grafo : public gMatriz {
private:
unsigned int numVertices;
unsigned int numArestas;
std::vector<std::string> corVertice;
std::map<unsigned int, unsigned int> peso;
void bfs_visit(const unsigned int &indice,
Caminho &vistados, Caminho &fifo);
void dfs_visit(const unsigned int &indice,
Caminho &vistados);
void dfs_visit(Matriz mAdj, const unsigned int &indice,
Caminho &vistados);
unsigned int extract_min(Caminho &queue);
public:
grafo(std::string arquivo);
unsigned int retNumVertices(void);
unsigned int retNumArestas(void);
Matriz retMatriz();
bool completo(void);
Matriz completarGrafo(void);
Caminho bfs(unsigned int indiceInicial);
Caminho dfs(unsigned int indiceInicial);
Caminho dfs(Matriz mAdj, unsigned int indiceInicial);
Caminho dijkstra(unsigned int verInicial, unsigned int verFinal);
unsigned int num_componentes (void);
bool hamiltoniano (void);
Matriz kruskal(void);
};
}
#endif // GRAFO_H