Project

munkres_ru

0.0
Repository is archived
No commit activity in last 3 years
No release in over 3 years
Kuhn-Munkres implemented in Rust
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
2025
2026
 Dependencies

Development

~> 1.12
~> 10.0
~> 3.0
 Project Readme

Kuhn-Munkres in Rust as a Ruby gem

This is a wrapper of https://github.com/mneumann/munkres-rs for Ruby.

Usage

Add to your Gemfile

gem 'munkres_ru'

Then you can do:

problem = [
  [1.0, 1.0, 1.0, 1.0, 1.0],
  [1.0, 1.0, 1.0, 1.0, 1.0],
  [1.0, 1.0, 1.0, 1.0, 1.0],
  [0.0, 0.0, 0.0, 0.0, 0.0],
  [0.0, 0.0, 0.0, 0.0, 0.0]
]
solution = MunkresRu.solve(problem)

# => [[0, 0], [1, 1], [2, 2], [3, 3], [4, 4]]

Note: only square matrixes are handled.

Building

Install Rust and Cargo; then run

$ rake compile
$ rake spec

Build the Ruby gem with

$ rake build