-
Notifications
You must be signed in to change notification settings - Fork 0
/
Grafo.h
48 lines (37 loc) · 1.11 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
#ifndef __GRAFO__H__
#define __GRAFO__H__
#include <map>
#include <string.h>
#include <vector>
#include <algorithm>
#include <queue>
#include "sequence.h"
using namespace std;
template < class T, class C >
class Grafo {
public:
typedef vector<T> TVertice;
typedef map<unsigned long, C> TFila;
typedef map<unsigned long, TFila> TMatriz;
typedef vector<bool> TMarca;
Grafo();
~Grafo();
unsigned long InsertarVertice(T v);
void InsertarArista(unsigned long i, unsigned long j, C costo);
unsigned long ObtenerNumVertices();
unsigned long ObtenerNumAristas();
unsigned long ObtenerNumerodeAristas();
T ObtenerVertice(unsigned long i);
C ObtenerCostoArista(unsigned long i, unsigned long j);
bool BuscarVertice(T v);
bool BuscarArista(unsigned long i, unsigned long j);
bool EliminarVertice(T v);
bool EliminarArista(unsigned long i, unsigned long j);
vector<unsigned long> Dijkstra(unsigned long indiceInicio, unsigned long indiceFinal);
vector<unsigned long> baseRemota(unsigned long indiceInicio);
protected:
TVertice l_vertices;
TMatriz m_costos;
};
#include "Grafo.hxx"
#endif