Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/mhenderson/listcolouring
List colouring in Python with NetworkX.
https://github.com/mhenderson/listcolouring
graph-colouring graphs networkx python
Last synced: about 1 month ago
JSON representation
List colouring in Python with NetworkX.
- Host: GitHub
- URL: https://github.com/mhenderson/listcolouring
- Owner: MHenderson
- License: mit
- Created: 2023-08-04T08:39:31.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2024-03-11T15:23:08.000Z (8 months ago)
- Last Synced: 2024-03-12T16:17:43.229Z (8 months ago)
- Topics: graph-colouring, graphs, networkx, python
- Language: Python
- Homepage: https://listcolouring.readthedocs.io/en/latest/
- Size: 112 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 3
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# listcolouring
List colouring in Python with NetworkX.```python
import networkx as nx
import matplotlib.pyplot as pltimport listcolouring
from listcolouring import list_init, greedy_list_edge_colouring, print_list_edge_colouringG = nx.petersen_graph()
G = list_init(G, range(0, 10), 3, 0)
G = greedy_list_edge_colouring(G)
options = {'with_labels': True, 'node_color': "white"}
colors = nx.get_edge_attributes(G,'colour').values()
nx.draw_shell(G, nlist = [range(5, 10), range(5)], edge_color = colors, **options)plt.savefig("img/petersen-shell.png", format = "PNG"
```