ash_model.paths.s_distance

ash_model.paths.s_distance(h, s, fr=None, to=None, start=None, end=None, weight=False, edge=True)[source]

Compute shortest-path distances in s-line-graph or dual hypergraph. If edge=True, uses s-line-graph; otherwise uses dual hypergraph.

Parameters:
  • h (ASH) – ASH instance.

  • s (int) – Minimum overlap size.

  • fr (str | None) – Source ID.

  • to (str | None) – Target ID.

  • start (int | None) – Start time bound.

  • end (int | None) – End time bound.

  • weight (bool) – Use edge weight attribute ‘w’ if True.

  • edge (bool) – If False, use dual hypergraph distances.

Returns:

Single distance, nested dict of distances, or None if unreachable.

Return type:

int | Dict[str, Dict[str, int]] | None