class_docstr: An approximation method to deal with intractably
  large size of graph tuning problem.
  
  This graph coloring algorithm mainly comes from:
  
  Lang Hames and Bernhard Scholz.
  Nearly optimal register allocation with pbqp.JMLC 2006.
  LNCS, vol.4228,pp. 346-361, 2016
class_docstr_tok: ["An","approximation","method","to","deal","with","intractably","large","size","of","graph","tuning","problem",".","This","graph","coloring","algorithm","mainly","comes","from",":","Lang","Hames","and","Bernhard","Scholz",".","Nearly","optimal","register","allocation","with","pbqp.JMLC","2006",".","LNCS",",","vol.4228",",","pp",".","346-361",",","2016"]
docstr: Reduce nodes with degree 1.
docstr_tok: ["Reduce","nodes","with","degree","1","."]
code: def _RI_reduction(self, node_idx):
      """Reduce nodes with degree 1."""
      adj_node = self._adj_dict[node_idx][0]
      ltf_matrix = self._layout_transform_interlayer_cost[
          (adj_node, node_idx)
      ]
      for i, cost_vec in enumerate(ltf_matrix):
          min_cost = INVALID_LAYOUT_TIME
          for j, cost in enumerate(cost_vec):
              min_cost = min(
                  min_cost, cost + self._record_cost_dict[node_idx][j]
              )
          self._record_cost_dict[adj_node][i] += min_cost
      self._remove_node(node_idx)
      self._reorder_adj_nodes(node_idx)
      self._stack.append(node_idx)
  
file_path: tvm/python/tvm/autotvm/graph_tuner/pbqp_tuner.py
imports: from ._base import INVALID_LAYOUT_TIME
  from .base_graph_tuner import BaseGraphTuner
  from .utils import is_boundary_node, has_multiple_inputs
label_desc: Use image node_id 7 for calling the PBQPTuner obj's underlying member method code with example usage: obj._RI_reduction(node_idx) without return types