diff options
author | Delille Louis <louis.delille@supelec.fr> | 2021-01-28 10:54:25 +0100 |
---|---|---|
committer | Delille Louis <louis.delille@supelec.fr> | 2021-01-28 10:54:25 +0100 |
commit | e133f98c55b681aff474412e17551fcefdf4ba7a (patch) | |
tree | af3391c80ab01311edb9f655370610cc2bd4233d | |
parent | a1d3eb1a42c1e3953e6631c1d6ced5f9333daee1 (diff) | |
download | networkx-e133f98c55b681aff474412e17551fcefdf4ba7a.tar.gz |
reformatted test_kernighan_lin.py
-rw-r--r-- | networkx/algorithms/community/tests/test_kernighan_lin.py | 22 |
1 files changed, 18 insertions, 4 deletions
diff --git a/networkx/algorithms/community/tests/test_kernighan_lin.py b/networkx/algorithms/community/tests/test_kernighan_lin.py index 8ea19008..a452d686 100644 --- a/networkx/algorithms/community/tests/test_kernighan_lin.py +++ b/networkx/algorithms/community/tests/test_kernighan_lin.py @@ -66,10 +66,24 @@ def test_multigraph(): def test_max_iter_argument(): G = nx.Graph( - [("A", "B", {'weight': 1}), ("A", "C", {'weight': 2}), ("A", "D", {'weight': 3}), ("A", "E", {'weight': 2}), - ("A", "F", {'weight': 4}), ("B", "C", {'weight': 1}), ("B", "D", {'weight': 4}), ("B", "E", {'weight': 2}), - ("B", "F", {'weight': 1}), ("C", "D", {'weight': 3}), ("C", "E", {'weight': 2}), ("C", "F", {'weight': 1}), - ("D", "E", {'weight': 4}), ("D", "F", {'weight': 3}), ("E", "F", {'weight': 2})]) + [ + ("A", "B", {"weight": 1}), + ("A", "C", {"weight": 2}), + ("A", "D", {"weight": 3}), + ("A", "E", {"weight": 2}), + ("A", "F", {"weight": 4}), + ("B", "C", {"weight": 1}), + ("B", "D", {"weight": 4}), + ("B", "E", {"weight": 2}), + ("B", "F", {"weight": 1}), + ("C", "D", {"weight": 3}), + ("C", "E", {"weight": 2}), + ("C", "F", {"weight": 1}), + ("D", "E", {"weight": 4}), + ("D", "F", {"weight": 3}), + ("E", "F", {"weight": 2}), + ] + ) partition = ({"A", "B", "C"}, {"D", "E", "F"}) C = kernighan_lin_bisection(G, partition, max_iter=1) assert_partition_equal(C, ({"A", "F", "C"}, {"D", "E", "B"})) |