https://github.com/i10416/munkres
Munkres(Hangarian) Algorithm Implimentation for Scala
https://github.com/i10416/munkres
assignment-problem optimization scala
Last synced: 17 days ago
JSON representation
Munkres(Hangarian) Algorithm Implimentation for Scala
- Host: GitHub
- URL: https://github.com/i10416/munkres
- Owner: i10416
- Created: 2021-07-30T09:23:06.000Z (almost 4 years ago)
- Default Branch: master
- Last Pushed: 2023-06-04T06:22:04.000Z (almost 2 years ago)
- Last Synced: 2025-04-09T02:12:11.009Z (about 1 month ago)
- Topics: assignment-problem, optimization, scala
- Language: Scala
- Homepage:
- Size: 72.3 KB
- Stars: 6
- Watchers: 1
- Forks: 1
- Open Issues: 13
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
[](https://github.com/i10416/munkres/actions/workflows/release.yml)
| scala 3 JVM | scala 3 JS|
|---|---|
|[](https://search.maven.org/artifact/dev.i10416/munkres_3)|[](https://search.maven.org/artifact/dev.i10416/munkres_sjs1_3)|## Munkres(Hangarian) Algorithm Implimentation for Scala 3
> The Hungarian method is a combinatorial optimization algorithm that solves the assignment problem in polynomial time and which anticipated later primal–dual methods. It was developed and published in 1955 by Harold Kuhn, who gave the name "Hungarian method" because the algorithm was largely based on the earlier works of two Hungarian mathematicians: Dénes Kőnig and Jenő Egerváry.
>
> https://en.wikipedia.org/wiki/Hungarian_algorithm## Install
`Munkres` currently supports only Scala 3.
```scala
scalaVersion := "3.x.x"libraryDependencies ++= Seq(
"dev.i10416" %% "munkres" % "0.0.2"
)
```
## Usage```scala
import Munkres.*
val matrix = Array(
Array(5.0, 4.0, 7, 6.0),
Array(6.0, 7.0, 3.0, 2),
Array(8,11, 2.0, 5),
Array(9, 8, 6.0, 7))
)
Munkres.minimize(matrix)
// => List((2,2), (0,1), (3,0), (1,3))
Munkres.cost(matrix)
// 17
```## How to contribute?
- Give it a star⭐
- Drop the feedback to the author @i10416
- Send a PR with fixes of typos/bugs/etc🐛## License
Licensed under the Apache License, Version 2.0.