-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Implement first permissible or none strategy for node colouring.
- Loading branch information
1 parent
6436a1d
commit c1ae6fc
Showing
2 changed files
with
27 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
import networkx as nx | ||
|
||
import listcolouring | ||
from listcolouring import first_permissible_or_none_node | ||
|
||
def test_first_permissible_or_none_node(): | ||
G = nx.complete_graph(3) | ||
permissible_dict = {0: [0, 1], 1: [1, 2], 2: [2, 3]} | ||
nx.set_node_attributes(G, permissible_dict, "permissible") | ||
assert first_permissible_or_none_node(G, 0) == 0 | ||
assert first_permissible_or_none_node(G, 1) == 1 | ||
assert first_permissible_or_node_node(G, 2) == 2 |