-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathRouteGraph.h
More file actions
38 lines (31 loc) · 1010 Bytes
/
Copy pathRouteGraph.h
File metadata and controls
38 lines (31 loc) · 1010 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
27
28
29
30
31
32
33
34
35
36
37
38
#ifndef ROUTEGRAPH_H
#define ROUTEGRAPH_H
#include "common.h"
#include <string>
#include <vector>
#include <list>
#include <queue>
#include <map>
#include <set>
#include <iomanip>
using namespace std;
class RouteGraph
{
private:
// map<Stop Name, List of Edges>
// Edge: pair<Destination Stop, pair<Time, Bus Number>>
map<string, list<pair<string, pair<int, string>>>> adjList;
// Map for linking normalized names to Capitalised names
map<string, string> stopNameMap;
public:
// Adds a single bus stop to the graph.
void addStop(string stopName);
// Adds a one-way connection between two stops.
void addRouteConnection(string stopA, string stopB, int time, string busNumber);
// shortest path with Dijkstra
RoutePlan findShortestPath(string startStop, string endStop);
void printAllStops();
// Gets the direct travel time between two adjacent stops on a specific bus.
int getDirectTravelTime(string stopA, string stopB, string busNum);
};
#endif