My Stupid Str8ts Solver...

Str8ts discussion with Jeff Widderich and Andrew Stuart.
Stellen Sie hier Fragen an Str8ts-Erfinder Jeff Widderich und Andrew Stuart.

Moderators: Syndicate, Andrew

Post Reply
jamesaustin
Posts: 2
Joined: Friday 3. January 2014, 14:52

My Stupid Str8ts Solver...

Post by jamesaustin » Friday 24. January 2014, 14:01

I've put the code to my (stupid) Str8ts solver online if anyone is interested in playing with it. Any tweaks / improvements / feedback are extremely welcome.

The code is available on Github at: https://github.com/jamesaustin/str8ts

The solver is able to solve all the Weekly Extreme puzzles (and the user generated puzzles from the feeds) in around 3m on my machine.

The solver runs through a list of rules searching for a hit that allows it to make progress. Changing the order of the rules would change the distribution of rules used whilst solving. The default rules order solves all the puzzles with the following results, where:

Ord - is the order the rule is run in.
Hit % and # - is a count of times the rule was successful.
Digits % and # - is a count of the digits the rule was able to eliminate.

Code: Select all

#    Technique                      [Ord] [Hit %  Hit #] [Digit %  Digit #]                  
HIT  remove_used_digits             [# 0] [40.4%   8542] [56.7%      94064]
HIT  compartment_range_check_by_row [# 1] [12.7%   2690] [ 9.8%      16323]
HIT  compartment_range_check_by_col [# 2] [12.0%   2531] [10.2%      16848]
HIT  singles_by_row                 [# 3] [ 6.5%   1375] [ 3.0%       5001]
HIT  sure_candidates_by_row         [# 5] [ 5.7%   1200] [ 7.1%      11775]
HIT  singles_by_col                 [# 4] [ 4.6%    980] [ 2.2%       3649]
HIT  sure_candidates_by_col         [# 6] [ 4.2%    886] [ 5.8%       9691]
HIT  sea_creatures_by_row           [#23] [ 2.0%    415] [ 0.8%       1304]
HIT  chain_contradiction            [#34] [ 1.6%    348] [ 0.4%        655]
HIT  bridging_digits_by_row         [# 9] [ 1.5%    314] [ 0.3%        570]
HIT  bridging_digits_by_col         [#10] [ 1.4%    298] [ 0.4%        590]
HIT  sea_creatures_by_col           [#24] [ 1.1%    237] [ 0.5%        809]
HIT  naked_groups_by_col            [#17] [ 1.0%    217] [ 0.7%       1091]
HIT  naked_groups_by_row            [#18] [ 0.9%    197] [ 0.6%        981]
HIT  hidden_group_by_cross_col      [#22] [ 0.5%    109] [ 0.2%        369]
HIT  mind_the_gap_by_col            [#14] [ 0.4%     94] [ 0.1%        208]
HIT  mind_the_gap_by_row            [#13] [ 0.4%     83] [ 0.1%        208]
HIT  hidden_group_by_cross_row      [#21] [ 0.3%     66] [ 0.1%        211]
HIT  hidden_group_by_col            [#20] [ 0.3%     61] [ 0.2%        251]
HIT  settis_rule                    [#27] [ 0.3%     60] [ 0.0%          0]
HIT  sure_candidate_range_check_row [#32] [ 0.2%     43] [ 0.1%        157]
HIT  sure_candidate_upgrade_row     [#30] [ 0.2%     42] [ 0.0%          0]
HIT  sea_creatures_by_cross_row     [#25] [ 0.2%     41] [ 0.1%        155]
HIT  sure_candidate_range_check_col [#33] [ 0.2%     40] [ 0.1%        149]
HIT  sure_candidate_upgrade_col     [#31] [ 0.2%     39] [ 0.0%          0]
HIT  hidden_group_by_row            [#19] [ 0.2%     38] [ 0.1%        165]
HIT  sea_creatures_by_cross_col     [#26] [ 0.1%     31] [ 0.1%        116]
HIT  unique_rectangle_rule          [#28] [ 0.1%     31] [ 0.0%         79]
HIT  split_compartments_by_row      [#11] [ 0.1%     28] [ 0.0%         58]
HIT  split_compartments_by_col      [#12] [ 0.1%     26] [ 0.0%         41]
HIT  stranded_digits_by_row         [# 7] [ 0.1%     26] [ 0.1%        125]
HIT  stranded_digits_by_col         [# 8] [ 0.1%     24] [ 0.1%         91]
HIT  mind_the_bridging_gap_by_row   [#15] [ 0.0%      6] [ 0.0%          8]
HIT  y_wing                         [#29] [ 0.0%      4] [ 0.0%          4]
HIT  mind_the_bridging_gap_by_col   [#16] [ 0.0%      4] [ 0.0%          7]
The solver probably relies on searching for chain contradictions more than a skilled solver.

To solve all the puzzles use:
python str8ts.py -i str8ts.txt

To solve a single puzzle and see the steps as they happen (debug it) use:
python str8ts.py -i str8ts.txt weekly187 -d

Happy hacking...

Post Reply