-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathGrafo.h
More file actions
53 lines (42 loc) · 1.01 KB
/
Copy pathGrafo.h
File metadata and controls
53 lines (42 loc) · 1.01 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
51
52
53
#ifndef GRAFO_H
#define GRAFO_H
#include <vector>
#include <string>
#include <stdlib.h>
#include <fstream>
#include <iostream>
#include <sstream>
#include <limits>
using namespace std;
struct Conexion {
int nodoAdyacente;
float costo;
};
struct Nodo {
int etiqueta;
bool visitado;
vector<Conexion> adyacentes;
};
class Grafo
{
private:
int numeroNodos;
int numeroAristas;
vector<Nodo> nodos;
int **matrizAdyacencia;
void crearNodos();
void crearMatriz();
void floydHelper();
public:
Grafo(string nombreArchivo);
virtual ~Grafo();
Conexion menor(vector<Conexion> &frontera);
void dijkstra(int inicio, int fin);
void floyd(int inicio, int fin);
void leer(string nombreArchivo);
void desplegarCamino(vector<int> &camino);
void desplegar();
void imprimirMatriz();
int getNumeroNodos();
};
#endif // GRAFO_H