code: def setup_class(cls):
      cls.DG = nx.DiGraph()
      cls.DG.add_weighted_edges_from(
          {
              ("A", "B", 3),
              ("A", "C", 17),
              ("A", "D", 14),
              ("B", "A", 3),
              ("B", "C", 12),
              ("B", "D", 16),
              ("C", "A", 13),
              ("C", "B", 12),
              ("C", "D", 4),
              ("D", "A", 14),
              ("D", "B", 15),
              ("D", "C", 2),
          }
      )
      cls.DG_cycle = ["D", "C", "B", "A", "D"]
      cls.DG_cost = 31.0
  
      cls.DG2 = nx.DiGraph()
      cls.DG2.add_weighted_edges_from(
          {
              ("A", "B", 3),
              ("A", "C", 17),
              ("A", "D", 14),
              ("B", "A", 30),
              ("B", "C", 2),
              ("B", "D", 16),
              ("C", "A", 33),
              ("C", "B", 32),
              ("C", "D", 34),
              ("D", "A", 14),
              ("D", "B", 15),
              ("D", "C", 2),
          }
      )
      cls.DG2_cycle = ["D", "A", "B", "C", "D"]
      cls.DG2_cost = 53.0
  
      cls.unweightedUG = nx.complete_graph(5, nx.Graph())
      cls.unweightedDG = nx.complete_graph(5, nx.DiGraph())
  
      cls.incompleteUG = nx.Graph()
      cls.incompleteUG.add_weighted_edges_from({(0, 1, 1), (1, 2, 3)})
      cls.incompleteDG = nx.DiGraph()
      cls.incompleteDG.add_weighted_edges_from({(0, 1, 1), (1, 2, 3)})
  
      cls.UG = nx.Graph()
      cls.UG.add_weighted_edges_from(
          {
              ("A", "B", 3),
              ("A", "C", 17),
              ("A", "D", 14),
              ("B", "C", 12),
              ("B", "D", 16),
              ("C", "D", 4),
          }
      )
      cls.UG_cycle = ["D", "C", "B", "A", "D"]
      cls.UG_cost = 33.0
  
      cls.UG2 = nx.Graph()
      cls.UG2.add_weighted_edges_from(
          {
              ("A", "B", 1),
              ("A", "C", 15),
              ("A", "D", 5),
              ("B", "C", 16),
              ("B", "D", 8),
              ("C", "D", 3),
          }
      )
      cls.UG2_cycle = ["D", "C", "B", "A", "D"]
      cls.UG2_cost = 25.0
  
imports: import random
  import pytest
  import networkx
  import networkx.algorithms.approximation
label_desc: Use image node_id 1 for calling the TestBase obj's underlying member method code with example usage: obj.setup_class(cls) without return types