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: Backward pass in PBQP to generate optimal solution.
docstr_tok: ["Backward","pass","in","PBQP","to","generate","optimal","solution","."]
code: def _backward(self):
      """Backward pass in PBQP to generate optimal solution."""
      # Solve nodes left in the forward graph
      for node_idx in self._buckets[0]:
          record_costs = self._record_cost_dict[node_idx]
          min_cost = min(record_costs)
          self._optimal_record_dict[node_idx] = record_costs.index(
              min_cost
          )
  
      # Solve nodes with one or two degrees
      for node_idx in reversed(self._stack):
          self._backward_insert_node(node_idx)
          if node_idx not in self._optimal_record_dict:
              record_costs = list(self._record_cost_dict[node_idx])
              for adj_node in self._adj_dict[node_idx]:
                  adj_optimal_idx = self._optimal_record_dict[adj_node]
                  for i, _ in enumerate(record_costs):
                      record_costs[
                          i
                      ] += self._layout_transform_interlayer_cost[
                          (node_idx, adj_node)
                      ][
                          i
                      ][
                          adj_optimal_idx
                      ]
              min_cost = min(record_costs)
              self._optimal_record_dict[node_idx] = record_costs.index(
                  min_cost
              )
  
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 11 for calling the PBQPTuner obj's underlying member method code with example usage: obj._backward() without return types