void Dijkstra::pushChild(char id, const Element& parentNode, Visited& visited, Priority& priority, Graph &network,double startTime) { double cost= findCost(id,parentNode,network,startTime); // get the cost of the node...from the unique function if (visited.find(id) == visited.end()) { // Element is not in visited map -> add it //visited.insert(std::pair<char,Element>(id,Element(id,cost,parentNode.id))); - we are going to check if visited later Element newnode; newnode.id=id;newnode.cost=cost;newnode.parent=parentNode.id; newnode.parents.push_back(parentNode.id); priority.push(newnode); } else { // if the current cost is less than or equal to the elements cost then we may need to update the map if (cost == visited.at(id).cost){ // we have found the node at the same cost... we need to put it as a parent as well visited[id].parents.push_back(parentNode.id); } else if (cost < visited.at(id).cost){ // need to look at node again visited[id].cost=cost; priority.push(visited[id]); } } }