Skip to content

clyphub/munkres

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

munkres

an implementation of the Hungarian algorithm

This code is heavily based on Bob Pilgrim's work outlined here.

Example

m := NewMatrix(4)
m.A = []int64{94, 93, 20, 37,
        75, 18, 71, 43,
        20, 29, 32, 25,
        37, 72, 17, 73}
fmt.Println(ComputeMunkresMin(m)) // [{0 3} {1 1} {2 0} {3 2}]

The assignment set which minimizes the total utility is:

(0, 3) = 37
(1, 1) = 18
(2, 0) = 20
(3, 2) = 17
       = 92

License

see LICENSE file

Author(s)

Brian Fallik - bfallik at clypd.com

Dependencies

This packages uses stretchr/testify for help with unit test assertions.

Development

We are no longer actively maintaining this package. Please fork it if you wish to develop it further.

Other

Thanks to clypd for agreeing to release this code into the wild.

clypd

About

an implementation of the Hungarian algorithm

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages