PHPackages                             arthurkushman/hungarian - 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. arthurkushman/hungarian

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

arthurkushman/hungarian
=======================

An implementation of the Hungarian algorithm in PHP.

0.1.2(7y ago)54772MITPHPPHP &gt;=7.0

Since Sep 3Pushed 7y ago1 watchersCompare

[ Source](https://github.com/arthurkushman/Hungarian)[ Packagist](https://packagist.org/packages/arthurkushman/hungarian)[ Docs](https://github.com/arthurkushman/Hungarian)[ RSS](/packages/arthurkushman-hungarian/feed)WikiDiscussions master Synced 2mo ago

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

Hungarian
=========

[](#hungarian)

An implementation of the Hungarian algorithm in PHP. The Hungarian algorithm can be used to find the optimal (minimal cost) assignment between two types of entities given a cost matrix. The Hungarian algorithm is also known as the Kuhn–Munkres algorithm or Munkres assignment algorithm.

Installation using Composer
===========================

[](#installation-using-composer)

Execute the following command in bash/zsh:

```
composer require arthurkushman/hungarian

```

Example usage
=============

[](#example-usage)

Define a square matrix with scores as input for the Hungarian class. A square matrix must be an array consisting of n arrays (rows), with each array consisting of n scores. The key of each element in the row array must be equal to the key of the column.

```
