Skip to main content

Learning to Solve Sudoku Problems with Computer Vision Aided Approaches

  • Conference paper
  • First Online:
Information and Decision Sciences

Part of the book series: Advances in Intelligent Systems and Computing ((AISC,volume 701))

Abstract

Sudoku puzzle is one of the most interesting logic based games with various levels which give our brains a good workout and make them active. However, it is difficult at a number of stages and easy to despondent players, especially for new players or people not enough confidence or endurance. The aim of this study is to develop a support tool for Soduku players, i.e. encouraging players to solve the hard Soduku puzzles or when seeking for help. It gives necessary steps as hints in order to solve the puzzles or check the correctness of their steps or even to solve the game completely. The input data, i.e. the Sudoku puzzle, come from the camera or even from the image/text files. Auto-detecting and recognising digits and the propagation constraint algorithms to generate the Sudoku hints or solutions are utilised. Methods and the tool itself are heavily tested to guarantee a stable and excellent program.

This is a preview of subscription content, log in via an institution to check access.

Access this chapter

Chapter
USD 29.95
Price excludes VAT (USA)
  • Available as PDF
  • Read on any device
  • Instant download
  • Own it forever
eBook
USD 169.00
Price excludes VAT (USA)
  • Available as EPUB and PDF
  • Read on any device
  • Instant download
  • Own it forever
Softcover Book
USD 219.99
Price excludes VAT (USA)
  • Compact, lightweight edition
  • Dispatched in 3 to 5 business days
  • Free shipping worldwide - see info

Tax calculation will be finalised at checkout

Purchases are for personal use only

Institutional subscriptions

Notes

  1. 1.

    All cells in the Sudoku grid have to be drawn out exactly. The Sudoku grid has 81 cells formed by 9 rows and 9 columns. They are equivalent to 10 horizontal and 10 vertical lines. Therefore, determining all the cells in Sudoku grid is quite simple since 4 key points have been determined (Fig. 3b). First, the coordinates of points in vertical line are calculated by the top-left and bottom-left points, so 8 points are expected to be determined. The interval between 2 points is the distance between top-left and bottom-left divided by 9. It is similar for the points in last vertical line. Then, the coordinates of every point in all horizontal lines are easily defined.

  2. 2.

    Particularly, the Sudoku grid in the original image is transformed into a result image of 450\(\,\times \,\)450 pixels in size. To increase the precision, the perspective transformation is applied to each cell from the original image.

  3. 3.

    Because the extracted Sudoku image’s size is 450\(\,\times \,\)450.

  4. 4.

    Because all contours are determined.

  5. 5.

    What defines the difficulty of the Sudoku puzzle is still debatable. The important fact is that the number of given digits is not really related to the difficulty of the Sudoku puzzle, the positions of digits are more decisive. One difficult Sudoku can contain more given digits than an easy one. Generally, a Sudoku puzzle, requiring more difficult techniques to solve, can be considered more difficult. Moreover, a Sudoku requiring more repetitions, i.e. many times beginning over again when a certain technique does not work or many uses of a difficult technique, can also be considered more difficult. These two factors determine the difficulty of the game.

  6. 6.

    The time solving a difficult puzzle of backtracking method is more than 100 s times that one of the constraint propagation and exact cover methods. Because in the hard puzzle, it has to go forth and back in loops many times to look for the correct solution while constraint propagation and exact cover just need to eliminate some determined candidates. Constraint propagation method uses simpler and less constraints than the exact cover method, so it is faster to solve a puzzle.

  7. 7.

    The reason is that every of 81 cells is transformed in turn. Though it takes almost all the time to determine the input Sudoku, this application is much better than the manual input. Users’ mistakes and tedious tasks are reduced significantly.

References

  1. Golomb, S., Baumert, L.: Backtrack programming. J. ACM 12, 516–524 (1965)

    Article  MathSciNet  Google Scholar 

  2. Lewis, R.: Metaheuristics can solve sudoku puzzles. J. Heurist. 13(4), 387–401 (2007)

    Article  Google Scholar 

  3. Bessiere, C.: Constraint propagation. Found. Artif. Intel. 2, 29–36 (2006)

    Article  Google Scholar 

  4. Simonis, H.: Sudoku as a Constraint Problem, 11th International Conference on Principles and Practice of Constraint Programming (2005)

    Google Scholar 

  5. Rafael, C.G.: Digital Image Processing, 3rd edn. Pearson (2007)

    Google Scholar 

  6. Kamal, S., et al.: Detection of Sudoku puzzle using image processing and solving by Backtracking, simulated annealing and genetic algorithms: a comparative analysis. In: Proceedings of the 2015 Third ICIIP, pp. 179–184. IEEE Computer Society (2015)

    Google Scholar 

  7. Wicht, B., Henneberty, J.: Mixed handwritten and printed digit recognition. In: Sudoku with Convolutional Deep Belief Network, 13th ICDAR (2015)

    Google Scholar 

  8. Knuth, D.: Dancing links, Millennial perspectives in computer science, 187–214 (2000)

    Google Scholar 

Download references

Author information

Authors and Affiliations

Authors

Corresponding author

Correspondence to Tuan T. Nguyen .

Editor information

Editors and Affiliations

Rights and permissions

Reprints and permissions

Copyright information

© 2018 Springer Nature Singapore Pte Ltd.

About this paper

Check for updates. Verify currency and authenticity via CrossMark

Cite this paper

Nguyen, T.T., Nguyen, S.T.T., Nguyen, L.C. (2018). Learning to Solve Sudoku Problems with Computer Vision Aided Approaches. In: Satapathy, S., Tavares, J., Bhateja, V., Mohanty, J. (eds) Information and Decision Sciences. Advances in Intelligent Systems and Computing, vol 701. Springer, Singapore. https://doi.org/10.1007/978-981-10-7563-6_56

Download citation

  • DOI: https://doi.org/10.1007/978-981-10-7563-6_56

  • Published:

  • Publisher Name: Springer, Singapore

  • Print ISBN: 978-981-10-7562-9

  • Online ISBN: 978-981-10-7563-6

  • eBook Packages: EngineeringEngineering (R0)

Publish with us

Policies and ethics