Skip to content
forked from clyphub/munkres

an implementation of the Hungarian algorithm

License

Notifications You must be signed in to change notification settings

jasonpfox/munkres

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 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

Pull requests welcome!

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

 
 
 

Languages

  • Go 100.0%