code: def apsp_floyd_warshall_costs(A):
      """Runs the Floyd Warshall algorithm to return an nxn matrix which computes the
      all pairs shortest paths. Here A(i,j) is treated as the distance from i to j.
      So 0's will be counted as 0's. Non-edges should be specified as infinities.
      Just copying the pseudo code in Wikipedia."""
      dist = deepcopy(A)
      np.fill_diagonal(dist, 0)
      n = A.shape[0]
      for k in range(n):
          for i in range(n):
              for j in range(n):
                  if dist[i, j] > dist[i, k] + dist[k, j]:
                      dist[i, j] = dist[i, k] + dist[k, j]
      return dist
  
file_path: dragonfly/dragonfly/utils/graph_utils.py
imports: from copy import deepcopy
  import numpy
  from scipy.linalg import eigh
  from .general_utils import get_nonzero_indices_in_vector
label_desc: Use image node_id 8 for calling a global function with example usage: apsp_floyd_warshall_costs(A) and returns: dist