Hidden Skyscraper Sudoku

For fans of Killer Sudoku, Samurai Sudoku and other variants

Hidden Skyscraper Sudoku

Postby stigant » Mon Apr 13, 2009 1:49 am

I got this idea from problem 7 on http://www.logicmastersindia.com/mock10R1/SudokuMockTest10PBR2.pdf (password: DruhaCastMock10). My puzzle uses a slight modification to those rules (detailed below). I'd appreciate feedback on this puzzle:

Image

Rules:
Standard Sudoku Constraint - Fill the squares with the digits 1-9 so that each digit appears once in each row, column, and 3x3 region.
Hidden Skyscraper Constraint - A grid square contains an arrow(s) if and only if the number in that square correctly indicates the number of skyscrapers visible in that direction. (This is the modification from the mock test: if there is no arrow in a particular direction in a particular square, then the number of skyscrapers visible in that direction from that square is NOT the number on the square.)
Last edited by stigant on Tue Apr 14, 2009 3:40 pm, edited 1 time in total.
stigant
 
Posts: 14
Joined: 10 January 2007

Re: Hidden Skyscraper Sudoku

Postby udosuk » Tue Apr 14, 2009 6:04 pm

Image

A very nice puzzle!:)

I was doing forward reasoning (using the existence of arrows for deductions) only until I reached the following state:

Code: Select all
+----------------------+----------------------+----------------------+
| 1      67     3      | 4      67     5      | 89     89     2      |
| 4      9      2      | 1      8      3      | 7      56     56     |
| 56     5678   78     | 9      67     2      | 3      4      1      |
+----------------------+----------------------+----------------------+
| 7      3      5      | 8      2      4      | 6      1      9      |
| 2      4      6      | 7      1      9      | 5      38     38     |
| 8      1      9      | 3      5      6      | 4      2      7      |
+----------------------+----------------------+----------------------+
| 9      2      478    | 6      3      78     | 1      578    45     |
| 35     56     1      | 2      4      78     | 89     36789  368    |
| 36     78     478    | 5      9      1      | 2      3678   3468   |
+----------------------+----------------------+----------------------+

Then I had to do some backward reasoning (using the non-existence of arrows for deductions):

r7c5=3: r7c1234 can't be [9276|9286] => r7c3=4
r6c8=2: r15c8 can't be [98] => r5c8=3
r6c8=2: r8c8 can't be 8 or 9

Highlight to view the solution I wrote:173465892
492183756
658972341
735824619
246719538
819356427
924637185
561248973
387591264

Thanks for the enjoyable puzzle again!:)
udosuk
 
Posts: 2698
Joined: 17 July 2005

Postby stigant » Wed Apr 15, 2009 4:44 am

Great! I'm glad you enjoyed it.

Then I had to do some backward reasoning (using the non-existence of arrows for deductions):

