PHPackages                             litvinenko/combinatorics - 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. litvinenko/combinatorics

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

litvinenko/combinatorics
========================

Classes for generating combinatorial sets and solving some combinatorial problems

v0.0.1(10y ago)016PHPPHP &gt;=5.4.0

Since Sep 29Pushed 10y ago1 watchersCompare

[ Source](https://github.com/absent1706/php-combinatorics)[ Packagist](https://packagist.org/packages/litvinenko/combinatorics)[ RSS](/packages/litvinenko-combinatorics/feed)WikiDiscussions master Synced 1mo ago

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

php-combinatorics
=================

[](#php-combinatorics)

This code can:

- generate permutations and some special cases of permutations
- solve combinatorial problems by means of branch and bound and beam search

PDP problem
-----------

[](#pdp-problem)

Main interface class is Pdp.php. Uses  to check 3D constraints Uses [https://github.com/absent1706/common\_php\_app](https://github.com/absent1706/common_php_app) to handle event-observer pattern Uses [https://github.com/absent1706/extended\_varien\_object](https://github.com/absent1706/extended_varien_object) as a foundation of all objects

\####Usage example

```
require_once 'vendor/autoload.php';

$xmlConfigFile  = __DIR__.'/config.xml';
$paramsFile = __DIR__.'/data/params.json';

\Litvinenko\Common\App::init($xmlConfigFile);

$launcher = new \Litvinenko\Combinatorics\Pdp\Pdp;
$params     = json_decode(file_get_contents($paramsFile), true);

echo json_encode($launcher->getSolution($params['data'], $params['config']));
```

\####Input params Example if input JSON:

```
{
   "method": "gen", // hardcoded to use one solution method for now
   "config": { // config section. sets how to solve pdp problem
      "check_final_loading": false, // check 3D constraints for finally generated 'best' paths
      "check_transitional_loading_probability": "20", // probability of checking 3D constraints in partial paths
      "python_file": "/home/litvinenko/www/pdp-php/public_html/demo/pdphelper/pdphelper.py", // where script for checking 3D constraints is located
      "precise": "5", // beam width in % of generated path variants
      "weight_capacity": "1000", // vehicle weight_capacity
      "load_area": { // vehicle load area size
         "x": "100",
         "y": "100",
         "z": "100"
      }
   },
   "data": {
      "depot": [
         "200", // depot x
         "200" // depot y
      ],
      "points": {
        "1": [        // point id. Points with id <  (first 2 points in this example) will be treated as pickups, other half of points - as deliveries
            "117463", // point X coord
            "476120", // point Y coord
            "27",     // point box size x (for pickups)
            "38",     // point box size y (for pickups)
            "47",     // point box size z (for pickups)
            "38"      // point weight (for pickups)
        ],
         "2": [
            "400.39",
            "152.36",
            "9.37",
            "9.62",
            "9.34",
            "13.43"
         ],
         "3": [
            "345.42",
            "414.24",
            null,
            null,
            null,
            null
         ],
         "4": [
            "10.35",
            "17.68",
            null,
            null,
            null,
            null
         ]
      }
   }
}
```

On base of input points, point ojects are created in Litvinenko\\Combinatorics\\Pdp\\Pdp::createPointsFromArray method. To correctly create PDP-pairs, points must have ids from 1 to 2N , where N - number of PDP pairs. Pickup with number i (i&lt;N) will be associated to delivery with number i+N. I.g., for 2 PDP pairs we have 2 pickups (ids 1 and 2) and 2 deliveries (ids 3 and 4). Pdp pairs are: 1-3 and 2-4. So we must deliver one box from 1 to 3 and another from 2 to 4.

XML config for app:

```

                    \Litvinenko\Combinatorics\Pdp\Solver\PreciseGenerationSolver
                    canLoadObserver
                    1

    1

```

###  Health Score

22

—

LowBetter than 22% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity6

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity48

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.

###  Release Activity

Cadence

Unknown

Total

1

Last Release

3885d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/45f279e00b0a4c22cf1e0ccf82cd5e2c86e051d66ac911a6ca5413bea4178b2a?d=identicon)[absent1706](/maintainers/absent1706)

---

Top Contributors

[![absent1706](https://avatars.githubusercontent.com/u/1609763?v=4)](https://github.com/absent1706 "absent1706 (3 commits)")

### Embed Badge

![Health badge](/badges/litvinenko-combinatorics/health.svg)

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

###  Alternatives

[friendsoftypo3/dashboard

Dashboard for TYPO3

183.9k](/packages/friendsoftypo3-dashboard)

PHPackages © 2026

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