PHPackages                             fgsl/geneticalgorithm - 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. fgsl/geneticalgorithm

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

fgsl/geneticalgorithm
=====================

Fgsl Genetic Algorithm

2.0.1(3mo ago)77AGPL-3.0-onlyPHPPHP &gt;=8.2CI failing

Since Oct 24Pushed 3mo ago1 watchersCompare

[ Source](https://github.com/fgsl/geneticalgorithm)[ Packagist](https://packagist.org/packages/fgsl/geneticalgorithm)[ Docs](https://github.com/fgsl/geneticalgorithm)[ RSS](/packages/fgsl-geneticalgorithm/feed)WikiDiscussions master Synced 4d ago

READMEChangelog (3)Dependencies (1)Versions (5)Used By (0)

Fgsl Genetic Algorithm
======================

[](#fgsl-genetic-algorithm)

How to run the sample
---------------------

[](#how-to-run-the-sample)

There is a sample of genetic algorithm application as a an automated test. For running it, first run `composer update` for install the dependencies, and then run:

```
vendor/bin/phpunit --bootstrap vendor/autoload.php tests/
```

An example of test output:

```
...
Weight summatory:
1* 12 + 0 * 1 + 3 * 4 + 0 * 1 + 2 * 2 = 28

Value summatory:
1* 4 + 0 * 2 + 3 * 10 + 0 * 1 + 2 * 2 = 38

Weight summatory:
1* 12 + 2 * 1 + 0 * 4 + 1 * 1 + 0 * 2 = 15

Value summatory:
1* 4 + 2 * 2 + 0 * 10 + 1 * 1 + 0 * 2 = 9

Time: 8.62 seconds, Memory: 27.46 MB

OK (1 test, 1 assertion)
```

How to use:
-----------

[](#how-to-use)

Create a class that implements `Fgsl\GeneticAlgorithm\RulesInterface`. This class must define fitness function and other constraints.

Inject an instance of rules class in an instance of `Fgsl\GeneticAlgorithm\GeneticAlgorithm` and call method `execute`.

You can see processing details enabling verbose parameter in class constructor.

###  Health Score

46

—

FairBetter than 93% of packages

Maintenance80

Actively maintained with recent releases

Popularity9

Limited adoption so far

Community9

Small or concentrated contributor base

Maturity73

Established project with proven stability

 Bus Factor1

Top contributor holds 85.7% 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.

###  Release Activity

Cadence

Every ~1144 days

Total

3

Last Release

107d ago

Major Versions

1.0.0 → 2.0.02025-05-26

PHP version history (2 changes)1.0.0PHP &gt;=7.0

2.0.0PHP &gt;=8.2

### Community

Maintainers

![](https://www.gravatar.com/avatar/2cb6d4497d6c4358a5c7e7e31d34412f5d6e9617aafa487b125bcc870171cd1e?d=identicon)[fgsl](/maintainers/fgsl)

---

Top Contributors

[![fgsl](https://avatars.githubusercontent.com/u/128915?v=4)](https://github.com/fgsl "fgsl (6 commits)")[![dependabot[bot]](https://avatars.githubusercontent.com/in/29110?v=4)](https://github.com/dependabot[bot] "dependabot[bot] (1 commits)")

---

Tags

artificial intelligencegenetic algorithmcomputational intelligenceevolutionary computation

### Embed Badge

![Health badge](/badges/fgsl-geneticalgorithm/health.svg)

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

###  Alternatives

[rubix/ml

A high-level machine learning and deep learning library for the PHP language.

2.2k1.4M28](/packages/rubix-ml)[php-ai/php-ml

PHP-ML - Machine Learning library for PHP

1061.7M12](/packages/php-ai-php-ml)[nlgen/nlgen

A library for creating recursive-descent natural language generators.

56181.3k](/packages/nlgen-nlgen)

PHPackages © 2026

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