ryanjoneil / python-zibopt

Automatically exported from code.google.com/p/python-zibopt
2 stars 1 forks source link

example/sudoku.py gives wrong result #35

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
The command line: python3 examples/sudoku.py returns a wrong result.
E.g. the first column contains two times 1.
[8, 1, 5, 6, 9, 2, 3, 4, 7]
[7, 6, 2, 1, 3, 4, 8, 9, 5]
[3, 4, 9, 7, 8, 5, 1, 2, 6]
[2, 6, 9, 5, 1, 7, 8, 4, 3]
[1, 4, 7, 3, 8, 9, 5, 6, 2]
[8, 3, 5, 4, 6, 2, 1, 7, 9]
[5, 2, 7, 6, 1, 4, 9, 3, 8]
[4, 8, 6, 3, 9, 5, 2, 7, 1]
[1, 3, 9, 7, 2, 8, 6, 5, 4]

Original issue reported on code.google.com by daddario...@gmail.com on 24 Apr 2012 at 7:50

GoogleCodeExporter commented 9 years ago
What I forgot to mention I installed the latest Version of python-zibopt-0.7.2 
and ziboptsuite-2.1.1 .

Original comment by daddario...@gmail.com on 24 Apr 2012 at 8:45

GoogleCodeExporter commented 9 years ago
Okay, I found the error:
In the example is missing a for:D
In line 49 there should be a "for j, k in product(cols, vals):".

Original comment by daddario...@gmail.com on 24 Apr 2012 at 9:28

GoogleCodeExporter commented 9 years ago
Aha! Thank you so much, and great catch. I will commit this to trunk, though I 
will probably not re-release until there are new features.

Original comment by ryanjoneil on 26 Apr 2012 at 7:21

GoogleCodeExporter commented 9 years ago
OK, this is fixed in r234. Thanks again. I'm not sure how I ended up deleting 
that line.

Original comment by ryanjoneil on 26 Apr 2012 at 7:26

GoogleCodeExporter commented 9 years ago
And by that, I mean fixed in r235. D'oh.

Original comment by ryanjoneil on 26 Apr 2012 at 7:28