Skip to content
/ LSAP Public

Implementation of the Hungarian Algorithm for Linear Sum Assignment Problems.

Notifications You must be signed in to change notification settings

FWsantos/LSAP

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

47 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

LSAP - (Linear Sum Assigment Problem)

Hungarian Algorithm for Linear Sum Assignment problems, implemented in C++. The algorithms in this part follow the algorithms presented in chapter 4 of Bukard.

This repository has:

  • Preprocessing phase to determine a feasible dual solution and a partial primal solution
  • Hungarian algorithm $O(n^4)$
  • ❗ Hungarian algorithm $O(n^3)$

NOTE: Items marked with ❗ have bugs or are not running correctly for larger instances.

How to build

This is a CMAKE project.

Example of how to build and run the project:

git clone git@github.com:FWsantos/LSAP.git
cd LSAP
mkdir build
cd build
cmake -DBUILD_DIR=build ..
make
./LSAP

How to test

The LSAP.h methods that are "Hungarian algorithms" all have the same parameters:

std::vector<std::vector<int>> C //matrix,
int n //matrix size

The Tests class has examples for each Hungarian implementation. main.cpp has the Tests class method calls, uncomment to test the function of your choice.

If you want to change the instance, the input files are in the file_inputs folder. Currently each test function tests only one instance of the problem. the path needs to be defined inline in Tests.h as the value of the const std::string file_path.

About

Implementation of the Hungarian Algorithm for Linear Sum Assignment Problems.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published