Mercurial > repos > shellac > sam_consensus_v3
comparison env/lib/python3.9/site-packages/networkx/generators/tests/test_mycielski.py @ 0:4f3585e2f14b draft default tip
"planemo upload commit 60cee0fc7c0cda8592644e1aad72851dec82c959"
author | shellac |
---|---|
date | Mon, 22 Mar 2021 18:12:50 +0000 |
parents | |
children |
comparison
equal
deleted
inserted
replaced
-1:000000000000 | 0:4f3585e2f14b |
---|---|
1 """Unit tests for the :mod:`networkx.generators.mycielski` module.""" | |
2 | |
3 import networkx as nx | |
4 | |
5 | |
6 class TestMycielski: | |
7 def test_construction(self): | |
8 G = nx.path_graph(2) | |
9 M = nx.mycielskian(G) | |
10 assert nx.is_isomorphic(M, nx.cycle_graph(5)) | |
11 | |
12 def test_size(self): | |
13 G = nx.path_graph(2) | |
14 M = nx.mycielskian(G, 2) | |
15 assert len(M) == 11 | |
16 assert M.size() == 20 | |
17 | |
18 def test_mycielski_graph_generator(self): | |
19 G = nx.mycielski_graph(1) | |
20 assert nx.is_isomorphic(G, nx.empty_graph(1)) | |
21 G = nx.mycielski_graph(2) | |
22 assert nx.is_isomorphic(G, nx.path_graph(2)) | |
23 G = nx.mycielski_graph(3) | |
24 assert nx.is_isomorphic(G, nx.cycle_graph(5)) | |
25 G = nx.mycielski_graph(4) | |
26 assert nx.is_isomorphic(G, nx.mycielskian(nx.cycle_graph(5))) |