PHPackages                             eugeniypetrov/sudoku - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Utility &amp; Helpers](/categories/utility)
4. /
5. eugeniypetrov/sudoku

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

eugeniypetrov/sudoku
====================

Small library to solve sudoku

012PHP

Since Mar 24Pushed 12y ago1 watchersCompare

[ Source](https://github.com/EugeniyPetrov/Sudoku)[ Packagist](https://packagist.org/packages/eugeniypetrov/sudoku)[ RSS](/packages/eugeniypetrov-sudoku/feed)WikiDiscussions master Synced yesterday

READMEChangelogDependenciesVersions (1)Used By (0)

Sudoku
======

[](#sudoku)

Sudoku solver library. Example of usage:

```
use \EugeniyPetrov\Sudoku;

$sudoku = new Sudoku([
    [0, 0, 0, 0, 0, 0, 0, 0, 0],
    [0, 0, 0, 0, 0, 0, 0, 0, 0],
    [0, 0, 0, 0, 0, 0, 0, 0, 0],
    [0, 0, 0, 0, 0, 0, 0, 0, 0],
    [0, 0, 0, 0, 0, 0, 0, 0, 0],
    [0, 0, 0, 0, 0, 0, 0, 0, 0],
    [0, 0, 0, 0, 0, 0, 0, 0, 0],
    [0, 0, 0, 0, 0, 0, 0, 0, 0],
    [0, 0, 0, 0, 0, 0, 0, 0, 0],
]);

$sudoku->solve();

echo $sudoku;
```

The result will be

```
1	2	3	4	5	6	7	8	9
4	5	6	7	8	9	1	2	3
7	8	9	1	2	3	4	5	6
2	3	1	6	7	4	8	9	5
8	7	5	9	1	2	3	6	4
6	9	4	5	3	8	2	1	7
3	1	7	2	6	5	9	4	8
5	4	2	8	9	7	6	3	1
9	6	8	3	4	1	5	7	2

```

Algorithm works by counting the number of possible numbers for each cell and setting the only possible numbers in their places until sudoku is not solved. It there are no any cells with only possible values trying to recursively solve sudoku with each possible values.

Throws UnableToSolveException if sudoku have no solutions.

###  Health Score

20

—

LowBetter than 14% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity5

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity41

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/2155621?v=4)[Eugeniy Petrov](/maintainers/EugeniyPetrov)[@EugeniyPetrov](https://github.com/EugeniyPetrov)

---

Top Contributors

[![EugeniyPetrov](https://avatars.githubusercontent.com/u/2155621?v=4)](https://github.com/EugeniyPetrov "EugeniyPetrov (8 commits)")

### Embed Badge

![Health badge](/badges/eugeniypetrov-sudoku/health.svg)

```
[![Health](https://phpackages.com/badges/eugeniypetrov-sudoku/health.svg)](https://phpackages.com/packages/eugeniypetrov-sudoku)
```

###  Alternatives

[symfony/config

Helps you find, load, combine, autofill and validate configuration values of any kind

4.3k455.2M6.6k](/packages/symfony-config)[symfony/polyfill-php81

Symfony polyfill backporting some PHP 8.1+ features to lower PHP versions

886425.7M173](/packages/symfony-polyfill-php81)[matthiasmullie/minify

CSS &amp; JavaScript minifier, in PHP. Removes whitespace, strips comments, combines files (incl. @import statements and small assets in CSS files), and optimizes/shortens a few common programming patterns.

2.0k30.5M336](/packages/matthiasmullie-minify)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
