Skip to content
This repository has been archived by the owner on May 2, 2023. It is now read-only.

Latest commit

 

History

History
35 lines (24 loc) · 947 Bytes

README.md

File metadata and controls

35 lines (24 loc) · 947 Bytes

Hume

Build Status

This project implements the Hungarian method solver.

It can handle not balanced cost matrix and is prepared for minimization and maximization.

Installation

You can use the Swift Package Manager to install HungarianSolver by adding the proper description to your Package.swift file:

import PackageDescription

let package = Package(
    name: "YOUR_PROJECT_NAME",
    targets: [],
    dependencies: [
        .package(url: "https://github.com/Jasagredo/Hume.git", from: "0.0.5"),
    ]
)

Usage

Once the Hume class is imported, just declare a solver and ask for a solution. The algorithm runs in O(n^4).

var h = HunSolver(matrix: mat)
print(h.solve())

License

HungarianSolver is under MIT license. Check LICENSE for more details.