PHPackages                             danielzzz/bipartite - 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. danielzzz/bipartite

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

danielzzz/bipartite
===================

bipartite graph implementation for php

1.0.0(3y ago)03MITPHP

Since Aug 19Pushed 3y ago1 watchersCompare

[ Source](https://github.com/danielzzz/bipartite-matching)[ Packagist](https://packagist.org/packages/danielzzz/bipartite)[ RSS](/packages/danielzzz-bipartite/feed)WikiDiscussions main Synced 4w ago

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

Bipartite matching using the Hopcroft-Karp Algorithm
====================================================

[](#bipartite-matching-using-the-hopcroft-karp-algorithm)

Takes an unweighted bipartite graph as input and returns the maximal cardinality matching.

This is a PHP implementation of the Hopcroft-Karp biparite matching algorithm.
[https://en.wikipedia.org/wiki/Hopcroft%E2%80%93Karp\_algorithm](https://en.wikipedia.org/wiki/Hopcroft%E2%80%93Karp_algorithm)

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

[](#installation)

```
composer require danielzzz/bipartite

```

Practical usage
---------------

[](#practical-usage)

This algorithm can be used for example to maximize number of meetings when we have each member of a group A requesting multiple meetings with people from the group B.

```
$input = [
    'personA' => ['person3', 'person1'],
    'personB' => ['person3'],
    'personC' => ['person4', 'person2'],
    'personD' => ['person2']
];

$bipartite = new Bipartite();
$result = $bipartite->match($input);

/*
result:
^ array:4 [
  "personA" => "person1"
  "personC" => "person4"
  "personD" => "person2"
  "personB" => "person3"
]

*/

```

Tests
-----

[](#tests)

```
composer test

```

###  Health Score

21

—

LowBetter than 19% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity3

Limited adoption so far

Community4

Small or concentrated contributor base

Maturity47

Maturing project, gaining track record

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

1358d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/dc226728760f54c0c793ce968f8682b54e063b41d553b4aee3f01a1d0ed6a627?d=identicon)[danielzzz](/maintainers/danielzzz)

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/danielzzz-bipartite/health.svg)

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

###  Alternatives

[slushie/laravel-assetic

Assetic support for Laravel 4

3717.0k](/packages/slushie-laravel-assetic)[welp/ical-bundle

Symfony Bundle to manage .ics iCal file (creating and eventually reading)

10114.3k](/packages/welp-ical-bundle)

PHPackages © 2026

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