def test_wikipedia_is_dominating_set():
 G = nx.cycle_graph(4)
 G.add_edges_from([(0, 4), (1, 4), (2, 5)])
 assert_true(nx.is_dominating_set(G, set([4, 3, 5])))
 assert_true(nx.is_dominating_set(G, set([0, 2])))
 assert_true(nx.is_dominating_set(G, set([1, 2])))

def test_wikipedia_is_dominating_set ( ) : G = nx . cycle_graph ( 4 ) G . add_edges_from ( [ ( 0 , 4 ) , ( 1 , 4 ) , ( 2 , 5 ) ] ) assert_true ( nx . is_dominating_set ( G , set ( [ 4 , 3 , 5 ] ) ) ) assert_true ( nx . is_dominating_set ( G , set ( [ 0 , 2 ] ) ) ) assert_true ( nx . is_dominating_set ( G , set ( [ 1 , 2 ] ) ) )
example from URL .