CSP-Rules, SudoRules, KakuRules...

Programs which generate, solve, and analyze Sudoku puzzles

Re: CSP-Rules, SudoRules, KakuRules...

Postby denis_berthier » Sat Nov 02, 2024 9:50 am

.
Until now, there were functions to permute the rows, columns, bands (floors) and stacks (towers).
I've added functions to permute the digits (relabelling). Their output is a puzzle (in standard string format).

(relabel-9x9-puzzle-with-permutation(?puzzle-string ?perm)
;;; number ?i in the given puzzle becomes perm(?i) in the new puzzle

(random-relabel-9x9-puzzle ?puzzle-string)
;;; same, but with a random permutation

(random-isomorphic-9x9-puzzle ?puzzle-string)
;;; rows, columns, bands, stacks and digits randomly permuted (according to allowed isomorphisms).

.
denis_berthier
2010 Supporter
 
Posts: 4238
Joined: 19 June 2007
Location: Paris

Re: CSP-Rules, SudoRules, KakuRules...

Postby denis_berthier » Sat Nov 09, 2024 12:14 pm

.
In SudoRules, I've added the possibility to arbitrarily select any set of impossible patterns in eleven's list of 630 ones.

This is controlled by two new global variables in new sub-section 2.3.2c of the config file:
;;; First declare you want to make your own selection (compulsory)
;;; this will cancel all previous selections of Imp630 (but not the tridagons):
; (bind ?*Select-Imp630-list* TRUE)
;;; Then select impossbile patterns by their names, e.g.:
; (bind ?*Selected-Imp630-list* (create$ EL14c30 EL13c259))


You don't have to know in advance the names I've given to these patterns:
usually, you'll want to do this after running a larger selection and checking the patterns effectively used in the solution.
This will clean the resolution path of all the useless patterns.
.
denis_berthier
2010 Supporter
 
Posts: 4238
Joined: 19 June 2007
Location: Paris

Re: CSP-Rules, SudoRules, KakuRules...

Postby denis_berthier » Mon Dec 09, 2024 9:22 am

.
Today's small update eon GitHub generalises the automatic application of eleven's replacement technique.
Until now, it was based on a block having a tridagon-like pattern of cells and candidates (i.e. 3 and only 3 candidates in the 3 cells).
Now, there may be a cyclic pattern of candidates in the 3 cells (as in the degenerate-cyclic-tridagon pattern).

Note that a replacement candidate may be chosen in one of the 3 cells even if it is no longer a candidate in it. This is irrelevant, because anyway, a relabelling (restricted to the 3 digits) must be made in the end in order to recover the original puzzle.
.
denis_berthier
2010 Supporter
 
Posts: 4238
Joined: 19 June 2007
Location: Paris

Re: CSP-Rules, SudoRules, KakuRules...

Postby denis_berthier » Thu Dec 19, 2024 5:05 am

.
Following my publication of a new GitHub repositoriy for the data supporting my results in [HCCS2] (see http://forum.enjoysudoku.com/hierarchical-classifications-in-constraint-satisfaction-t42076-7.html), I've added to SudoRules global variables that give direct access to the collections described there and that allow you to re-run the calculations just by copying into SudoRules all the commands that appear in the RESULTS.clp files of each folder. They are defined as:

Code: Select all
?*CSP-EX* = (str-cat ?*CSP-Rules* "CSP-Rules-Examples/”)
?*CBGC* = (str-cat ?*CSP-Rules* "CBGC/”)
?*SUDCL* = (str-cat ?*CSP-Rules* "SUDCL")

?*TE3-Mi* = (str-cat ?*SUDCL* "mith-158276-TE3/")
?*TE2-EL* = (str-cat ?*SUDCL* "eleven-26370-TE2/”)
?*TE2-PH* = (str-cat ?*SUDCL* "ph2010-3103972-TE2/”)
?*TE2-Paq* = (str-cat ?*SUDCL* "Paquita-2023-sept-dec-TE2/")
?*TE23-Mon* = (str-cat ?*SUDCL* "Monhard-until-2023-08-15-TE23/")
?*TE2-Col* = (str-cat ?*SUDCL* "Coloin-2024-09-03-B7B+/")
?*17c* = (str-cat ?*SUDCL* "Royle-49158-17c/")
?*18c* = (str-cat ?*SUDCL* "JPF-2000000-18c/")
?*38c* = (str-cat ?*SUDCL* "dob-2014078-38c/")
?*39c* = (str-cat ?*SUDCL* "dob-2650-39c/")

Using them as such supposes you have installed all the repositories in the CSP-Rules directory, that should look like:
Code: Select all
CSP-Rules    | CSP-Rules-V2.1
             | SHC (the Sudoku Hierarchical Classifier)
             | CSP-Rules-Examples
             | CBGC (the Controlled-Bias Generator and Collection)
             | SUDCL (the classification results of various Sudoku collections)
             | TE3-classif (deprecated, now included in SUDCL )
             | TE2-classif (deprecated, now included in SUDCL )

However, you can decide to install them at any other place. You'll only have to redefine the 3 top level directories, e.g.:
Code: Select all
(bind ?*CSP-EX* “/usr/me/CSP-Rules-Examples/”)
(bind ?*CBGC* “/usr/me/CBGC/”)
(bind ?*SUDCL* “/usr/me/SUDCL/")

and then type:
Code: Select all
(relocate-companion-folders)

in order to redefine the other variables.
.
denis_berthier
2010 Supporter
 
Posts: 4238
Joined: 19 June 2007
Location: Paris

Previous

Return to Software