Crates.io | gap_solver |
lib.rs | gap_solver |
version | 0.2.0 |
source | src |
created_at | 2021-08-03 22:02:36.254292 |
updated_at | 2021-08-06 23:26:04.544392 |
description | A solver for the generalized assignment problem. |
homepage | |
repository | https://github.com/stinodego/gap_solver |
max_upload_size | |
id | 431228 |
size | 21,793 |
This crate provides an interface for specifying a generalized assignment problem, and an algorithm for finding the maximum assignment.
This code actually allows for further generalization, allowing multiple agents to perform a single task (regulated by a task budget).
Add this to your Cargo.toml
:
[dependencies]
gap_solver = "0.2.0"
Now, you can use the gap_solver
API:
use gap_solver::{solve, GapSpec};
Refer to the Rust docs for code examples.
The implementation is a simple depth-first search algorithm. Therefore, it does not work well for very large problems.
The depth-first search expands most promising nodes first. True maximum assignment is guaranteed when algorithm is allowed to complete. Otherwise, the assignment printed last may be used as a best guess.
Solving your assignment problem is easy. Just specify your assignment problem (refer to main.rs
for an example), then run it. An example problem specification is given, to make clear what syntax is expected.