File Exchange

image thumbnail

Functions for the rectangular assignment problem

version 1.5 (18.7 KB) by

This package provides m- and mex-functions for solving the rectangular assignment problem.

35 Downloads

Updated

View License

With this package, I provide some MATLAB-functions regarding the rectangular assignment problem. This problem appears for example in tracking applications, where one has M existing tracks and N new measurements. For each possible assignment, a cost or distance is computed. All cost values form a matrix, where the row index corresponds to the tracks and the column index corresponds to the measurements. The provided functions return an optimal or suboptimal assignment - in the sense of minimum overall costs - for the given matrix.
In the process of gating, typically very unlikely assignments are forbidden. The given functions can handle forbidden assignments, which are marked by setting the corresponding assignment cost to infinity.
The optimal solution is computed using Munkres algorithm, also known as Hungarian Algorithm.

The functions are called like
[assignment, cost] = assignmentalgorithm(distMatrix);

Comments and Ratings (37)

Alex Nikitin

Uubu

Uubu (view profile)

Shan Muga

Xin Liu

Matteo

Matteo (view profile)

Hi people,
I a question about the hungarian algorithm. this algorithm is optimal algorithm for the assignment problem, and the time complexity is O(n^3), right?
But , if the input is the multidimensional matrix, it's possible to use the hungarian algorithm? how does it change the algorithm and the time complexity ?
thanks

Excellent piece of work!

Thanks to guys like Markus MATLAB is the best computing environment in the world!

Markus, could you add to the readme file releveant references (Munkres, Hungarian algorithms, assigment problem in general)?

Umit

Umit (view profile)

Is 'assignmentoptimal(rectMatrix)' is the implementation of Munkres algorithm for rectangular case? It says it is Munkres algorithm but original algorithm is for square matrices. This one should be extended version for rectangular cases, right? Can you confirm this.

Yu

Yu (view profile)

It is very useful for me, especially can handle rectangle situation. Thanks a lot!

Yu

Yu (view profile)

yair

yair (view profile)

Hello Markus.

Is it a O(n^3) implementaion?

James

James (view profile)

Great work

Andy

Andy (view profile)

Nazmul Islam

Nazmul Islam

Thanks a lot for posting this !! I am looking for a Matlab implementation of a maximum weighted matching algorithm in a general graph (not bipartite). Does anyone know a Mathworks thread/link where it has already been posted?

Excellent !
I especially like the easy-to-use MEX files, and the outstanding test file.
I could optimize my problem beyond my best hope.

Bruno Luong

Bruno Luong (view profile)

Great, does what it claims and fast (I use for multi-target tracking.)

michele pace

Hi, I used assignmentoptimal.* in a multitracking application, exactly in the scenario you described. It works very well. Great job, thank you.

Greg Fricke

Thank you Markus!
This has helped me pass a critical practicality hurdle in my Master's Research without spending a week or two reading, writing, and debugging!

Clemens Yu

Great, thanks for sharing this code!!

Salha Al-Kuwaiti

Perfect! Keep the good work Up!

Leonid Chindelevitch

You saved me a lot of trouble, thank you!

Stephen Pan

Excellent!

Francois Berthiaume

Francois Berthiaume

Many thanks for the code, it works great!

Markus Buehren

Ldd Lasss, please let me know why you gave a bad rating for my package!

Ldd Lasss

Tom Pinkiewicz

Thanks Markus. This code works great. I re-packaged your c function and integrated it into Simulink. I've posted it on this website.

Tom Pinkiewicz

Thanks Markus. This code works great. I re-packaged your c function and integrated it into Simulink. I've posted it on this website.

Hao Cheng

Very nice work. I do appreciate.

A Alpers

praveen kuppili

very good one!!!!!!!

Coffee Bear

very fast

Tium Tium

works great, easy to use

Raimund Leitner

Very very good and easy to use implementation of the Munkres algorithm.

Updates

1.5

Updated munkres_wrap.m to be compatible to the version from http://www.mathworks.com/matlabcentral/fileexchange/20652 as well

1.4

* Bugfix: free replaced by mxFree in assignmentsuboptimal2.c
* Wrapper for function munkres of Yi Cao (www.mathworks.com/matlabcentral/fileexchange/20328) included for algorithm comparison.

1.3

Only links added in help lines.

1.2

Only E-mail changed in html documentation.

1.1

Minor changes.

Update of contact information in documentation.

Bugfix: Please update if you do not use ONE_INDEXING in assignmentoptimal.c.

Bug in documentation corrected.

Bug Fix: Error occured when the distance matrix contained only zeros and infinite values.

MATLAB Release
MATLAB 6.5.1 (R13SP1)

Download apps, toolboxes, and other File Exchange content using Add-On Explorer in MATLAB.

» Watch video