//! Small graph helpers shared by the distance-geometry paths.
use VecDeque;
/// All-pairs topological distance matrix (number of bonds between atoms) over a
/// plain adjacency list, computed by a BFS from each node. Unreachable pairs
/// are left as [`usize::MAX`].
///
/// Both the legacy first-principles bounds (`distance_geometry`) and the
/// RDKit-aligned bounds (`distgeom::bounds`) need this matrix; keeping one
/// implementation avoids the two copies drifting apart.
pub