Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Hungarian Algorithm - PHP version

Tags:

algorithm

php

I am trying to implement the job assignment Hungarian algorithm. http://en.wikipedia.org/wiki/Hungarian_algorithm#The_algorithm_in_terms_of_bipartite_graphs

[I think I understand the algorithm, but am not able to appreciate why is it O(n^3). But that is just a curiosity.]

What I am looking for is a PHP implementation of Hungarian algorithm. The Wikipedia link does have a link to implementations, but I have not found PHP version yet.

like image 832
Josh Avatar asked Mar 23 '11 05:03

Josh


1 Answers

Most likely you want to look at this article Floyd-Warshall and the all-pairs-shortest-path problem. Unfortunately it is in C but it can help you with the implementation in php ( http://wilanw.blogspot.com/2010/01/floyd-warshall-all-pairs-shortest-path.html ).

like image 61
Micromega Avatar answered Sep 29 '22 08:09

Micromega