plastro.plasticity.get_distances_of_moves

plastro.plasticity.get_distances_of_moves(G: Graph, sources: List[str], targets: List[str]) ndarray[source]

Compute shortest path distances between source and target nodes.

Parameters:
  • G (networkx.Graph) – Graph representing phenotypic connectivity.

  • sources (List[str]) – List of source node names.

  • targets (List[str]) – List of target node names.

Returns:

Array of shortest path distances between corresponding source-target pairs.

Return type:

np.ndarray

Raises:

AssertionError – If sources and targets have different lengths.