Well, I think, the use of non-arrow clues must, inherently, require some sort of backtracking-type reasoning. I don't think the backtracking was too bad here, though. It doesn't strike me as being more complicated than, say, the backtracking you would need to do to derive the ideas of naked-pairs for the first time (something that most people take for granted, and wouldn't consider to be a backtrack)
stigant
 
Posts: 14
Joined: 10 January 2007

Postby udosuk » Wed Apr 15, 2009 7:37 am

Please don't mistake me. When I said "backward reasoning" I didn't implied a negative meaning such as "backtracking/trial-and-error". I reckon both "forward" and "backward" reasoning as equally elegant in logical grounds. Just one using the existence of arrows, another using the non-existence.:idea:

In hindsight "backward reasoning" is not such a good term to use. I was thinking more in line with the "reverse/inverse" concept in terms of logic theory.

The rule specifies that:

There is an arrow iff the cell value denotes the number of skyscrapers visible in that direction.

... which implies the following 4 propositions:

1. If the cell value matches the number of skyscrapers visible in a direction, there must be an arrow pointing to that direction.

2. If the cell value does not match the number of skyscrapers visible in a direction, there must be no arrow pointing to that direction.

3. If there is an arrow pointing to a direction, then the cell value must match the number of skyscrapers visible in that direction.

4. If there is no arrow pointing to a direction, then the cell value must not match the number of skyscrapers visible in that direction.

IMHO, the usage of any of these 4 propositions to make deductions are equally elegant.:idea:
udosuk
 
Posts: 2698
Joined: 17 July 2005

Postby stigant » Wed Apr 15, 2009 6:13 pm

Please don't mistake me. When I said "backward reasoning" I didn't implied a negative meaning such as "backtracking/trial-and-error". I reckon both "forward" and "backward" reasoning as equally elegant in logical grounds. Just one using the existence of arrows, another using the non-existence.

No worries. I DO happen to see the steps you made (and your solution path was very similar to mine) as a type of backtracking, something to be avoided in excess when designing puzzles, but not entirely verboten as you seem to agree.[/quote]
stigant
 
Posts: 14
Joined: 10 January 2007

Postby udosuk » Thu Apr 16, 2009 6:01 pm

stigant wrote:I DO happen to see the steps you made (and your solution path was very similar to mine) as a type of backtracking, something to be avoided in excess when designing puzzles, but not entirely verboten as you seem to agree.

Obviously, every move (including the simplest one) can be presented as "backtracking", e.g. a hidden single (if that cell has any other value, then a row/column/box will be without value x - contradiction; therefore that cell must hold value x).

For me, the fine line of acceptable backtracking or not lies on the depth/level of the complexity. If only 1 level is involved then it is probably acceptable (e.g. after a placement/elimination, there is an immediate contradiction, therefore that placement/elimination must not be made). If 2 or more levels are involved then it is probably "frowned upon" as "trial-and-error" logic (e.g. a placement/elimination leads to other placements/eliminations, which in turn lead to contradiction).

:idea:
udosuk
 
Posts: 2698
Joined: 17 July 2005

Postby stigant » Thu Apr 23, 2009 5:51 am

Here's another one. This one involves some logical steps that the first one didn't, and I think it relies a bit more on the "no-arrow rule." Or at least, I used the no-arrow rule more often.
Image
stigant
 
Posts: 14
Joined: 10 January 2007

Postby udosuk » Thu Apr 23, 2009 7:16 pm

Thanks for another great puzzle!:D

Just for your information, this one can be solvable with just the "existence of arrows", i.e. you don't need the "no-arrow rule" at all to solve it logically.:!:

However, I agree there is a large assortment of new techniques in this one (based on the existence of arrows), which wasn't required in the 1st one. Generally this one is at least as enjoyable as the 1st.:)

Here is the last 2 steps I used:

Code: Select all
+-------------------+-------------------+-------------------+
| 567   8     567   | 2     3     9     | 1     4     56    |
| 45    456   9     | 8     1     7     | 56    2     3     |
| 3     2     1     | 4     5     6     | 8     7     9     |
+-------------------+-------------------+-------------------+
| 2     3     47    | 9     8     5     | 47    6     1     |
| 1     9     567   | 67    2     4     | 3     8     57    |
| 467   4567  8     | 1     67    3     | 457   9     2     |
+-------------------+-------------------+-------------------+
| 567   4567  3     | 67    46    2     | 9     1     8     |
| 8     467   2     | 3     9     1     | 67    5     46    |
| 9     1     467   | 5     467   8     | 2     3     467   |
+-------------------+-------------------+-------------------+

r7c6=2: r7c45 can't be [64] with 7 @ r7c12
=> r57c4=[67]
r5c6=4: r5c12345 can't be [19562]
=> r5c3=7

Highlight to view the solution I wrote:785239146
469817523
321456879
234985761
197624385
658173492
543762918
872391654
916548237

:idea:
udosuk
 
Posts: 2698
Joined: 17 July 2005

Postby stigant » Thu Apr 23, 2009 7:39 pm

Thanks for another great puzzle!

You're welcome! I'm just thankful that someone other than me is enjoying them.

Just for your information, this one can be solvable with just the "existence of arrows", i.e. you don't need the "no-arrow rule" at all to solve it logically.

Interesting, I'll have to give it a shot without that. I guess I was just more in tune with that rule after the first puzzle and our discussion.

Here's another one:
Image

EDIT: The original of this puzzle had 2 errors. I've fixed, re-solved, and re-posted. The above image is now correct.
Last edited by stigant on Fri Apr 24, 2009 10:43 am, edited 1 time in total.
stigant
 
Posts: 14
Joined: 10 January 2007

Postby udosuk » Fri Apr 24, 2009 5:10 am

Sorry, but I think your latest (#3) puzzle has no valid solution. Could you please check against your solution and see if there is any mistake?:(
udosuk
 
Posts: 2698
Joined: 17 July 2005

Postby stigant » Fri Apr 24, 2009 1:51 pm

Yep... two squares have the wrong arrows according to the solution I worked out. I don't have the original with me (it's at work and I'm heading there now) so I don't know if it's just a transcription error or something more serious. I'll check, resolve if necessary, and then re-post.
stigant
 
Posts: 14
Joined: 10 January 2007

Postby stigant » Fri Apr 24, 2009 2:48 pm

Ok, I've fixed the problem with puzzle 3. I'm very sorry about that... One of the errors resulted from a change that I made in the solution to resolve the uniqueness of the last 4 squares. This resulted in a change in the number of buildings that you could see from another square, and I didn't notice the problem on my second solve. The other problem was a missing arrow and had been in the puzzle since the very beginning and I never noticed it in any of my solves (doh!). I've created a program to spit out the arrows for me, so hopefully there won't be any repeats of these problem in the future.

For reference, the affected squares were
R2C5 (removed right-facing arrow)
R6C1 (added right-facing arrow)
stigant
 
Posts: 14
Joined: 10 January 2007

Postby udosuk » Fri Apr 24, 2009 4:30 pm

Thanks stigant for fixing the error.:)

Just like to point out that it's not hard at all to create a text version for these puzzles. For example the latest #3 can be presented as:

Code: Select all
__._>|__.v_|__.v>|__.v_|__.__|__.__|__.__|__.v_|__.__
__.__|__.__|__.__|__.__|__.v_|__.__|_^.v_|<_.__|__.__
__.__|__.__|_^.__|<_.__|__.__|__.__|__.__|<^.__|__.__
__._>|__.__|__.__|__.__|__.__|__.__|_^._>|__._>|__.__
__.__|__.__|__.__|<^.v_|<^.v>|_^.v_|__.__|_^.v_|__.__
_^._>|<_.v>|__.__|__.__|_^.__|__.__|__.__|__.__|__.v_
__.__|__.__|__.v_|__.__|__.__|<_.__|<^.__|__.__|__.__
__.v_|__._>|__.__|__.__|__.__|__.__|_^.__|__.__|<_.__
__.__|__.__|__.__|__._>|_^.__|__._>|<_.__|__.__|__.__

Hopefully it's straight forward enough to understand...

Highlight to view the solution I wrote:__4_>|__2v_|__3v>|__1v_|__8__|__5__|__9__|__6v_|__7__
__7__|__8__|__5__|__9__|__2v_|__6__|_^1v_|<_3__|__4__
__9__|__6__|_^1__|<_3__|__7__|__4__|__8__|<^2__|__5__
__3_>|__4__|__7__|__5__|__6__|__9__|_^2_>|__1_>|__8__
__8__|__5__|__6__|<^2v_|<^3v>|_^1v_|__7__|_^4v_|__9__
_^2_>|<_1v>|__9__|__7__|_^4__|__8__|__6__|__5__|__3v_
__6__|__9__|__2v_|__8__|__5__|<_3__|<^4__|__7__|__1__
__1v_|__3_>|__4__|__6__|__9__|__7__|_^5__|__8__|<_2__
__5__|__7__|__8__|__4_>|_^1__|__2_>|<_3__|__9__|__6__

423185967
785926134
961374825
347569218
856231749
219748653
692853471
134697582
578412396

I think this one is by far the easiest among the 3. Many arrows aren't required to be looked at, including the right arrow @ r6c1. Also the "no-arrow" rule isn't required at all again. It's probably even solvable without pencilmarks (haven't tried that yet).

