Skip to main content

List colouring in Python with NetworkX.

Project description

listcolouring

List colouring in Python with NetworkX.

import networkx as nx
import matplotlib.pyplot as plt

import listcolouring
from listcolouring import list_init, greedy_list_edge_colouring, print_list_edge_colouring

G = 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"

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

listcolouring-0.1.2.tar.gz (2.4 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

listcolouring-0.1.2-py3-none-any.whl (3.0 kB view details)

Uploaded Python 3

File details

Details for the file listcolouring-0.1.2.tar.gz.

File metadata

  • Download URL: listcolouring-0.1.2.tar.gz
  • Upload date:
  • Size: 2.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.5.1 CPython/3.11.1 Linux/6.1.27-060127-generic

File hashes

Hashes for listcolouring-0.1.2.tar.gz
Algorithm Hash digest
SHA256 de33e0854c4ec5fdd8813669a511363986eb79bcb8fed79316eaa64a8f7e8304
MD5 22addf0bda6c42dbdcdb9194bf5c3aaa
BLAKE2b-256 5aa45b75e8d2fc6e2324b97d81e827a6789e6b07f4ae6fafc34ee46739f760bb

See more details on using hashes here.

File details

Details for the file listcolouring-0.1.2-py3-none-any.whl.

File metadata

  • Download URL: listcolouring-0.1.2-py3-none-any.whl
  • Upload date:
  • Size: 3.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.5.1 CPython/3.11.1 Linux/6.1.27-060127-generic

File hashes

Hashes for listcolouring-0.1.2-py3-none-any.whl
Algorithm Hash digest
SHA256 4165c09640dc604da2abe78113c9cb84591e8ef0cc8689b74d17a68806eaac91
MD5 1691e0f5dbfb564565f02c140535cd2e
BLAKE2b-256 aa71e9ded69c205d260fc06a95f70f7a6354d62389ee39d8a4b08a44a9b1173d

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page