| 141 | } |
| 142 | |
| 143 | bool CheckGraphConnectivity(Segment const & start, bool isOutgoing, bool useRoutingOptions, size_t limit, |
| 144 | WorldGraph & graph, set<Segment> & marked) |
| 145 | { |
| 146 | queue<Segment> q; |
| 147 | q.push(start); |
| 148 | |
| 149 | marked.insert(start); |
| 150 | |
| 151 | WorldGraph::SegmentEdgeListT edges; |
| 152 | while (!q.empty() && marked.size() < limit) |
| 153 | { |
| 154 | auto const u = q.front(); |
| 155 | q.pop(); |
| 156 | |
| 157 | edges.clear(); |
| 158 | |
| 159 | // Note. If |isOutgoing| == true outgoing edges are looked for. |
| 160 | // If |isOutgoing| == false it's the finish. So ingoing edges are looked for. |
| 161 | graph.GetEdgeList(u, isOutgoing, useRoutingOptions, edges); |
| 162 | for (auto const & edge : edges) |
| 163 | { |
| 164 | auto const & v = edge.GetTarget(); |
| 165 | if (marked.count(v) == 0) |
| 166 | { |
| 167 | q.push(v); |
| 168 | marked.insert(v); |
| 169 | } |
| 170 | } |
| 171 | } |
| 172 | |
| 173 | return marked.size() >= limit; |
| 174 | } |
| 175 | |
| 176 | // AStarLengthChecker ------------------------------------------------------------------------------ |
| 177 | |