From 9dd8480957c284a9aa8b7c21406eb2840df64cfc Mon Sep 17 00:00:00 2001 From: Laurent Perron Date: Wed, 6 Jan 2016 11:10:05 +0100 Subject: [PATCH] add medium and big data set to python slitherlink example --- examples/python/slitherlink.py | 28 +++++++++++++++++++++++++++- 1 file changed, 27 insertions(+), 1 deletion(-) diff --git a/examples/python/slitherlink.py b/examples/python/slitherlink.py index 045c6247be..e4614e0387 100644 --- a/examples/python/slitherlink.py +++ b/examples/python/slitherlink.py @@ -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)