SAS Communities Library

We’re smarter together. Learn from this collection of community knowledge and add your expertise.
BookmarkSubscribeRSS Feed

Sudoku Puzzle Generator

Started ‎07-05-2014 by
Modified ‎04-04-2022 by
Views 4,590

The macro generates Sudoku puzzles using a two-stage algorithm.   Initially it finds a completed Sudoku square using a Markov chain algorithm that tries to sample at random from all squares that exist. The macro is not restricted to 9x9 squares and can generate squares up to 25x25 within a reasonable amount of time.  In the field of experimental design, these squares are known as gerechte designs with rectangular regions.  The second stage algorithm uses very simple reverse solving logic to generate a valid puzzle, by removing clues one by one from the completed square.  The puzzle generated is written to a SAS data set in the work library and can also be viewed as listing output or as RTF/PDF files.

Version history
Last update:
‎04-04-2022 03:17 PM
Updated by:

sas-innovate-white.png

Our biggest data and AI event of the year.

Don’t miss the livestream kicking off May 7. It’s free. It’s easy. And it’s the best seat in the house.

Join us virtually with our complimentary SAS Innovate Digital Pass. Watch live or on-demand in multiple languages, with translations available to help you get the most out of every session.

 

Register now!

SAS AI and Machine Learning Courses

The rapid growth of AI technologies is driving an AI skills gap and demand for AI talent. Ready to grow your AI literacy? SAS offers free ways to get started for beginners, business leaders, and analytics professionals of all skill levels. Your future self will thank you.

Get started

Article Labels
Article Tags