marwanmusa / Sudoku-Solver-with-Streamlit

Sudoku Game using Streamlit

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Sudoku Solver web application

Python Streamlit

Marwan Musa github

A fast, interactive web application for solving Sudoku puzzles. The solver engine is built using the Linear Programming library Pyomo and the UI is built with Streamlit. Inspired by jhrcook.


demo

Sudoku

The Sudoku is a logic-based combinatorial number-placement puzzle (source: wikipedia). The objective is to fill a $9 \times 9$ grid with digits so that each column, each row, and each of the nine $3 \times 3$ subgrids that compose the grid contain all of the digits from 1 to 9.

The puzzle setter provides a partially completed grid, which for a well-posed puzzle has a single solution.

Completed games are always an example of a Latin square which include an additional constraint on the contents of individual regions.

Example: Game of the day (22-03-2020)

An example of an instance of the game of the day is a s follows:

. . . | . 9 4 | 8 . .
. 2 . | . 1 7 | 5 . .
. . 6 | . . . | . 1 .
---------------------
. 6 2 | . . 8 | . . 7
. . . | 3 . 2 | . . .
3 . . | 9 . . | 4 2 .
---------------------
. 9 . | . . . | 6 . .
. . 1 | 7 8 . | . 9 .
. . 3 | 4 5 . | . . .

We show next how to solve this puzzle (and any other instance of the game) by using Integer Linear Programming (ILP).


To run the app:

Open command prompt / cmd
streamlit run app.py

About

Sudoku Game using Streamlit


Languages

Language:Python 100.0%