+std::vector<std::string> Bot::shortestPath(std::string from, std::string to, std::string type){
+
+ priority_queue<vector<string>, vector<vector<string> >, greater<vector<string> > > pq;
+
+ vector<string> v;
+ v.push_back(from);
+
+ pq.push(v);
+ hash_map<string,bool> settled;
+
+ while(!pq.empty()){
+ const vector<string>& w = pq.top();
+ if (w.back() == to)
+ return w;
+ settled[w.back()] = true;
+ Intersection& inter = _intersections[w.back()];
+ for (hash_map<string,StreetType>::const_iterator street = inter.connections.begin();
+ street != inter.connections.end(); ++street){
+ if (settled.find(street->first) == settled.end())
+ continue;
+ bool car = type == "cop-car";
+ if ( (car && (street->second == car || street->second == both)) ||
+ (!car && (street->second == foot || street->second == both))){
+ v = w;
+ v.push_back(street->first);
+ pq.push(v);
+ }
+ }
+
+ pq.pop();
+ }
+
+ return vector<string>();
+}