class_docstr: The class wrapper the PGL graph, the class involve the funtions to implement struc2vec algorithm.
docstr: Use the optimization algorithm to reduce the next steps range. 
docstr_tok: ["Use","the","optimization","algorithm","to","reduce","the","next","steps","range","."]
code: def calc_node_with_neighbor_dtw_opt2(self, src):
      """
      Use the optimization algorithm to reduce the next steps range.
      """
      from fastdtw import fastdtw
  
      node_nbh_list = self.get_sim_neighbours(
          src, self.selected_nbh_nums
      )
      distance = {}
      for dist in node_nbh_list:
          calc_layer_len = min(
              len(self.degree_list[src]), len(self.degree_list[dist])
          )
          distance_iteration = 0.0
          distance[src, dist] = {}
          for layer in range(0, calc_layer_len):
              src_layer = self.degree_list[src][layer]
              dist_layer = self.degree_list[dist][layer]
              weight, path = fastdtw(
                  src_layer,
                  dist_layer,
                  radius=1,
                  dist=self.distance_calc_func,
              )
              distance_iteration += weight
              distance[src, dist][layer] = distance_iteration
      return distance
  
imports: import argparse
  import math
  import random
  import numpy
  import pgl
  from pgl import graph
  from pgl.graph_kernel import alias_sample_build_table
  from pgl.sample import alias_sample
  from data_loader import EdgeDataset
  from classify import train_lr_model
  from sklearn_classify import train_lr_l2_model
label_desc: Use image node_id 7 for calling the StrucVecGraph obj's underlying member method code with example usage: obj.calc_node_with_neighbor_dtw_opt2(src) and returns: distance