solver-ginsberg: Solver marks the grid as unresolvable without providing reason
Environment
- Operating system: openSUSE Tumbleweed (20230201)
- croiseur version: master (da83ce6c)
- Java version: OpenJDK Runtime Environment (build 17.0.5+0-suse-3.1-x8664)
Issue
It has been seen that solver marks the grid as impossible but doesn't precise which slot has no candidate left.
Note that passing the grid completely filled works (solver validates all the assignments and returns a success result).
Steps to reproduce
(Probably not the most straightforward way to reproduce, but the best I have for now.)
- Using the Text dictionary provider, add a custom dictionary
issue21.txt
containing the following words:
ILLE
TILL
IT
ORE
AUX
Description file (issue21.txt.properties
):
locale=fr-FR
name=issue21
description=Addition to general french dictionary to be sure that issue 21 is not due to a missing word
- Run the following command
./croiseur-cli solver run Ginsberg --size 12x10 --dictionaries "Local XML Provider:General French dictionary" "Local Text Provider:issue21" --shaded-boxes "(2,7)" "(3,8)" "(4,1)" "(4,3)" "(4,4)" "(5,7)" "(6,6)" "(7,5)" "(8,3)" "(8,8)" "(9,7)" "(10,2)" "(10,6)" --progress
Expected result
The solver succeeds with e.g.:
|E|M|M|E|N|A|G|E|M|E|N|T|
|X|I|A|N|#|D|O|M|I|N|E|E|
|C|L|I|G|N|E|M|E|N|T|#|N|
|I|L|L|E|#|P|M|U|#|R|A|D|
|T|I|L|L|#|T|E|S|T|E|U|R|
|A|M|E|U|T|E|S|#|S|E|X|E|
|T|E|T|R|A|S|#|L|A|S|#|M|
|I|T|#|E|X|#|D|E|R|#|N|E|
|O|R|E|#|A|M|A|S|#|D|A|N|
|N|E|U|V|I|E|M|E|M|E|N|T|
Actual result
The solver fails with with an empty list of problematic slots:
> ./croiseur-cli solver run Ginsberg --size 12x10 --dictionaries "Local XML Provider:General French dictionary" "Local Text Provider:issue21 --shaded-boxes "(2,7)" "(3,8)" "(4,1)" "(4,3)" "(4,4)" "(5,7)" "(6,6)" "(7,5)" "(8,3)" "(8,8)" "(9,7)" "(10,2)" "(10,6)" --progress
Initializing solver
Solver initialized
Result: IMPOSSIBLE[best: 68 %]
| | | | | | |R| | | | | |
| | | | | | |A| | | | | |
| | | | | | |D| | | | | |
| | | | | |A|I|E| |E|A|U|
| | | | | | |O| | | |I| |
| | | | | | |S| | | |E| |
| | | | | | | | | | | | |
| | | |E|D| | | | | | | |
|A|N|A| | |A| | | | | | |
| | |C| | |I| | | | | | |
>
Edited by Antoine Belvire