Skip to main content

Module hierarchical_path

Module hierarchical_path 

Source
Expand description

Hierarchical / fractal shortest-path decomposition (Riehl-Hespanha, Fractal Graph Optimization) — solve shortest paths by splitting the graph into clusters and composing a high-level portal problem with independent intra-cluster subproblems. The subproblems are independent, so they map naturally onto the engine’s independent 512 MB fractal-swarm worker cells (affordability: less coupled compute, distributable).

With the full border set the decomposition is exact (it matches plain Dijkstra — any inter-cluster path must cross a border), which the tests verify. dijkstra is the always-present CPU reference. Kernel-class Reduction.

Functions§

dijkstra
Plain Dijkstra (the exact reference). Returns shortest distance from source to every node over the directed weighted graph; unreachable nodes are f64::INFINITY. edges_of[i] lists (neighbour, weight).
hierarchical_shortest_path
Hierarchical shortest distance from s to t using the cluster decomposition in cluster_of. Builds a small portal graph over the border nodes (+ s, t), so the only global work is on borders; everything else is independent intra-cluster subproblems. Returns the exact shortest distance.