Toy Robot to Solve Sudoku (w/ Video)

Sep 03, 2009 by Lin Edwards weblog

(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.

This video is not supported by your browser at this time.

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: tiltedtwister.com/sudokusolver.html

© 2009 PhysOrg.com

Explore further: Robots learn to take a proper handoff by following digitized human examples

add to favorites email to friend print save as pdf

Related Stories

Two Robot Chefs Make Omelets

Dec 04, 2008

(PhysOrg.com) -- No "house of the future" is complete without a household robot to do the cooking and cleaning. Although today´s robots still have a ways to go before substituting for a real live-in maid, ...

Recommended for you

Microsoft readies new Xbox as entertainment hub

5 hours ago

Microsoft offers a glimpse Tuesday at a new-generation Xbox as videogame consoles evolve into home entertainment centers and adapt to competition from smartphones and tablets.

Finnish start-up launches smartphone to rival giants

20 hours ago

A group of ex-Nokia employees who quit over the company's decision to abandon the planned MeeGo operating system in favour of Windows presented their own smartphone on Monday, hoping to rival the sector's ...

NEC phone is liquid-cooled and gender-specific

May 20, 2013

(Phys.org) —Pink is the color of princess fairy-tale gowns, magic slippers, upscale cupcake icing, and everything else favorable to girls who just want to be girls. "Ladyphones" appear to be concepts for ...

Expectations high for next Xbox

May 20, 2013

It's almost time for a new Xbox. Eight years have passed since Microsoft unveiled the Xbox 360, double the amount of time between the original Xbox debut in 2001 and its high-definition successor's launch ...

Congress gets mixed advice on regulating drones

May 17, 2013

(AP)—The growing use of unmanned surveillance "eyes in the sky" aircraft raises a thicket of privacy concerns, but the U.S. Congress is getting mixed advice on what, if anything, to do about it.

User comments : 1

Adjust slider to filter visible comments by rank

Display comments: newest first

Going
5 / 5 (1) Sep 03, 2009
The Lego Rubik cube solving robot is even more awesome. http://www.youtub...n5A0HbhU

More news stories

Finnish start-up launches smartphone to rival giants

A group of ex-Nokia employees who quit over the company's decision to abandon the planned MeeGo operating system in favour of Windows presented their own smartphone on Monday, hoping to rival the sector's ...

Expectations high for next Xbox

It's almost time for a new Xbox. Eight years have passed since Microsoft unveiled the Xbox 360, double the amount of time between the original Xbox debut in 2001 and its high-definition successor's launch ...

Congress gets mixed advice on regulating drones

(AP)—The growing use of unmanned surveillance "eyes in the sky" aircraft raises a thicket of privacy concerns, but the U.S. Congress is getting mixed advice on what, if anything, to do about it.

Space drives e-mobility

An ESA business incubation start-up company is helping major car manufacturers to develop electric vehicle concepts and improve safety systems by turning ideas quickly into virtual prototypes.

New factor to control oncogene-induced senescence

An article published on the journal Nature describes the major role that Pyruvate dehydrogenase (PDH) —an enzyme of cellular energy metabolism— plays in the regulation of the cellular senescence induce ...