code: def drnl_node_labeling(subgraph, src, dst):
      """
      Double Radius Node labeling
      d = r(i,u)+r(i,v)
      label = 1+ min(r(i,u),r(i,v))+ (d//2)*(d//2+d%2-1)
      Isolated nodes in subgraph will be set as zero.
      Extreme large graph may cause memory error.
  
      Args:
          subgraph(DGLGraph): The graph
          src(int): node id of one of src node in new subgraph
          dst(int): node id of one of dst node in new subgraph
      Returns:
          z(Tensor): node labeling tensor
      """
      adj = subgraph.adj_external().to_dense().numpy()
      src, dst = (dst, src) if src > dst else (src, dst)
  
      idx = list(range(src)) + list(range(src + 1, adj.shape[0]))
      adj_wo_src = adj[idx, :][:, idx]
  
      idx = list(range(dst)) + list(range(dst + 1, adj.shape[0]))
      adj_wo_dst = adj[idx, :][:, idx]
  
      dist2src = shortest_path(
          adj_wo_dst, directed=False, unweighted=True, indices=src
      )
      dist2src = np.insert(dist2src, dst, 0, axis=0)
      dist2src = torch.from_numpy(dist2src)
  
      dist2dst = shortest_path(
          adj_wo_src, directed=False, unweighted=True, indices=dst - 1
      )
      dist2dst = np.insert(dist2dst, src, 0, axis=0)
      dist2dst = torch.from_numpy(dist2dst)
  
      dist = dist2src + dist2dst
      dist_over_2, dist_mod_2 = dist // 2, dist % 2
  
      z = 1 + torch.min(dist2src, dist2dst)
      z += dist_over_2 * (dist_over_2 + dist_mod_2 - 1)
      z[src] = 1.0
      z[dst] = 1.0
      z[torch.isnan(z)] = 0.0
  
      return z.to(torch.long)
  
file_path: dgl/examples/pytorch/seal/utils.py
imports: import argparse
  import dgl
  import numpy
  import pandas
  import torch
  from ogb.linkproppred import DglLinkPropPredDataset, Evaluator
  from scipy.sparse.csgraph import shortest_path
label_desc: Use image node_id 3 for calling a global function with example usage: drnl_node_labeling(subgraph, src, dst) and returns: z