Planning & Search in Rust
Esc

Loading…

↑↓ move ↵ open Esc close
Colour theme
All algorithms

Dissimilar paths

search multiobjective-search

This search gives up to k paths from a start to a goal that overlap little. It ranks loopless paths best-first by a scalar cost, with ties broken by the edge sequence, and keeps a path only if it shares at most max_shared edges with every path it kept before. The answer is greedy: each kept path is the cheapest one that is different enough from the earlier ones, not the best set as a whole. It needs a graph with edge identities (EdgeGraph), and its run time can grow exponentially, as for every ranking method. Use it to offer alternative routes, or backup routes that do not fail together.

Pseudocode

algorithm Dissimilar-paths(s₀, goal, cost, k, m)input: start s₀, goal test goal, scalar edge cost, number of paths k, overlap limit moutput: up to k loopless paths, each sharing at most m edges with every other oneKEPT ← []OPEN ← {[s₀]}                                ▷ ordered by (cost, edge sequence)while OPEN ≠ ∅ and |KEPT| < k doπ ← extract-min(OPEN)s ← last state of πif goal(s) thenif |edges(π) ∩ edges(κ)| ≤ m for every κ in KEPT thenappend(KEPT, π)                        ▷ greedy: the cheapest dissimilar onecontinuefor each (e, s′, c) in edges-out(s) doif s′ ∉ π then                           ▷ looplessinsert(OPEN, π extended by e to s′, cost(π) + c)return KEPT

In the crates

Papers

  1. Finding shortest and dissimilar paths Ali Moghanni, Marta Pascoal, Maria Teresa Godinho · 2022· International Transactions in Operational Research analyses doi 10.1111/itor.13060
  2. Multiobjective Path Problems and Algorithms in Telecommunication Network Design—Overview and Trends José Craveirinha, João Clímaco, Rita Girão-Silva, Marta Pascoal · 2024· Algorithms survey doi 10.3390/a17060222