Category Archives: SudoCue

solver – helper – generator

Sue de Coq

I had a lot of fun implementing this ancient solving technique in SudoCue. Most players have already forgotten about it. However, it is a technique that provides a pattern-based alternative for otherwise difficult to spot ALS moves. Having studied the technical ins and outs, it proves to be a solving technique that could easily be expanded in several directions. Unfortunately, many players do not think in terms of constraint sets, and they have difficulty understanding the concepts or recognize its beauty. I wrote a good article about Sue De Coq in Sudopedia and on the Eureka forum. Maybe it needs time to sink in.

Other techniques I’ve implemented are Skyscraper and 2-String Kite. These are pattern-based alternatives for certain Turbot Fish moves, originally introduced by Havard. It took me less than a day to implement both these techniques, which tells enough about their simplicity.

In SumoCue, I implemented Law of Leftovers a while ago, but this technique is now finally out in an official release. I also added a Jigsaw pattern selector, so the players using SumoCue for the daily jigsaw competition at www.sudoku.org.uk can simply pick a pattern, rather than drawing it manually.

Wasted a day on Almost Locked Digits

A weblog can be used to celebrate achievements or the write away frustrations. This post belongs to the latter category.

When I completed the ALS technique in SudoCue, I figured that there must be a counterpart, like hidden subsets are the counterpart for naked subsets. An ALS is defined as N cells having N+1 digits as candidates in a single house. Any digit that you can take away from the set will lock the remaining digits in these cells. It can act as a strong link in any chain, but the more basic application is a pairs of ALS’ with a shared digit, which is connected in such a way that it cannot appear in both sets at the same time. From here, we can eliminate any candidate that can see all instances of another digit in both sets. This sounds like a rate occasion, but ALS’ are abundant in any Sudoku.

So what about the counterpart?

Almost Locked Digits is the “hidden” counterpart. It has N digits confined to N+1 cells within a single house. The trigger mechanism is actually more flexible. Any move that would force one of the surplus candidates into any of the N+1 cells will lock the set. Now the easiest application would be a similar XZ rule. Find a conjugate pair with each end in an ALD. Either one of the ALD’s must be locked. Any shared peer for one of the digits can be eliminated. Simple, elegant, easy to implement.

Only, they do not exist. I tested this on numerous puzzles, even with ALS disabled, and although an average sudoku contains hundreds of ALD’s, they just won’t connect with an XZ rule. Pretty frustrating. I’m not even sure whether the code or the ALD logic has failed. The logic looks pretty solid and the code does find the ALD’s with the conjugate pairs that trigger them.

I’m going to run a couple of severe debug runs to check out the code, and if that doesn’t work, I’ll drop it in the trashcan.

The Incredible power of ALS

I cannot resist posting a few words about ALS (Almost Locked Sets), a very advanced solving technique with a lot of solving power. As I stated earlier, I just missed the deadline for 1.5.1 with these new solving techniques. They are now released in 1.5.1.1

One of them, long overdue, is Empty Rectanges. It does not solve anything new, but it is an easy to use alternative for multi-coloring and sometimes even for Nishio. Many other sudoku programs already supported ER, but having the most powerful techniques already implemented makes you lazy, I guess. The templates catch any single digit elimination, so I was not encouraged to implement lower-level single digit techniques. However, after the overwhelming success of my finned-fish implementation, it seemed the right time to do Empty Rectangles as well. Having restructured the solver in such a way that it is now very easy to add new techniques does also help.

The real thing I wanted to talk about is ALS. It is a bad acronym, but commonly known in the sudoku community. An Almost Locked Set is a situation where N cells have N+1 digits as their candidates. The simplest ALS is a single cell with only 2 candidates. Consider the following grid:

ALS-infested grid

How many Almost Locked Set does this grid contain? 10? 20?

No, there are almost 200 ALS’s in this grid, with only 96 candidates left. Most of them are harmless, but when you can pick the right combinations, they can become incredible solving tools. My list of 50,000 sudokus that require tabling steps is reduced to half its size, now ALS can be used. There is no single technique that had such a tremendous impact.

