Forum Moderators: open

Message Too Old, No Replies

Hungarian Algorithm in Javascript

an odd request for you mathematicians out there

         

httpwebwitch

2:52 pm on Apr 21, 2008 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



This is a weird one... Maybe someone has done this already, but I figure it's a long shot.

I need an implementation of the Hungarian Algorithm [en.wikipedia.org] in Javascript. The function should take as input a cost matrix (2D array), and return an array of assignments.

I realize I may have to build this from scratch.

httpwebwitch

5:39 pm on Apr 22, 2008 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



edit: I was totally wrong. please disregard this reply entirely

Fotiman

6:03 pm on Apr 22, 2008 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



Edit: Does that mean you found a solution?

[edited by: Fotiman at 6:03 pm (utc) on April 22, 2008]

httpwebwitch

7:38 pm on Apr 22, 2008 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



I got it! finally! that was hard.

I have a Hungarian Algorithm function working but it's done in a frenzy of nested loops and scattered global functions... I'll clean it up and put it in a tidy OOP, then release it onto the www.

httpwebwitch

7:41 pm on Apr 22, 2008 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



'twould also be nice if the thing didn't run on for 350+ lines