00001
00002
00003
00004
00005 #ifndef ROUTEPLANNING_EXPANDEDDIJKSTRA_H_
00006 #define ROUTEPLANNING_EXPANDEDDIJKSTRA_H_
00007
00008 #include <queue>
00009 #include "./Graph.h"
00010 #include "./TransitNetworkExpanded.h"
00011
00012 using std::priority_queue;
00013
00014 class ExpandedDijkstra
00015 {
00016 public:
00017 ExpandedDijkstra(TransitNetworkExpanded* transitNetwork);
00018 virtual ~ExpandedDijkstra();
00019
00020 double computeShortestPath(string startStop, Time time,
00021 string endStop, bool buildPath);
00022
00023
00024 double computeShortestPath(int startStopId, Time startTime, int endStopId,
00025 bool reconstructPath);
00026
00027 vector<pair<NodeExpanded, Edge> > transitShortestPath;
00028 private:
00029 void reconstructShortestPath(const unordered_set<int>& startIds, int endId);
00030 TransitNetworkExpanded* _transitGraph;
00031 vector<int> _timesFromStart;
00032 priority_queue <pair<int, int>,
00033 std::vector<pair<int, int> >,
00034 std::greater<pair<int, int > > > _openNodeQueue;
00035
00036
00037
00038
00039 vector<pair<int, int> > _expandedFrom;
00040 vector<bool> _expanded;
00041 };
00042
00043 #endif // ROUTEPLANNING_EXPANDEDDIJKSTRA_H_
00044