I will expand my solving guide to tell more about the power of ALS.

Size Matters

It has cost me a night sleep, but I have rewritten parts of SudokuGo, my batch generator. It now can generate any Sudoku with boxes of size 2×2, 2×3, 3×3 (duuh), 3×4 and 4×4, including the main variants, Jigsaw, X and DG.

If have also generalized the Windoku concept. A 4×4 sudoku can contain 1 extra 2×2 box in the center, with 3 implied extra groups. No Windows for the irregular formats, but 16×16 can have 9 extra 4×4 boxes, with 7 implied groups. I’m not sure this format will ever work, because the program chokes on generating a valid grid. Too bad if it turns out to be an impossible format, because it looks great. I’ve tested generation of the Windoku groups without box constraints, and that works. The combination may prove to be too much. Just to many conflicting constraints.

Also released SudoCue version 1.5.1. Redid the optimizer as many requested it should work, and also added a menu option to fetch the daily competition puzzle from www.sudoku.org.uk. Undo and redo work on candidates too.

I am now trying to implement Almost Locked Sets. Considering every possibility, the program now found 228 sets in a single grid. Needs some work to filter out the sets that are actually useful. I think I start sorting out the sets that do not overlap, but have a restricted common digit x. It must be possible to find ALS-xz patterns amongst these pairs of sets. I’ll write some more if I made some progress. Would be nice to be the first program that supports ALS, after being the first (and still the only) that supports finned fish.

First daily Sudoku-X on the WWW

Since I implemented Sudoku-X in SudoCue, I was wondering where people would be able to find these puzzles on a regular basis. To my surprise: nowhere! Only websudoku.com has a weekly feature of variants, and Inertia only pretends to have them, leading you to their desktop program.

So I decided to run my batch generator for a while, and it came up with a wonderful series of puzzles, with various symmetries and a wide range in difficulty levels. I decided to focus on 2 difficulty levels, one for the beginners and one for the advanced players, keeping them both happy on my site.

Since all my puzzles are themed, I needed one for this new feature. X-Rays, X-Wings, X-Men and X-Files were amongst the candidates. Combining the puzzles with an archive made me choose X-Files, which happened to be problems that needed to be solved. I’m still probing the theme, but there will be more wordplay in this arena. I’m full of ideas.

On a side note: The addition of regular puzzles and the rewriting of all the on-site documentation has resulted in a steady growth in visitors. This seems to have a snowball effect, because more and more people discover my site. It must have good pageranks in Google. Quality does pay off in the end.

The road to Perfection

I have brought 2 releases of SudoCue to the site in a very short period of time. The visible improvements can be seen on the release notes page of the www.sudocue.net website, but the internal restructuring is not seen by the outside world. Here are a few notes on how the architecture has changed.

First, a virtual class named Trick has been added. This class can save itself to the configuration file, has a name, a base score, a sequence number, an optional administration score, several classification flags, tries and usage counters, and a Performed method which reports a successful application of the trick.

A Tricks class contains a collection of Trick instances which can be enumerated.

The user can enable or disable any of these tricks through the options panel, and also change the order in which they are tried.

Several tricks that are basically different sizes of a single technique have a base class that performs the technique, with the size property of the derived class as a parameter. There are 2 tricks which are kept at the end of the collection, the DLX brute force solver and a Surrender class the does nothing, but declares the puzzle unsolvable. This trick cannot be disabled by the user for obvious reasons.

The only thing that I need to add a new technique is define a new class derived from the Trick class and add it initially to the Tricks collection. In earlier versions, I had to change the Log, the Options class, the Options dialog, the main solving method in the Grid class and the Analyzer dialog, even before I could start coding the nitty gritty stuff. This hassle disencouraged me from quickly adding new tricks.

There is also a strict separation between setup and play mode. The solver does nothing in setup mode, but validates and rates the puzzle when you switch to play mode. Earlier, the program had the habit of kicking in too soon, filling the log with complicated tabling chains when all it had to do it wait for all the clues to arrive. With uniqueness, this could even lead to a solving path going the wrong way.

