GET EMAIL UPDATES FROM POWERTOFLY
Tech Talk

How to use Integer Linear Puzzling to Attain Sudoku Fame & Fortune

Jan. 16th 2018

If you're not familiar with Sudoku, it's a popular game consisting of a 9x9 grid of numbers (1-9), that is further broken into three smaller 3x3 grids, where each line and grid must use each number (1-9) only once.

My name is Lauren and I'm a victim of the Sudoku "guess and check".

Sure, there may be one easy row that I can complete by doing some simple algebra, but when it comes to the "extra hard" puzzles, you can forget it. Each puzzle has 729 parameters, so the odds of my "guess and check" method being accurate the first time around are pretty slim.

Luckily, Allison Morgan has discovered a way to use Integer Linear Programming to solve Sudoku puzzles, and it only takes a few minutes!

"The first constraint requires that each cell, denoted by its row and column, contains one value. The second and third constraints maintain that only one of a value is contained within a column and row, respectively. The last constraint fixes that only one of a value is found in each subgrid.

And how exactly do you solve it?

"I used the Python package for solving LP problems called PuLP to solve the "Hard 1" sudoku above. PuLP has some nice existing documentation for how to use its software for this problem. This is another thorough explanation of using LP to solve sudoku puzzles, with supplementary code.

My adaptation of PuLP's sudoku example can be found here. Note that my edited constraints simply satisfy the starting state of my particular puzzle."

While the excitement from my "guess and check" method may have been lost to a formula, for any perfectionist like myself, I can sleep easy knowing the puzzle was successfully completed (and I learned about linear puzzling along the way!).

Inspiration

The Only Business Trip Packing List You Need

No Checked Luggage Required

Business travel can be fun: making new professional contacts, crushing your meetings, and not feeling bad about finally cracking open the novel that's been on your reading list forever (because what else are you supposed to do while you wait for your plane to board?).

READ MORE AND DISCUSS Show less
popular

What Does a Content Marketing Manager Do?

How You Can Start Your Career in Content Management

Whether you're fresh out of college or in search of your next career step, the digital job market is ripe for picking. Content Marketing is a great place to start if you're not only a good writer, but a solid communicator and people/project manager.

READ MORE AND DISCUSS Show less
WW (Formerly Weight Watchers)

Data Analyst vs. Data Scientist: What's the Difference?

Understanding the Key Differences & Similarities So You Can Decide Which Role is Right for You

You love numbers, you absolutely crushed your last Stats class, and you're an Excel wiz. Now you're thinking a career in data analysis/data science might be perfect for you. But which career should you pursue? And is there a difference between them, anyway?

READ MORE AND DISCUSS Show less
Work-Life Integration

15 Wellness Perks to Consider Before Accepting Your Next Job Offer

In today's fast-paced career culture, work-life balance is everything. When you're looking for a job, you want to make sure that the company will take care of you both in terms of finances and wellness.

A salary alone isn't enough to make most people stay at a job. In fact, four out of five employees say that a new benefit like a professional development program is more important than salary.

READ MORE AND DISCUSS Show less
Loading...
© Rebelmouse 2019