Stuck on a really hard sudoku!

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • jkmyoung
    Recognized Expert Top Contributor
    • Mar 2006
    • 2057

    Stuck on a really hard sudoku!

    Hey, are there any sudoku experts out there? Can anyone tell me the next step in solving this sudoku and explain it properly? I've used all the rules I can think of but am now stuck.
    Code:
    51--263--
    7264-35-8
    93-5-76--
    395278461
    86--54--9
    47--698-5
    -59-41-83
    -43--2-5-
    -87-35-4-
  • JosAH
    Recognized Expert MVP
    • Mar 2007
    • 11453

    #2
    A stupid brute force solver solves this one in 0ms.

    Code:
    +-------+-------+-------+
    | 5 1 4 | 8 2 6 | 3 9 7 | 
    | 7 2 6 | 4 9 3 | 5 1 8 | 
    | 9 3 8 | 5 1 7 | 6 2 4 | 
    +-------+-------+-------+
    | 3 9 5 | 2 7 8 | 4 6 1 | 
    | 8 6 1 | 3 5 4 | 2 7 9 | 
    | 4 7 2 | 1 6 9 | 8 3 5 | 
    +-------+-------+-------+
    | 2 5 9 | 6 4 1 | 7 8 3 | 
    | 1 4 3 | 7 8 2 | 9 5 6 | 
    | 6 8 7 | 9 3 5 | 1 4 2 | 
    +-------+-------+-------+
    kind regards,

    Jos

    Comment

    • jkmyoung
      Recognized Expert Top Contributor
      • Mar 2006
      • 2057

      #3
      Thanks to your help I've found that there are at least 2 other solutions.
      Code:
      +-------+-------+-------+ 
      | 5 1 8 | 9 2 6 | 3 7 4 | 
      | 7 2 6 | 4 1 3 | 5 9 8 | 
      | 9 3 4 | 5 8 7 | 6 1 2 | 
      +-------+-------+-------+ 
      | 3 9 5 | 2 7 8 | 4 6 1 | 
      | 8 6 - | - 5 4 | 7 - 9 | 
      | 4 7 - | - 6 9 | 8 - 5 | 
      +-------+-------+-------+ 
      | 6 5 9 | 7 4 1 | 2 8 3 | 
      | 1 4 3 | 8 9 2 | 1 5 7 | 
      | 2 8 7 | 6 3 5 | 9 4 6 | 
      +-------+-------+-------+

      Comment

      • JosAH
        Recognized Expert MVP
        • Mar 2007
        • 11453

        #4
        Originally posted by jkmyoung
        Thanks to your help I've found that there are at least 2 other solutions.
        Yup, and that's exactly why trying to compute a solution fails: sometimes you can not compute a single value for a cell, only two or more values are possible. e.g. see an empty sudoku board. A (more or less) brute force approach simply tries a possiblity and when it fails it tries another possibility.

        Let's continue this discussion in the original thread in the algorithms section.

        kind regards,

        Jos

        Comment

        Working...