| 44 | } |
| 45 | |
| 46 | RestrictionID getOrInsertStartNode(RestrictionGraph &rg, NodeID from, NodeID to) |
| 47 | { |
| 48 | auto start_edge = std::make_pair(from, to); |
| 49 | auto start_node_idx_itr = rg.start_edge_to_node.find(start_edge); |
| 50 | if (start_node_idx_itr == rg.start_edge_to_node.end()) |
| 51 | { |
| 52 | // First time we have seen a restriction start from this edge. |
| 53 | auto start_node_idx = rg.nodes.size(); |
| 54 | rg.nodes.push_back(RestrictionNode{rg.restrictions.size(), 0, rg.edges.size(), 0}); |
| 55 | start_node_idx_itr = rg.start_edge_to_node.insert({start_edge, start_node_idx}).first; |
| 56 | } |
| 57 | return start_node_idx_itr->second; |
| 58 | } |
| 59 | |
| 60 | RestrictionID insertViaNode(RestrictionGraph &rg, NodeID from, NodeID to) |
| 61 | { |