-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmain.cpp
More file actions
53 lines (50 loc) · 1.67 KB
/
Copy pathmain.cpp
File metadata and controls
53 lines (50 loc) · 1.67 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
#include "Grafo.h"
#include <iostream>
#include <fstream>
using namespace std;
int main()
{
Grafo nodos("grafo.txt");
int opcion = 0;
int partida = 0;
int llegada = 0;
while (opcion != 3){
cout << "Dijkstra y Floyd algoritmos de caminos cortos" << endl;
cout << "=============================================" << endl;
cout << "Menu" << endl;
cout << "\tSeleccione una opcion: " << endl;
cout << "\t1. Dijkstra" << endl;
cout << "\t2. Floyd" << endl;
cout << "\t3. Salir" << endl << endl;
cout << "Grafo: " << endl;
cout << "=============================================" << endl;
nodos.desplegar();
cout << "=============================================" << endl;
cout << "inserte su opcion: ";
cin >> opcion;
switch (opcion) {
case 1:
cout << "Ingrese el nodo de inicio: " << endl;
cin >> partida;
cout << "Ingrese el nodo al que desea llegar: " << endl;
cin >> llegada;
nodos.dijkstra(partida, llegada);
break;
case 2:
cout << "Ingrese el nodo de inicio: " << endl;
cin >> partida;
cout << "Ingrese el nodo al que desea llegar: " << endl;
cin >> llegada;
nodos.floyd(partida, llegada);
break;
case 3:
cout << "Termina el programa" << endl;
return 0;
break;
}
opcion = 0;
partida = 0;
llegada = 0;
}
return 0;
}