PHPackages                             uestla/simplex-calculator - 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. uestla/simplex-calculator

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

uestla/simplex-calculator
=========================

Simple tool for linear programming problems solving

1.0.8(3y ago)427.6k↓27.9%20[2 PRs](https://github.com/uestla/Simplex-Calculator/pulls)MITPHPPHP &gt;=5.3.0

Since Feb 1Pushed 1y ago5 watchersCompare

[ Source](https://github.com/uestla/Simplex-Calculator)[ Packagist](https://packagist.org/packages/uestla/simplex-calculator)[ Docs](http://simplex.tode.cz)[ RSS](/packages/uestla-simplex-calculator/feed)WikiDiscussions master Synced 1mo ago

READMEChangelogDependencies (3)Versions (11)Used By (0)

Simplex Calculator
==================

[](#simplex-calculator)

About
-----

[](#about)

PHP library for solving linear programming problems using dual simplex algorithm.

**NOTE:** Basis cycling detection is not implemented.

Installation
------------

[](#installation)

The recommended way is to use [Composer](https://getcomposer.org/):

```
composer require uestla/simplex-calculator
```

You can also download the latest [release](https://github.com/uestla/Simplex-Calculator/tags) as a ZIP file.

Conventions
-----------

[](#conventions)

Please name all your input variables as `x` where `` is a natural number (see [example below](#defining-and-solving-simplex-tasks) for details).

Usage
-----

[](#usage)

### Loading library

[](#loading-library)

```
// using Composer
require_once __DIR__ . '/vendor/autoload.php';

// using manual download
require_once __DIR__ . '/Simplex/simplex.php';
```

### Defining and solving simplex tasks

[](#defining-and-solving-simplex-tasks)

```
// define task: Maximize x1 + 2x2
$task = new Simplex\Task(new Simplex\Func(array(
	'x1' => 1,
	'x2' => 2,
)));

// add constraints

// 3x1 + 2x2 addRestriction(new Simplex\Restriction(array(
	'x1' => 3,
	'x2' => 2,

), Simplex\Restriction::TYPE_LOE, 24));

// -2x1 - 4x2 >= -32
$task->addRestriction(new Simplex\Restriction(array(
	'x1' => -2,
	'x2' => -4,

), Simplex\Restriction::TYPE_GOE, -32));

// create solver
$solver = new Simplex\Solver($task);

// get solutions
$solution = $solver->getSolution(); // array('x1' => 0, 'x2' => 8, 'x3' => 8, 'x4' => 0)
$alternativeSolutions = $solver->getAlternativeSolution(); // array(array('x1' => 4, 'x2' => 6, 'x3' => 0, 'x4' => 0))

// get optimal value
$optimum = $solver->getSolutionValue($solution); // 16

// print solutions
$printer = new Simplex\Printer;
$printer->printSolution($solver);

// or print the whole solution process
$printer->printSolver($solver);
```

### Solutions

[](#solutions)

`$solver->getSolutions()` returns primary optimal solution. The value can be of 3 types:

- `array` - vector with optimal coefficients to each input variable
- `false` - optimal solution does not exist
- `null` - not enough steps to find solution

By default, solver stops the calculation after 16 simplex tables. You can increase the maximum steps limit with the second parameter:

```
$solver = new Simplex\Solver($task, 32);
```

`$solver->getAlternativeSolutions()` returns array of other optimal solutions if any have been found. It may return:

- `array` - array of vectors with alternative optimal solutions
- `null` - no alternative optimal solution found

###  Health Score

41

—

FairBetter than 89% of packages

Maintenance29

Infrequent updates — may be unmaintained

Popularity39

Limited adoption so far

Community18

Small or concentrated contributor base

Maturity64

Established project with proven stability

 Bus Factor1

Top contributor holds 88.9% 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 ~436 days

Recently: every ~357 days

Total

10

Last Release

564d ago

Major Versions

1.0.8 → v2.0.x-dev2024-10-31

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

v2.0.x-devPHP &gt;=8.2

### Community

Maintainers

![](https://www.gravatar.com/avatar/4d3a756def83a4d23274f1b7c7854f6eda71834901be89fc668f85f170f97653?d=identicon)[uestla](/maintainers/uestla)

---

Top Contributors

[![uestla](https://avatars.githubusercontent.com/u/373888?v=4)](https://github.com/uestla "uestla (40 commits)")[![Domi04151309](https://avatars.githubusercontent.com/u/36272047?v=4)](https://github.com/Domi04151309 "Domi04151309 (2 commits)")[![piotrknapik](https://avatars.githubusercontent.com/u/1819432?v=4)](https://github.com/piotrknapik "piotrknapik (2 commits)")[![nivshah](https://avatars.githubusercontent.com/u/685145?v=4)](https://github.com/nivshah "nivshah (1 commits)")

---

Tags

Algorithmprogramminglinearsimplex

### Embed Badge

![Health badge](/badges/uestla-simplex-calculator/health.svg)

```
[![Health](https://phpackages.com/badges/uestla-simplex-calculator/health.svg)](https://phpackages.com/packages/uestla-simplex-calculator)
```

###  Alternatives

[rubix/ml

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

2.2k1.4M28](/packages/rubix-ml)[donatello-za/rake-php-plus

Yet another PHP implementation of the Rapid Automatic Keyword Extraction algorithm (RAKE).

271865.1k10](/packages/donatello-za-rake-php-plus)[ihor/nspl

Non-standard PHP library (NSPL) - functional primitives toolbox and more

381368.5k](/packages/ihor-nspl)[tga/simhash-php

SimHash similarities algorithm implementation for PHP 5.3

15243.5k1](/packages/tga-simhash-php)[fisharebest/algorithm

Implementation of standard algorithms in PHP.

7192.7k1](/packages/fisharebest-algorithm)[edgaras/strsim

Collection of string similarity and distance algorithms in PHP including Levenshtein, Damerau-Levenshtein, Jaro-Winkler, and more

2423.0k](/packages/edgaras-strsim)

PHPackages © 2026

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