Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

A fresh start. #14

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
**__pycache__
3 changes: 3 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,2 +1,5 @@
install:
poetry install

test:
poetry run pytest
559 changes: 558 additions & 1 deletion poetry.lock

Large diffs are not rendered by default.

9 changes: 3 additions & 6 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,14 +1,15 @@
[tool.poetry]
name = "vizing"
version = "0.1.0"
description = "List-colouring in Python."
version = "0.1.0.9000"
description = "Constraint-based list-colouring in Python."
authors = ["Matthew Henderson <[email protected]>"]
readme = "README.md"

[tool.poetry.dependencies]
python = "^3.10"
python-constraint = "^1.4.0"
networkx = "^3.2.1"
listcolouring = "^0.2.0"


[tool.poetry.group.test.dependencies]
Expand All @@ -19,7 +20,3 @@ networkx = "^3.2.1"
requires = ["poetry-core"]
build-backend = "poetry.core.masonry.api"

[tool.pytest.ini_options]
pythonpath = [
"."
]
17 changes: 17 additions & 0 deletions src/vizing/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
import constraint

def list_colouring_problem(G):
P = constraint.Problem()
for node in G.nodes():
P.addVariable(node, G.nodes[node]['permissible'])
for edge in G.edges():
P.addConstraint(constraint.AllDifferentConstraint(), edge)
return(P)

def list_colouring_solution(G):
P = list_colouring_problem(G)
S = P.getSolution()
for node in S:
G.nodes[node]['colour'] = S[node]
return(G)

137 changes: 0 additions & 137 deletions src/vizing/colouring.py

This file was deleted.

51 changes: 0 additions & 51 deletions src/vizing/hall.py

This file was deleted.

49 changes: 0 additions & 49 deletions src/vizing/ortools.py

This file was deleted.

36 changes: 0 additions & 36 deletions src/vizing/pythonconstraint.py

This file was deleted.

Loading
Loading