Science Score: 13.0%
This score indicates how likely this project is to be science-related based on various indicators:
-
○CITATION.cff file
-
✓codemeta.json file
Found codemeta.json file -
○.zenodo.json file
-
○DOI references
-
○Academic publication links
-
○Committers with academic emails
-
○Institutional organization owner
-
○JOSS paper metadata
-
○Scientific vocabulary similarity
Low similarity (10.3%) to scientific vocabulary
Repository
Linear Assignment Problem solver (LAPJV/LAPMOD).
Basic Info
Statistics
- Stars: 236
- Watchers: 6
- Forks: 69
- Open Issues: 12
- Releases: 0
Metadata Files
README.md
lap: Linear Assignment Problem Solver
lap is a linear assignment
problem solver using
Jonker-Volgenant algorithm for dense LAPJV¹ or sparse LAPMOD² matrices. Both
algorithms are implemented from scratch based solely on the papers¹˒² and the
public domain Pascal implementation provided by A. Volgenant³. The LAPMOD
implementation seems to be faster than the LAPJV implementation for matrices
with a side of more than ~5000 and with less than 50% finite coefficients.
¹ R. Jonker and A. Volgenant, "A Shortest Augmenting Path Algorithm for
Dense and Sparse Linear Assignment Problems", Computing 38, 325-340 (1987)
² A. Volgenant, "Linear and Semi-Assignment Problems: A Core
Oriented Approach", Computer Ops Res. 23, 917-932 (1996)
³
http://www.assignmentproblems.com/LAPJV.htm |
[archive.org]
💽 Installation
Install from PyPI:
pip install lap
| Pre-built Wheels 🛞 | Windows ✅ | Linux ✅ | macOS ✅ | |:---:|:---:|:---:|:---:| | Python 3.7 | AMD64 | x8664/aarch64 | x8664 | | Python 3.8 | AMD64 | x8664/aarch64 | x8664/arm64 | | Python 3.9-3.13 ¹ | AMD64/ARM64 ² | x8664/aarch64 | x8664/arm64 |
¹ v0.5.12 supports both numpy 1.x and 2.x for Python 3.8-3.13. 🆕
² Windows ARM64 is experimental.
Other options
### Install from GitHub repo (requires C++ compiler): ``` pip install git+https://github.com/gatagat/lap.git ``` ### Build and install (requires C++ compiler): ``` git clone https://github.com/gatagat/lap.git cd lap pip install "setuptools>=67.8.0" pip install wheel build python -m build --wheel cd dist ```🧪 Usage
import lap
import numpy as np
print(lap.lapjv(np.random.rand(4, 5), extend_cost=True))
More details
### `cost, x, y = lap.lapjv(C)` The function `lapjv(C)` returns the assignment cost `cost` and two arrays `x` and `y`. If cost matrix `C` has shape NxM, then `x` is a size-N array specifying to which column each row is assigned, and `y` is a size-M array specifying to which row each column is assigned. For example, an output of `x = [1, 0]` indicates that row 0 is assigned to column 1 and row 1 is assigned to column 0. Similarly, an output of `x = [2, 1, 0]` indicates that row 0 is assigned to column 2, row 1 is assigned to column 1, and row 2 is assigned to column 0. Note that this function *does not* return the assignment matrix (as done by scipy's [`linear_sum_assignment`](https://docs.scipy.org/doc/scipy/reference/generated/scipy.optimize.linear_sum_assignment.html) and lapsolver's [`solve dense`](https://github.com/cheind/py-lapsolver)). The assignment matrix can be constructed from `x` as follows: ``` A = np.zeros((N, M)) for i in range(N): A[i, x[i]] = 1 ``` Equivalently, we could construct the assignment matrix from `y`: ``` A = np.zeros((N, M)) for j in range(M): A[y[j], j] = 1 ``` Finally, note that the outputs are redundant: we can construct `x` from `y`, and vise versa: ``` x = [np.where(y == i)[0][0] for i in range(N)] y = [np.where(x == j)[0][0] for j in range(M)] ```License
Released under the 2-clause BSD license, see LICENSE.
Copyright (C) 2012-2025, Tomas Kazmar
Contributors (in alphabetic order): - Benjamin Eysenbach - Léo Duret - Pieter Lenaerts - Raphael Reme - Ratha Siv - Robert Wen - Steven - Tom White - Tomas Kazmar - Wok
Owner
- Name: Tomas Kazmar
- Login: gatagat
- Kind: user
- Location: Vienna, AT
- Repositories: 9
- Profile: https://github.com/gatagat
GitHub Events
Total
- Issues event: 19
- Watch event: 24
- Delete event: 1
- Member event: 1
- Issue comment event: 47
- Push event: 10
- Pull request event: 14
- Fork event: 5
- Create event: 4
Last Year
- Issues event: 19
- Watch event: 24
- Delete event: 1
- Member event: 1
- Issue comment event: 47
- Push event: 10
- Pull request event: 14
- Fork event: 5
- Create event: 4
Committers
Last synced: over 2 years ago
Top Committers
| Name | Commits | |
|---|---|---|
| Tomas Kazmar | t****r@s****z | 80 |
| jenhaoyang | r****2@g****m | 2 |
| Tom White | t****m@s****m | 1 |
| Benjamin Eysenbach | e****h@g****m | 1 |
| Robert Wen | r****n@c****m | 1 |
Committer Domains (Top 20 + Academic)
Issues and Pull Requests
Last synced: 11 months ago
All Time
- Total issues: 43
- Total pull requests: 24
- Average time to close issues: about 1 year
- Average time to close pull requests: 5 months
- Total issue authors: 36
- Total pull request authors: 18
- Average comments per issue: 4.16
- Average comments per pull request: 0.79
- Merged pull requests: 10
- Bot issues: 0
- Bot pull requests: 0
Past Year
- Issues: 1
- Pull requests: 7
- Average time to close issues: 1 day
- Average time to close pull requests: 6 days
- Issue authors: 1
- Pull request authors: 4
- Average comments per issue: 4.0
- Average comments per pull request: 0.57
- Merged pull requests: 3
- Bot issues: 0
- Bot pull requests: 0
Top Authors
Issue Authors
- gatagat (6)
- truongkhaihoa1995 (2)
- Bram94 (2)
- jvlmdr (2)
- drimyus (1)
- dribnet (1)
- emanuele (1)
- rathaROG (1)
- dohieunghia2002 (1)
- kiufta (1)
- cheind (1)
- remram44 (1)
- xcTorres (1)
- therc (1)
- liu-mengyang (1)
Pull Request Authors
- gatagat (6)
- troycarlson (2)
- tlambert03 (2)
- jenhaoyang (2)
- johnnynunez (2)
- vlad-nn (2)
- ExDrag0n (2)
- cshimmin (2)
- assafmus (2)
- plenaerts (1)
- jvlmdr (1)
- dribnet (1)
- brunolnetto (1)
- ben-eysenbach (1)
- timwroge (1)
Top Labels
Issue Labels
Pull Request Labels
Packages
- Total packages: 7
-
Total downloads:
- pypi 340,358 last-month
- Total docker downloads: 7,990
-
Total dependent packages: 22
(may contain duplicates) -
Total dependent repositories: 676
(may contain duplicates) - Total versions: 11
- Total maintainers: 6
pypi.org: lap
Linear Assignment Problem solver (LAPJV/LAPMOD).
- Homepage: https://github.com/gatagat/lap
- Documentation: https://lap.readthedocs.io/
- License: BSD-2-Clause
-
Latest release: 0.5.12
published over 1 year ago
Rankings
Maintainers (1)
pypi.org: lap05
Linear Assignment Problem solver (LAPJV/LAPMOD).
- Homepage: https://github.com/gatagat/lap
- Documentation: https://lap05.readthedocs.io/
- License: BSD (2-clause)
-
Latest release: 0.5.1
published over 4 years ago
Rankings
alpine-edge: py3-lap
Linear Assignment Problem solver (LAPJV/LAPMOD)
- Homepage: https://github.com/gatagat/lap
- License: BSD-2-Clause
-
Latest release: 0.5.12-r0
published about 1 year ago
Rankings
Maintainers (1)
pypi.org: lap-sdist
Linear Assignment Problem solver (LAPJV/LAPMOD).
- Homepage: https://github.com/gatagat/lap
- Documentation: https://lap-sdist.readthedocs.io/
- License: BSD (2-clause)
-
Latest release: 0.5.dev0
published about 3 years ago
Rankings
Maintainers (1)
spack.io: py-lap
lap is a linear assignment problem solver using Jonker-Volgenant algorithm for dense (LAPJV) or sparse (LAPMOD) matrices.
- Homepage: https://github.com/gatagat/lap
- License: []
-
Latest release: 0.4.0
published over 4 years ago
Rankings
Maintainers (1)
conda-forge.org: lap
- Homepage: https://github.com/gatagat/lap
- License: BSD-2-Clause
-
Latest release: 0.4.0
published over 6 years ago
Rankings
alpine-v3.22: py3-lap
Linear Assignment Problem solver (LAPJV/LAPMOD)
- Homepage: https://github.com/gatagat/lap
- License: BSD-2-Clause
-
Latest release: 0.5.12-r0
published about 1 year ago