[0: About]

This library implements the Munkres' Assignment Algorithm in c++.
It is based on the c# version of Robert A. Pilgrim (see his implementation here).

Algorithm details can be found in the paper "Algorithms for Assignment and Transportation Problems" by James Munkres (March 1957).

[1: Changelog]

2013-04-22: libmunkres opensource project online

[2: Notes]

Because of the fixed size array implementation the maximum allowed
input matrix size is 30 x 30.

[3: Usage]

For a short demonstration how to use the library see the test.cpp file.

In order to use libmunkres in your own (CMake) projects the following code snippets might help you.
Add the following code to your CMakeLists File:

#munk resolver
PKG_CHECK_MODULES(MUNKRES REQUIRED libmunkres>=0.1)
IF (MUNKRES_FOUND)
  MESSAGE("Using libmunkres version ${MUNKRES_VERSION} from ${MUNKRES_PREFIX}")
ELSE (MUNKRES_FOUND)
  message(FATAL_ERROR "Error: Cannot find libmunkres")
ENDIF (MUNKRES_FOUND)

...

LINK_DIRECTORIES(... ${MUNKRES_LIBRARY_DIRS} ...)
INCLUDE_DIRECTORIES( ... ${MUNKRES_INCLUDE_DIRS} ...)

...

ADD_EXECUTABLE( xyz main.cpp )
TARGET_LINK_LIBRARIES(  xyz ... ${MUNKRES_LIBRARIES})

[4: Download / SVN checkout]

In order to check out & build the latest version simply check it out using svn:

svn co https://opensource.cit-ec.de/svn/libmunkres/trunk/ libmunkres

[5: Compiling]

Aftre checking out the source code (see above) you can compile the library:
This library uses a standard CMake file. So the installation procedure is:

.../libmunkres> mkdir build
.../libmunkres> cd build
.../libmunkres> cmake .. 
             (you might want to set -DCMAKE_INSTALL_PREFIX=/my/prefix)
.../libmunkres> make
.../libmunkres> make install

For testing purposes you might call ./munkres_test