-
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 node list initialisation (#29)
* Add list_init_node function. * Add tests for the list_init_node function.
- Loading branch information
1 parent
048aad0
commit 99e4c07
Showing
2 changed files
with
22 additions
and
0 deletions.
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,10 @@ | ||
import networkx as nx | ||
|
||
import listcolouring | ||
from listcolouring import list_init_node | ||
|
||
def test_list_init_node(): | ||
G = nx.petersen_graph() | ||
G = list_init_node(G, range(0, 10), 3, 0) | ||
assert G.nodes[0]['colour'] is None | ||
assert len(G.nodes[0]['permissible']) == 3 |