code: def test_zero_distance(self):
      XG = nx.DiGraph()
      XG.add_weighted_edges_from(
          [
              ("s", "u", 10),
              ("s", "x", 5),
              ("u", "v", 1),
              ("u", "x", 2),
              ("v", "y", 1),
              ("x", "u", 3),
              ("x", "v", 5),
              ("x", "y", 2),
              ("y", "s", 7),
              ("y", "v", 6),
          ]
      )
      path, dist = nx.floyd_warshall_predecessor_and_distance(XG)
  
      for u in XG:
          assert dist[u][u] == 0
  
      GG = XG.to_undirected()
      # make sure we get lower weight
      # to_undirected might choose either edge with weight 2 or weight 3
      GG["u"]["x"]["weight"] = 2
      path, dist = nx.floyd_warshall_predecessor_and_distance(GG)
  
      for u in GG:
          dist[u][u] = 0
  
file_path: networkx/networkx/algorithms/shortest_paths/tests/test_dense.py
imports: import pytest
  import networkx
label_desc: Use image node_id 8 for calling the TestFloyd obj's underlying member method code with example usage: obj.test_zero_distance() without return types