add medium and big data set to python slitherlink example

This commit is contained in:
Laurent Perron
2016-01-06 11:10:05 +01:00
parent 0cbaa9ca67
commit 9dd8480957

View File

@@ -2,7 +2,31 @@ from ortools.constraint_solver import pywrapcp
from collections import deque
small = [[3, 2, -1, 3], [-1, -1, -1, 2], [3, -1, -1, -1], [3, -1, 3, 1]]
small = [[3, 2, -1, 3],
[-1, -1, -1, 2],
[3, -1, -1, -1],
[3, -1, 3, 1]]
medium = [[ -1, 0, -1, 1, -1, -1, 1, -1 ],
[ -1, 3, -1, -1, 2, 3, -1, 2 ],
[ -1, -1, 0, -1, -1, -1, -1, 0 ],
[ -1, 3, -1, -1, 0, -1, -1, -1 ],
[ -1, -1, -1, 3, -1, -1, 0, -1 ],
[ 1, -1, -1, -1, -1, 3, -1, -1 ],
[ 3, -1, 1, 3, -1, -1, 3, -1 ],
[ -1, 0, -1, -1, 3, -1, 3, -1 ]]
big = [[ 3, -1, -1, -1, 2, -1, 1, -1, 1, 2 ],
[ 1, -1, 0, -1, 3, -1, 2, 0, -1, -1 ],
[ -1, 3, -1, -1, -1, -1, -1, -1, 3, -1 ],
[ 2, 0, -1, 3, -1, 2, 3, -1, -1, -1 ],
[ -1, -1, -1, 1, 1, 1, -1, -1, 3, 3 ],
[ 2, 3, -1, -1, 2, 2, 3, -1, -1, -1 ],
[ -1, -1, -1, 1, 2, -1, 2, -1, 3, 3 ],
[ -1, 2, -1, -1, -1, -1, -1, -1, 2, -1 ],
[ -1, -1, 1, 1, -1, 2, -1, 1, -1, 3 ],
[ 3, 3, -1, 1, -1, 2, -1, -1, -1, 2 ]]
def NeighboringArcs(i, j, h_arcs, v_arcs):
@@ -275,3 +299,5 @@ def SlitherLink(data):
if __name__ == '__main__':
SlitherLink(small)
SlitherLink(medium)
SlitherLink(big)