Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/i10416/munkres
Munkres(Hangarian) Algorithm Implimentation for Scala
https://github.com/i10416/munkres
assignment-problem optimization scala
Last synced: about 2 months 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 (over 3 years ago)
- Default Branch: master
- Last Pushed: 2023-06-04T06:22:04.000Z (over 1 year ago)
- Last Synced: 2023-07-03T12:40:35.496Z (over 1 year 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
[![Release](https://github.com/i10416/munkres/actions/workflows/release.yml/badge.svg?branch=master)](https://github.com/i10416/munkres/actions/workflows/release.yml)
| scala 3 JVM | scala 3 JS|
|---|---|
|[![Maven Central](https://img.shields.io/maven-central/v/dev.i10416/munkres_3.svg)](https://search.maven.org/artifact/dev.i10416/munkres_3)|[![Maven Central](https://img.shields.io/maven-central/v/dev.i10416/munkres_sjs1_3.svg)](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.