Guess you've struck a gem with #1...:)
udosuk
 
Posts: 2698
Joined: 17 July 2005

Postby stigant » Fri Apr 24, 2009 4:49 pm

Just like to point out that it's not hard at all to create a text version for these puzzles. For example the latest #3 can be presented as:

Yeah, that's essentially what my program does. I had written one a couple of weeks ago to do the same thing, but I lost it in a power surge.

** Spoilers ahead **

I agree... #3 is the weakest from a puzzling standpoint. The interesting thing is that #1 was a completely randomly generated board that just happened to work. I tried several other random boards, but none of them even came close to working out. So, for the other two, I hand-constructed the solution to include opportunities for the skyscraper constraints to kick-in. Specifically in #2, I started with column 6 - having an 8^ at the bottom. This force the fill for the entire column.

In #3, I wanted to have a 4 with all four arrows filled in in the center. But it turns out that's impossible, so I had to settle for a 3 there. The puzzle suffers somewhat because of that.

I have one I'm working on at the moment that I think will be better, but I have a serious uniqueness issue to work out (it involves 8 squares). I may just settle for adding a numerical clue. I really like the elegance of no numbers at all, but I also really like one of the deductions I built into this puzzle, and I don't think I'm going to be able to remove the uniqueness violation without changing a significant portion of the rest of the board. We'll see.
stigant
 
Posts: 14
Joined: 10 January 2007

Postby udosuk » Fri Apr 24, 2009 6:30 pm

stigant wrote:I have one I'm working on at the moment that I think will be better, but I have a serious uniqueness issue to work out (it involves 8 squares). I may just settle for adding a numerical clue. I really like the elegance of no numbers at all, but I also really like one of the deductions I built into this puzzle, and I don't think I'm going to be able to remove the uniqueness violation without changing a significant portion of the rest of the board. We'll see.

If you don't want numerical clues you can consider adding 1 or more "greater than" signs between adjacent cells to show their relationship. Or, like in "consecutive sudoku" add a thick bar between some cells which are consecutive (in official consecutive sudoku puzzles there is the "bar=consecutive & no-bar=non-consecutive" rule but in your case I think you can drop the latter half of it, i.e. "no-bar can mean consecutive or non-consecutive").

Speaking of which, I also think you might try to drop the "no-arrow" rule so that you can have more leeway in creating the puzzles. Just a random thought...:idea:
udosuk
 
Posts: 2698
Joined: 17 July 2005

Next

Return to Sudoku variants