-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmain.cpp
More file actions
26 lines (23 loc) · 807 Bytes
/
Copy pathmain.cpp
File metadata and controls
26 lines (23 loc) · 807 Bytes
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
#include <iostream>
#include "Parser.h"
#include "Dijkstra.h"
#include "Utils.h"
#include "GraphGenerator.h"
int main(int argc, char* argv[]) {
//Graph::edgeMap * edges = GraphGenerator::generateGraph(5000, 1, 1, 10);
//Parser::parseGraphToFile(edges, "parsedEdges.txt");
std::unordered_map<int, std::list<Edge>> * graphEdges;
Graph * graph = nullptr;
Dijkstra * dijkstraAlgorithm = nullptr;
if (argc == 3 || argc == 4) {
graphEdges = Parser::parseFile(argv[1]);
graph = new Graph(graphEdges);
dijkstraAlgorithm = new Dijkstra(*graph);
if (argc == 3)
dijkstraAlgorithm->shortestPath(atoi(argv[2]));
else
dijkstraAlgorithm->shortestPath(atoi(argv[2]), atoi(argv[3]));
} else
displayHelp();
return 0;
}