class_docstr: A graph data structure to simplify the edge cost graph. It has two main functions:
  1. To feed the quadratic resharding costs into solver, we need to linearize it. We build edge_cost in
  CostGraph, and it stored every combinations of strategies for a src-dst node pair in an 1D list.
  2. To reduce the searching space, we merge computationally-trivial operators, such as
  element-wise operators, transpose, and reduction, into their following nodes. The merging information will
  be given by the StrategiesVector depending on the type of target node and following nodes.
  
  Argument:
      leaf_strategies(List[StrategiesVector]): It stores StrategiesVector of every nodes on the graph.
      simplify(bool, optional): The generated cost graph will be simplified if it is true. (default to True)
code: def _reindexing_src(self, src):
      if src not in self.following_dict:
          return src
      return self._reindexing_src(self.following_dict[src])
  
file_path: ColossalAI/colossalai/auto_parallel/tensor_shard/solver/cost_graph.py
imports: import torch
  from colossalai.auto_parallel.tensor_shard.constants import INFINITY_COST
label_desc: Use image node_id 6 for calling the CostGraph obj's underlying member method code with example usage: obj._reindexing_src(src) and returns: self, src