MCPcopy Create free account
hub / github.com/comaps/comaps / CheckGraphConnectivity

Function CheckGraphConnectivity

libs/routing/routing_helpers.cpp:143–174  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

141}
142
143bool 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

Callers 1

IsDeadEndFunction · 0.85

Calls 10

pushMethod · 0.80
frontMethod · 0.80
popMethod · 0.80
GetTargetMethod · 0.80
insertMethod · 0.45
emptyMethod · 0.45
sizeMethod · 0.45
clearMethod · 0.45
GetEdgeListMethod · 0.45
countMethod · 0.45

Tested by

no test coverage detected