code: def test_min_weighted_dominating_set(self):
      graph = nx.Graph()
      graph.add_edge(1, 2)
      graph.add_edge(1, 5)
      graph.add_edge(2, 3)
      graph.add_edge(2, 5)
      graph.add_edge(3, 4)
      graph.add_edge(3, 6)
      graph.add_edge(5, 6)
  
      vertices = {1, 2, 3, 4, 5, 6}
      # due to ties, this might be hard to test tight bounds
      dom_set = min_weighted_dominating_set(graph)
      for vertex in vertices - dom_set:
          neighbors = set(graph.neighbors(vertex))
          assert (
              len(neighbors & dom_set) > 0
          ), "Non dominating set found!"
  
file_path: networkx/networkx/algorithms/approximation/tests/test_dominating_set.py
imports: import pytest
  import networkx
  from networkx.algorithms.approximation import min_edge_dominating_set, min_weighted_dominating_set
label_desc: Use image node_id 1 for calling the TestMinWeightDominatingSet obj's underlying member method code with example usage: obj.test_min_weighted_dominating_set() without return types