sedoku problem on Matlab

Discussion in 'The Projects Forum' started by obaid123, Apr 16, 2013.

  1. obaid123

    Thread Starter New Member

    Apr 4, 2012
    5
    0
    Allow a user to enter a 9x9 Sudoku problem, find and print out the solution.

    CAn anyone help PLZZZZ
     
  2. WBahn

    Moderator

    Mar 31, 2012
    17,737
    4,789
    This sounds much more like homework of some kind. If so, you need to show your best effort at tackling it. At least describe a rough approach that you are considering.
     
  3. MrChips

    Moderator

    Oct 2, 2009
    12,440
    3,361
    Been there, done that.
     
  4. wayneh

    Expert

    Sep 9, 2010
    12,103
    3,038
    I did mine in Excel. It'll even solve the "diabolical" ones where you have to try alternatives and see what happens.
     
  5. WBahn

    Moderator

    Mar 31, 2012
    17,737
    4,789
    I did mine in C. It solves all of the unambiguous ones first, then iterates through boxes that have the fewest possibilities first. It will find ALL solutions, and hence you can verify that the puzzle is even a real sudoku puzzle since the solutions are required to be unique.

    I have a friend that coded up a brute force solver and, much to my surprise, it is able to solve the majority of puzzles thrown at if very quickly. But it is possible to craft a puzzle that sends it off to LaLa lLand without too much effort. But just a bit of smarts regarding which cells to choose to begin the recursion with overcome the vast majority of those.
     
Loading...