--- id: lapx version: "0.9.4" license: MIT license_treatment: permissive maintenance: active --- # lapx — Linear assignment problem solvers, including single and batch solvers. License: permissive · Maintenance: active · Downloads: 727.9K/mo ## What it is and what it does lapx is a linear assignment problem solver package that evolved from maintaining an earlier lap package. It implements Jonker-Volgenant algorithms optimized for both dense (LAPJV) and sparse (LAPMOD) cost matrices, solving the problem of finding optimal one-to-one assignments between two sets of items to minimize total cost. The package supports square and rectangular matrices, single-problem and batch processing, and offers multiple output formats to match different downstream use cases. The core solver functions are based on academic papers and public-domain implementations. lapx provides lapjv, lapmod, lapjvx (SciPy-style output), lapjvxa (direct assignment array output), lapjvc (optimized for square matrices), lapjvs and lapjvsa (sparse variants), and batch versions of each. It depends only on numpy and is available as pre-built wheels for Python 3.7 through 3.14 across macOS, Linux, Windows, and ARM architectures, with optional performance tuning via environment variables during source builds. Use it for: - Object tracking: match detected objects across video frames by minimizing distance or appearance cost. - Bipartite graph matching: find optimal pairings between two sets of nodes in applications like job scheduling or resource allocation. - Data association: assign sensor measurements to tracked targets in multi-object tracking systems. - Batch processing: solve multiple assignment problems in parallel using batch solver functions. - Rectangular assignment: handle cases where the number of rows and columns differ, extending costs as needed. ## Worth the install? AI-flagged interpretation of the facts above — verify before relying. Solves linear assignment problems using Jonker-Volgenant and related algorithms, supporting single and batch operations on square and rectangular cost matrices. Yes. lapx is actively maintained, has no known vulnerabilities, and offers a stable, performant implementation of linear assignment solvers with multiple output formats and batch support. Install it if you need to solve assignment problems and want more flexibility or batch processing capabilities. The requirement not to install both lap and lapx simultaneously is a minor gotcha but well-documented. ## Install pip install lapx uv add lapx poetry add lapx ## Installing lapx Before you install: Medium install friction due to compiled wheels; pre-built binaries cover Python 3.10–3.14 and major platforms (macOS, Linux, Windows, ARM), reducing build overhead. Active maintenance with recent releases and no reported vulnerabilities. License in practice: MIT license permits unrestricted use, modification, and distribution in commercial and private projects with minimal attribution requirements. Quickstart: pip install lapx import numpy as np import lapx cost_matrix = np.random.rand(100, 150) total_cost, row_indices, col_indices = lapx.lapjvx(cost_matrix, extend_cost=True, return_cost=True) assignments = np.column_stack((row_indices, col_indices)) Requires numpy; import name is lapx; do not install both lap and lapx simultaneously as they provide the same import namespace. Verify before relying: - Performance comparison to scipy.optimize.linear_sum_assignment and other LAP solvers under typical workloads. - Numerical stability guarantees or known edge cases (e.g., degenerate cost matrices, very large or very small values). - Memory usage characteristics for batch operations on large matrices. ## Package facts - License: MIT (permissive) - Python support: supports_current - Install friction: medium - Maintenance: active - Downloads: 727.9K/month (top 15,000 on PyPI) - Known vulnerabilities: none known ## Tags linear assignment problem solver, jonker-volgenant algorithm, lapjv lapmod, optimal matching algorithm, cost matrix assignment, batch assignment solver, hungarian algorithm alternative, optimization, matching-algorithm, batch-processing [View on SkillFed](https://skillfed.io/packages/lapx) · [View on PyPI](https://pypi.org/project/lapx/)