Skip to content

Commit 42aeffb

Browse files
committed
update README
1 parent 3d40124 commit 42aeffb

1 file changed

Lines changed: 40 additions & 26 deletions

File tree

README.md

Lines changed: 40 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -1,46 +1,60 @@
1-
2-
# fastlap
1+
# **fastlap**
32

43
**Python’s LAP (Linear Assignment Problem) solver — written in Rust for performance.**
54

6-
`fastlap` provides a blazing-fast implementation of common assignment algorithms such as:
5+
`fastlap` delivers a blazing-fast implementation of popular assignment algorithms, including:
76

8-
- Jonker-Volgenant (LAPJV)
9-
- Hungarian (a.k.a. Munkres)
7+
* **Jonker–Volgenant (LAPJV)**
8+
* **Hungarian (a.k.a. Munkres)**
9+
* **LAPMOD**
1010

11-
Built with [Rust](https://www.rust-lang.org/) and exposed to Python via [PyO3](https://pyo3.rs), this library offers performance and interoperability in one package.
11+
Built with [Rust](https://www.rust-lang.org/) and exposed to Python via [PyO3](https://pyo3.rs), `fastlap` combines performance and interoperability in a single lightweight package.
1212

1313

14-
## ✨ Features
14+
## 📖 Algorithms
1515

16-
- ✅ Fast and memory-safe implementation in Rust
17-
- ✅ Python bindings via PyO3
18-
- ✅ Supports both `lapjv` and `hungarian` algorithms
19-
- ✅ Can be used in native Rust projects or as a Python package
16+
* **LAPJV** — Efficient dual-based shortest augmenting path algorithm
17+
*(Jonker & Volgenant, 1987)*
18+
* **Hungarian Algorithm** — Classic method using row/column reduction and assignment phases
19+
* **LAPMOD** — A modified variant for better performance under specific conditions
2020

2121

22-
## 📖 Algorithms
22+
## 🚀 Usage
2323

24-
* **LAPJV** – Efficient dual-based shortest augmenting path algorithm (Jonker & Volgenant, 1987)
25-
* **Hungarian** – Classic method with row/column reduction and assignment phases
24+
```python
25+
import fastlap
2626

27-
## Roadmap
27+
# Example cost matrix
28+
matrix = [
29+
[1, 2, 3],
30+
[4, 5, 6],
31+
[7, 8, 9]
32+
]
2833

29-
- [ ] Release first version
30-
- [ ] Add more algorithms
31-
- [ ] Add more features
32-
- [ ] Add more examples
33-
- [ ] Add more tests
34-
- [ ] Add more benchmarks
34+
# Solve the LAP using LAPJV algorithm
35+
cost, row_assign, col_assign = fastlap.solve_lap(matrix, method="lapjv")
3536

37+
print("Total cost:", cost)
38+
print("Row assignments:", row_assign)
39+
print("Column assignments:", col_assign)
40+
```
3641

37-
## 📚 References
3842

39-
* Jonker, R., & Volgenant, A. (1987). *A shortest augmenting path algorithm for dense and sparse linear assignment problems*. Computing, 38(4), 325–340.
40-
* Munkres, J. (1957). *Algorithms for the Assignment and Transportation Problems*. Journal of the Society for Industrial and Applied Mathematics.
43+
## 📄 Citation
4144

45+
If you use `fastlap` in your research or project, please cite the following:
46+
47+
```
48+
@misc{fastlap2025,
49+
author = {Le Duc Minh},
50+
title = {fastlap: A Python LAP solver powered by Rust},
51+
year = {2025},
52+
howpublished = {\url{https://github.com/8Opt/fastlap}},
53+
note = {Python-Rust LAP solver implementing LAPJV, Hungarian, and LAPMOD}
54+
}
55+
```
4256

43-
## 📃 License
4457

45-
MIT License © 2025
58+
## 📃 License
4659

60+
**MIT License** © 2025 — use it freely in commercial or open-source projects.

0 commit comments

Comments
 (0)