simon-git: puzzles (master): Simon Tatham

Commits to Tartarus hosted VCS tartarus-commits at lists.tartarus.org
Sat Apr 13 18:46:38 BST 2019


TL;DR:
  d96298e Dominosa: another local deduction in Basic level.
  1114a2a Dominosa: another forcing-chain based deduction.
  bb926f4 findloop: alternative query function.
  9f0dfba Dominosa: add area-parity deductions, at Basic level.
  1ffc737 Dominosa: move set analysis with doubles into Extreme.

Repository:     https://git.tartarus.org/simon/puzzles.git
On the web:     https://git.tartarus.org/?p=simon/puzzles.git
Branch updated: master
Committer:      Simon Tatham <anakin at pobox.com>
Date:           2019-04-13 18:46:38

commit d96298ed0100873c59b3be698b01c369f888499b
web diff https://git.tartarus.org/?p=simon/puzzles.git;a=commitdiff;h=d96298ed0100873c59b3be698b01c369f888499b;hp=866354ef6207fbe21054b1950e8158160f85420a
Author: Simon Tatham <anakin at pobox.com>
Date:   Sat Apr 13 11:03:36 2019 +0100

    Dominosa: another local deduction in Basic level.
    
    This is necessary to solve the following test puzzle that someone sent
    me in 2006 and I just recovered from my email archive:
    
    6:65111036543150325534405211110064266620632365204324442053
    
    Without this new deduction, the previous solver can't solve that
    puzzle even at full power, but the half-solved state it leaves the
    grid in has an obvious move in the top right corner (placing the 6-2
    domino vertically in that corner forces two 3-0s to its left). Now
    that kind of move can be made too, and the solver can handle this
    puzzle (grading it as Hard).

 dominosa.c | 109 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
 1 file changed, 109 insertions(+)

commit 1114a2af332ecfa61a3ae0df478d26b9a3b863a4
web diff https://git.tartarus.org/?p=simon/puzzles.git;a=commitdiff;h=1114a2af332ecfa61a3ae0df478d26b9a3b863a4;hp=d96298ed0100873c59b3be698b01c369f888499b
Author: Simon Tatham <anakin at pobox.com>
Date:   Sat Apr 13 11:26:54 2019 +0100

    Dominosa: another forcing-chain based deduction.
    
    We've already spotted when a domino occurs twice in the _same_ forcing
    chain. But now we also spot when it occurs twice in the same _pair_ of
    complementary forcing chains, one in each of the two options. Then it
    must appear in one of those two places, and hence, can't appear
    anywhere else.

 dominosa.c | 62 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
 1 file changed, 62 insertions(+)

commit bb926f4ee4c16f67d37398c1b79b54a3fdf1dedd
web diff https://git.tartarus.org/?p=simon/puzzles.git;a=commitdiff;h=bb926f4ee4c16f67d37398c1b79b54a3fdf1dedd;hp=1114a2af332ecfa61a3ae0df478d26b9a3b863a4
Author: Simon Tatham <anakin at pobox.com>
Date:   Sat Apr 13 13:12:44 2019 +0100

    findloop: alternative query function.
    
    This one tells you if a graph edge _is_ a bridge (i.e. it has inverted
    sense to the existing is_loop_edge query). But it also returns
    auxiliary data, telling you: _if_ this edge were removed, and thereby
    disconnected some connected component of the graph, what would be the
    sizes of the two new components?
    
    The data structure built up by the algorithm very nearly contained
    enough information to answer that already: because we assign
    sequential indices to all the vertices in a traversal of our spanning
    forest, and any bridge must be an edge of that forest, it follows that
    we already know the size of _one_ of the two new components, just by
    looking up the (minindex,maxindex) values for the vertex at the child
    end of the edge.
    
    To determine the other subcomponent's size, we subtract that from the
    size of the full component. That's not quite so easy because we don't
    already store that - but it's trivial to annotate every vertex's data
    with a pointer back to the topmost node of the spanning forest in its
    component, and then we can look at the (minindex,maxindex) pair of
    that. So now we know the size of the original component and the size
    of one of the pieces it would be split into, so we can just subtract.

 findloop.c | 31 ++++++++++++++++++++++++++++++-
 puzzles.h  | 12 ++++++++++++
 2 files changed, 42 insertions(+), 1 deletion(-)

commit 9f0dfba5fa9431469060ae89bef486267dbb23d4
web diff https://git.tartarus.org/?p=simon/puzzles.git;a=commitdiff;h=9f0dfba5fa9431469060ae89bef486267dbb23d4;hp=bb926f4ee4c16f67d37398c1b79b54a3fdf1dedd
Author: Simon Tatham <anakin at pobox.com>
Date:   Sat Apr 13 13:46:31 2019 +0100

    Dominosa: add area-parity deductions, at Basic level.
    
    This is a technique I've had on the todo list (and been using by hand)
    for years: a domino can't be placed if it would divide the remaining
    area of the grid into pieces containing an odd number of squares.
    
    The findloop subsystem is already well set up for finding domino
    placements that would divide the grid, and the new is_bridge query
    function can now tell me the sizes of the area on each side of the
    bridge, which makes it trivial to implement this deduction by simply
    running findloop and iterating over the output array.

 dominosa.R |   2 +-
 dominosa.c | 141 ++++++++++++++++++++++++++++++++++++++++++++++++++-----------
 2 files changed, 118 insertions(+), 25 deletions(-)

commit 1ffc73713062736a1a5f255f5f8dec3de027269c
web diff https://git.tartarus.org/?p=simon/puzzles.git;a=commitdiff;h=1ffc73713062736a1a5f255f5f8dec3de027269c;hp=9f0dfba5fa9431469060ae89bef486267dbb23d4
Author: Simon Tatham <anakin at pobox.com>
Date:   Sat Apr 13 15:57:28 2019 +0100

    Dominosa: move set analysis with doubles into Extreme.
    
    This change doesn't alter the overall power of the Dominosa solver; it
    just moves the boundary between Hard and Extreme so that fewer puzzles
    count as Hard, and more as Extreme. Specifically, either of the two
    cases of set analysis potentially involving a double domino with both
    squares in the set is now classed as Extreme.
    
    The effects on difficulty are that Hard is now easier, and Extreme is
    at least easier _on average_. But the main purpose is the effect on
    generation time: before this change, Dominosa Extreme was the slowest
    puzzle present to generate in the whole collection, by a factor of
    more than three. I think the forcing-chain deductions just didn't make
    very many additional grids soluble, so that the generator had to try a
    lot of candidates before finding one that could be solved using
    forcing chains but not with all the other techniques put together.

 dominosa.c | 14 ++++++++++++--
 1 file changed, 12 insertions(+), 2 deletions(-)



More information about the tartarus-commits mailing list