MCPcopy Create free account
hub / github.com/Project-OSRM/osrm-backend / FindSmallestEdge

Method FindSmallestEdge

include/util/dynamic_graph.hpp:378–393  ·  view source on GitHub ↗

searches for a specific edge

Source from the content-addressed store, hash-verified

376
377 // searches for a specific edge
378 EdgeIterator FindSmallestEdge(const NodeIterator from, const NodeIterator to) const
379 {
380 EdgeIterator smallest_edge = SPECIAL_EDGEID;
381 EdgeWeight smallest_weight = INVALID_EDGE_WEIGHT;
382 for (auto edge : GetAdjacentEdgeRange(from))
383 {
384 const NodeID target = GetTarget(edge);
385 const EdgeWeight weight = GetEdgeData(edge).distance;
386 if (target == to && weight < smallest_weight)
387 {
388 smallest_edge = edge;
389 smallest_weight = weight;
390 }
391 }
392 return smallest_edge;
393 }
394
395 EdgeIterator FindEdgeInEitherDirection(const NodeIterator from, const NodeIterator to) const
396 {

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected