hungarianAlgorithm

package module
v0.0.0-...-9567cbc Latest Latest
Warning

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

Go to latest
Published: Aug 9, 2017 License: MIT Imports: 2 Imported by: 7

README

Hungarian Algorithm

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

Usage

package main

import (
	"fmt"
	"github.com/oddg/hungarian-algorithm"
)

func main() {
	a := [][]int{{11, 6, 12}, {12, 4, 6}, {8, 12, 11}}
	fmt.Println(hungarianAlgorithm.Solve(a))
}

License

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Solve

func Solve(costs [][]int) ([]int, error)

Returns the solution as an array `a` such that each row `i` is matched to column `a[i]`

Types

This section is empty.

Jump to

Keyboard shortcuts

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