With these changes, the program is ready to be expanded with all the lovely tricks that have been developed in the last months. Some have already been added to the program. More will follow.

Killing Time

My focus has been shifting back and forth, lately. My log shows that SudoCue has been downloaded more than 9000 times, but still there are not many responses. This made me put SudoCue on hold for a while.

I turned my attention to Killer Sudokus. Amazing how little software is available for Killers, while the Net is swarming with Sudoku programs. This time I decided to do it the right way. Be the first, be the best, be the benchmark.

The new program is SumoCue. It specializes in sudoku variants with irregular shapes, such as Killers and Jigsaws. It has a DLX solver that can solve any variant. It has a designer mode with the right tools to help you create jigsaws and killers. When puzzle makers use the program, they will attract players. The program has a custom file format, but also handles PS format for Killers.

The tools are limited, but very useful for both killer and jigsaw puzzles. After a few quick releases, the program has stabilized. It is well received, better than SudoCue. Maybe it was a good idea to use the same colors as Simple Sudoku to give the users a comfortable feeling. It worked for me. The light 3D effects create a smooth User Interface.

Support as usual through the forum. I use the program to create (Jigsaw) Killers. I post a few on my website, but I also have managed to sell a few to a publisher, along with a couple of Clueless Specials.

There is also a new release of SudoCue. I wrote a trimmed DLX solver to be used for random puzzle generation and optimization. My experience in DLX is now paying off. This new code is flamingly fast. I could even include multiple symmetry types for the generator.

Â

SudoCue 1.2.0 testing

Tests are going remarkably well. Despite the large number of changes, no errors have been reported. The only problem may be the bandwidth required for the release. With more and more users, the maximum bandwidth could be exceeded with the release of a new version. This version may be OK, but the next…


SudoCue release 1.2.0 status

The following solver techniques have been added and tested:

  • XYZ-Wing
  • Finned X-Wing
  • BUG+1

The ‘Peers’ tool has been added. This tool could be placed between Focus and Markup. It focuses the view to the selected cell and it’s peers. The candidates for the selected cell only are visible and can be maintained. The tool is aimed at people who want to maintain candidates, but do not like the spoiling effect of seeing all the candidates in the entire grid.

Rating system implemented. This rating system must be tested and calibrated. We probably need to add something like mode-change scores, e.g. when pencilmarks are required, or when value patterns need to be examined.

As an option, markup can be combined with the watch and color tools. This combination can be useful for those accustomed to the Simple Sudoku interface. Markup can be toggled on and off independently when watch or color tools are selected.

Fixed a bug that left the previous menu item available when opening single puzzle after a collection. The statusbar panel no longer shows 1/0 or 1/1 when no collection is loaded.

The analyzer has been split into a separate status dialog, with the current situation (filled cells, remaining candidates, etc) and the Analyzer with required solving techniques and ratings.

To avoid confusion with true pencilmarks, pen and pencil have been remaned to Pen 1 and Pen 2. The latter has a dark green color. The erase and confirm functions are still available for pen 2.

New scramble function. Permutate the current puzzle without changing the difficulty. Nice tool to play a variation of an interesting puzzle (which is a whole new puzzle) or avoid copyright claims. Not that the sudoku vault masters would like it (or Wayne G) but this feature will not operate on batches, just single puzzles.

I have decided to introduce a beta testing period, due to the many changes. I want to make sure this all works, before I throw it at the large audience.

XYZ-Wing

So proud this is working!!!

XYZ-Wings are now supported in SudoCue. With the complexity of the program, adding new solving techniques has become more of an administrative task tham simply writing the code to perform the technique. Anyway, this technique is now part of the standard solving techniques suite of SudoCue.

More to come.

I set up a forum for sudoku beginners on a free forum hosting provider. I’m not sure whether or not I’m gonna use it, but there is a gap in the market to embrace and cuddle new sudoku players. With SudoCue I’m at the high-end of the market, but there is a requirement at the lower end.