assignment

package module
v0.2.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 23, 2019 License: MIT Imports: 0 Imported by: 0

README

Hungarian Algorithm

Forked from: https://github.com/oddg/hungarian-algorithm

An implementation of the Hungarian Algorithm for solving the assignment problem. The implementation follows those notes and runs in O(n^3).

Documentation

See godoc.

License

This project is under the MIT License. See the LICENSE file for the full license text.

Documentation

Index

Examples

Constants

This section is empty.

Variables

This section is empty.

Functions

func Solve

func Solve(n int, costs []float64) []int

Solve returns the solution as a slice `a` such that each row `i` is matched to column `a[i]`.

Example
a := []weight{
	11, 6, 12,
	12, 4, 6,
	8, 12, 11,
}
fmt.Println(Solve(3, a))
Output:
[1 2 0]

func SolveMax

func SolveMax(n int, costs []float64) []int

SolveMax returns a maximum solution. NOTE: currently this modifies the costs in-place.

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL