GET EMAIL UPDATES FROM POWERTOFLY
By signing up you accept the Terms of Service and Privacy Policy
BROWSE CATEGORIES
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!).

Career Advice

Growing Your Career in Technical Support: 4 Tips for Getting Hired at Elastic from Support Director Heidi Sager

Heidi Sager loves math, but she also loves working with people.

She always has, which is why she enjoyed her part-time job working at the IT department of the University of Colorado while she was studying electrical engineering. (She'd started in computer science, but explains that it "wasn't for her" and switched her major.) She helped students and professors with word processors, basic programming, and software checkout, and took a full-time job after graduation as a UNIX system administrator.

READ MORE AND DISCUSS Show less
Career Advice

3 Women, 7 Lessons: What These Relativity Leaders Learned in 2020

Working at Relativity—the global tech company that equips legal and compliance professionals with a powerful data-organizing and discovery platform—looked different in 2020. The highly collaborative environment of their Chicago headquarters transitioned to a virtual setting, and just like companies around the country, Relativity adapted their goals and major projects to a completely remote environment.

READ MORE AND DISCUSS Show less
For Employers

8 (Virtual) Diversity Conferences to Attend in 2021

As you set your personal and professional priorities for 2021, is a diversity and inclusion conference on your agenda? If not, it should be—particularly after 2020's pandemic and racial reckoning have brought D&I issues to the forefront for many.
READ MORE AND DISCUSS Show less
Career Advice

Finding Her Sport: Being Part of the Team in a Startup Environment

A Conversation with Vouch's Lead Designer Carrie Phillips

Carrie Phillips was working at a healthcare startup when she connected with one of Vouch Insurance's founders, a friend of a friend from university. The idea he and his cofounder were working on: a way to solve the business insurance problem, piqued her interest. "I was pretty familiar with how broken insurance was," says Carrie, who was interested in the mission, as well as the chance to be their first full-time hire and help build the product from the ground up.
READ MORE AND DISCUSS Show less
Loading...
© Rebelmouse 2020