About Site Map Submit Contact Us Log in | Create an account
Create an account Log In
Average Rating
User Rating:
Visitors Rating:
My rating:

Write review
  • License: Freeware
  • Last update: 6 years ago
  • Total downloads: 143
  • Price: Free |
  • Operating system: Linux, Mac OS X, Win All, BSD, Solaris
  • Publisher: Nedialko I. Krouchev
See full specifications

scripts default iconbghungar (Scripts) Publisher's description

"Hungarian algorithm" to solve the square assignment problem (original & pure MATLAB implementation)

"Hungarian algorithm" to solve the square assignment problem (original & pure MATLAB implementation). The Hungarian algorithm can also be used as a sub-solver in a B&B solver for the travelling salesman problem.

How to match N (e.g. N=6) pairs of signals from 2 experiments? Build full reordering lists based on the PERMS(1:N) MATLAB function? But the complexity of this approach would be N! = prod(1:6) = 720 for a single run! That of the Hungarian algorithm is just N^3 = 6^3 = 216
i.e. it is many times more efficient!

This code is similar in purpose to the central part of assignprob: hungarian.m, v1.0 96-06-14, adapted by Niclas Borlin, niclas@cs.umu.se.
Unlike latter code which is an adaptation from a 1980 ACM algorithm in Fortran IV, this is original code written directly according to [1], and specially for MATLAB (and very portable across different R's of MATLAB). It has only few, hence efficient lines.

В» help bghungar

BGHUNGAR "Hungarian algorithm" to solve the square assignment problem

C = a square profit/cost matrix.

the call:
[izSol, ifail, D] = bghungar(C);


izSol = the optimal assignment: MAXIMIZES total profit

ifail = 0: success;
> 0: various failure triggers, according to the algorithm's sub-section

D = the square matrix equivalent to C at the end of iteration [1]

*** Notes:
1) For assignments that MINIMIZE cost, just invert
the sign of the cost matrix:
... = bghungar(-C);

2) Coding decisions are annotated, and debugging commands are provided
(just remove the comments) to resolve intricate use cases.

System Requirements:

MATLAB 5.3 (R11)
Program Release Status: Major Update
Program Install Support: Install and Uninstall

Is bghungar (Scripts) your software?

Manage your software

Most Popular

scripts default icon ASK, OOK, FSK, BPSK, QPSK, 8PSK modulation 1.1
ASK, OOK, FSK, BPSK, QPSK, 8PSK modulation contain several functions for digital modulation simulation
scripts default icon Simulink Communication Labs 1.1
Simulink Communication Labs allows you to learn communication systems in greater depth.
scripts default icon M-QAM modulation and demodulation 1.1
M-QAM modulation and demodulation is the QAM modulation and demodulation tech.
scripts default icon LZW Compression/Decompression 1.1
LZW Compression/Decompression - Updated LZW compressor and decompressor with reasonable performance
scripts default icon InSPIRE utility to plot a 2D displacement field (Scripts) 1.0
This program plots the deformation field (displace vectors) contained in vector.txt.