Available on crate feature
algorithms only.Expand description
Unit-hop shortest paths on a hypergraph (xgi/algorithms/shortest_path.py).
XGI’s Dijkstra uses a fixed increment of 1 per hop, i.e. BFS levels over the
node-neighbour relation. We hand-roll that BFS (unit-weight exact parity;
keeps the algorithm independent of the rustworkx-core dijkstra return type).
Functions§
- shortest_
path_ length - Distances from every source. XGI parity:
shortest_path_length. - single_
source_ shortest_ path_ length - Distances from
sourceto every node (unit hops). Unreachable nodes getf64::INFINITY;sourcegets0. Keys innode_ids()order.Noneifsourceis absent. XGI parity:single_source_shortest_path_length.