Toy Robot to Solve Sudoku (w/ Video)

September 3, 2009 by Lin Edwards Toy Robot to Solve Sudoku

Enlarge

(PhysOrg.com) -- A Swedish programmer, Hans Andersson, has used a Lego Mindstorms NXT kit to develop a robot to solve Sudoku puzzles.

Andersson first purchased the Lego Mindstorms kit for his daughters, but couldn't resist playing with it himself.

The first scans the puzzle and uses an to map out the puzzle's pre-set numbers and blank squares. The robot scans one line at a time, inching forward a little after each line is scanned.

The blurry scanned image is then converted to a black and white binary image to improve the sharpness of the picture. A threshold value calculated by Otsu's Method is used to determine whether each pixel in the image is white or black.

The Otsu Method classes pixels as either foreground or background, and then determines the optimal threshold that minimizes the intra-class variance. Pixels below the threshold are set to black, and those above are set to white.

A thinning algorithm is then used to convert the resulting image of each digit to 1-pixel wide lines. The digits are then examined for features such as their width, and the number and direction of tips on the digit. The digit six, for example, has one tip, which points to the right. Following this procedure for each digit, the robot identifies all the pre-set numbers in the puzzle.

Once the puzzle is mapped, the robot solves it and fills in the blank squares. A recursive backtracking algorithm would normally be used to solve puzzles such as Sudoku, crosswords, or other puzzles in which the solution has several candidates. The method carries out a systematic examination of all possible solutions, and abandons and does not re-visit any that are eliminated.

The Lego Mindstorms processor is too slow to use a backtracking algorithm and it does not allow for recursive functions, so Andersson had to make sure the calculations were optimized. The result is a little robot that can solve Sudoku puzzles and get them right every time, and in only a few minutes.

More information: http://tiltedtwister.com/sudokusolver.html

© 2009 PhysOrg.com


print this article email this article download pdf blog this article bookmark this article     Stumble it Digg this share on Facebook retweet share on Reddit add to delicious
Rate this story - 4.6 /5 (5 votes)

Rank Filter

Move the slider to adjust rank threshold, so that you can hide some of the comments.


Display comments: newest first


September 3, 2009 all stories

Comments: 1

4.6 /5 (5 votes)
  • Stumble this up

  • Digg this

  • share this

  • hide
  • Related Stories




  • hide
  • Relevant PhysicsForums posts

  • Achromat lens - magnifying LCD
    created 12 hours ago
  • Control System
    created Nov 24, 2009
  • Base Isolation Systems in Skyscrapers?
    created Nov 23, 2009
  • Need to interview a Computer Hardware Engineer for school project
    created Nov 23, 2009
  • More from Physics Forums - General Engineering

Other News

Apple's iPhone

Tips to keep iPhone battery going strong

Electronics / Consumer & Gadgets

created 52 minutes ago | popularity not rated yet | comments 0

In talking with my iPhone-using friends, we often seem to bring up how to squeeze the most life from the iPhone's "nonreplaceable" battery.


This curvaceous humanoid made of layers of cardboard is billed as the first eco-friendly robot

Robo-chefs and fashion-bots on show in Tokyo

Electronics / Robotics

created 1hour ago | popularity not rated yet | comments 0

Forget the Transformers and Astroboy: Japan's latest robots don't save the world -- they cook snacks, play with your kids, model clothes, and search for disaster victims.


Review: A riff on robotics with self-tuning guitar (AP)

Review: A riff on robotics with self-tuning guitar

Electronics / Consumer & Gadgets

created 15 hours ago | popularity 3.7 / 5 (7) | comments 2

(AP) -- New cars have been tuning themselves for the better part of two decades now, so it should feel less impressive that Gibson has built a guitar that can smoothly do the same.


Apple's iPhone

Modified iPhones Are Compromised By New Worm

Electronics / Consumer & Gadgets

created 21 hours ago | popularity 5 / 5 (4) | comments 1

(PhysOrg.com) -- Several research security firms have reported a new worm attack against jail broken iPhones, dubbed "Ikee.B or "Duh", this worm searches for personal and banking information.


Droid smart phone

Top 10 tech toys for 2009

Electronics / Consumer & Gadgets

created 13 hours ago | popularity 2.5 / 5 (2) | comments 0

This year, I've grouped my list of Top 10 tech toys into price ranges. Keep in mind that the prices listed are the suggested retail, and you may be able to find better deals.