class_docstr: Unit tests for the min_degree function
docstr: Test small tree
  
  Test if the computed treewidth of the known self.small_tree is 2.
  As we know which value we can expect from our heuristic, values other
  than two are regressions
docstr_tok: ["Test","small","tree","Test","if","the","computed","treewidth","of","the","known","self.small_tree","is","2",".","As","we","know","which","value","we","can","expect","from","our","heuristic",",","values","other","than","two","are","regressions"]
code: def test_small_tree_treewidth(self):
      """Test small tree
  
      Test if the computed treewidth of the known self.small_tree is 2.
      As we know which value we can expect from our heuristic, values other
      than two are regressions
      """
      G = self.small_tree
      # the order of removal should be [1,2,4]3[5,6,7]
      # (with [] denoting any order of the containing nodes)
      # resulting in treewidth 2 for the heuristic
      treewidth, _ = treewidth_min_fill_in(G)
      assert treewidth == 2
  
imports: import itertools
  import networkx
  from networkx.algorithms.approximation import treewidth_min_degree, treewidth_min_fill_in
  from networkx.algorithms.approximation.treewidth import MinDegreeHeuristic, min_fill_in_heuristic
label_desc: Use image node_id 3 for calling the TestTreewidthMinDegree obj's underlying member method code with example usage: obj.test_small_tree_treewidth() without return types