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 get_edge_cost(self, src_node, dst_node):
      return self.edge_costs[(src_node, dst_node)]
  
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 4 for calling the CostGraph obj's underlying member method code with example usage: obj.get_edge_cost(src_node, dst_node) and returns: self