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

[mbezhanov/faker-provider-collection

A collection of custom providers for the Faker library

2138.6M24](/packages/mbezhanov-faker-provider-collection)[internal/destroy

55870.4k7](/packages/internal-destroy)[guava/filament-clusters

Filament clusters allow you to cluster multiple fields into one visually.

15881.9k1](/packages/guava-filament-clusters)[m6web/statsd

Component easing the statsd usage

131.0M2](/packages/m6web-statsd)[astrotomic/php-conditional-proxy

This package provides a trait and class to allow calling methods based on a condition without breaking the method chain.

30155.8k5](/packages/astrotomic-php-conditional-proxy)[devtical/nova-qrcode-field

Nova QR code field

4560.6k2](/packages/devtical-nova-qrcode-field)

PHPackages © 2026

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