pub fn fill_path_gaps(
segments: Vec<AssociatedNetElement>,
netelement_index: &HashMap<String, usize>,
graph: &DiGraph<NetelementSide, f64>,
node_map: &HashMap<NetelementSide, NodeIndex>,
cache: &mut ShortestPathCache,
) -> (Vec<AssociatedNetElement>, Vec<String>, Vec<GapFill>)Expand description
Fill gaps left in the path after sanity validation.
Walks the final path segments and checks each consecutive pair for direct topological connectivity. When a gap is found (no direct edge), a Dijkstra route is attempted and intermediate bridge netelements are inserted.
Before inserting bridges the function checks whether the route would create a U-turn at the target segment (the last bridge NE, the target, and the segment after the target form a directionally inconsistent triple). When a U-turn is detected the target segment is skipped entirely — its GNSS range is absorbed by the predecessor — and the gap is re-evaluated against the next segment in the path.
Returns the gap-filled path, any warnings, and structured gap-fill records.