{"id":27881780,"url":"https://github.com/src-d/lapjv","last_synced_at":"2025-09-07T15:43:18.833Z","repository":{"id":15577579,"uuid":"78374635","full_name":"src-d/lapjv","owner":"src-d","description":"Linear Assignmment Problem solver using Jonker-Volgenant algorithm - Python 3 native module.","archived":false,"fork":false,"pushed_at":"2024-07-19T09:37:08.000Z","size":315,"stargazers_count":266,"open_issues_count":11,"forks_count":30,"subscribers_count":10,"default_branch":"master","last_synced_at":"2025-09-03T03:37:36.512Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"C++","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/src-d.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2017-01-08T22:28:02.000Z","updated_at":"2025-09-02T21:07:46.000Z","dependencies_parsed_at":"2023-02-13T00:46:25.985Z","dependency_job_id":"8da1a22e-cd36-4d45-b083-1566f1cd3ad7","html_url":"https://github.com/src-d/lapjv","commit_stats":{"total_commits":81,"total_committers":6,"mean_commits":13.5,"dds":0.6419753086419753,"last_synced_commit":"162474a77b8b02d183af79d406cbdf668b5beb06"},"previous_names":[],"tags_count":35,"template":false,"template_full_name":null,"purl":"pkg:github/src-d/lapjv","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/src-d%2Flapjv","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/src-d%2Flapjv/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/src-d%2Flapjv/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/src-d%2Flapjv/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/src-d","download_url":"https://codeload.github.com/src-d/lapjv/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/src-d%2Flapjv/sbom","scorecard":{"id":843542,"data":{"date":"2025-08-11","repo":{"name":"github.com/src-d/lapjv","commit":"ba122252b8cfc955bd68ceeb6a54d6608343568b"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":3.9,"checks":[{"name":"Code-Review","score":2,"reason":"Found 5/20 approved changesets -- score normalized to 2","details":null,"documentation":{"short":"Determines if the project requires human code review before pull requests (aka merge requests) are merged.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#code-review"}},{"name":"Maintained","score":0,"reason":"0 commit(s) and 1 issue activity found in the last 90 days -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project is \"actively maintained\".","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#maintained"}},{"name":"Dangerous-Workflow","score":10,"reason":"no dangerous workflow patterns detected","details":null,"documentation":{"short":"Determines if the project's GitHub Action workflows avoid dangerous patterns.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#dangerous-workflow"}},{"name":"Binary-Artifacts","score":10,"reason":"no binaries found in the repo","details":null,"documentation":{"short":"Determines if the project has generated executable (binary) artifacts in the source repository.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#binary-artifacts"}},{"name":"Token-Permissions","score":0,"reason":"detected GitHub workflow tokens with excessive permissions","details":["Warn: no topLevel permission defined: .github/workflows/push.yml:1","Warn: no topLevel permission defined: .github/workflows/release.yml:1","Info: no jobLevel write permissions found"],"documentation":{"short":"Determines if the project's workflows follow the principle of least privilege.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#token-permissions"}},{"name":"Pinned-Dependencies","score":0,"reason":"dependency not pinned by hash detected -- score normalized to 0","details":["Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/push.yml:22: update your workflow using https://app.stepsecurity.io/secureworkflow/src-d/lapjv/push.yml/master?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/push.yml:24: update your workflow using https://app.stepsecurity.io/secureworkflow/src-d/lapjv/push.yml/master?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/push.yml:55: update your workflow using https://app.stepsecurity.io/secureworkflow/src-d/lapjv/push.yml/master?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/push.yml:57: update your workflow using https://app.stepsecurity.io/secureworkflow/src-d/lapjv/push.yml/master?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/push.yml:61: update your workflow using https://app.stepsecurity.io/secureworkflow/src-d/lapjv/push.yml/master?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/push.yml:84: update your workflow using https://app.stepsecurity.io/secureworkflow/src-d/lapjv/push.yml/master?enable=pin","Warn: third-party GitHubAction not pinned by hash: .github/workflows/push.yml:90: update your workflow using https://app.stepsecurity.io/secureworkflow/src-d/lapjv/push.yml/master?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/release.yml:48: update your workflow using https://app.stepsecurity.io/secureworkflow/src-d/lapjv/release.yml/master?enable=pin","Warn: third-party GitHubAction not pinned by hash: .github/workflows/release.yml:50: update your workflow using https://app.stepsecurity.io/secureworkflow/src-d/lapjv/release.yml/master?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/release.yml:56: update your workflow using https://app.stepsecurity.io/secureworkflow/src-d/lapjv/release.yml/master?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/release.yml:66: update your workflow using https://app.stepsecurity.io/secureworkflow/src-d/lapjv/release.yml/master?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/release.yml:68: update your workflow using https://app.stepsecurity.io/secureworkflow/src-d/lapjv/release.yml/master?enable=pin","Warn: third-party GitHubAction not pinned by hash: .github/workflows/release.yml:77: update your workflow using https://app.stepsecurity.io/secureworkflow/src-d/lapjv/release.yml/master?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/release.yml:16: update your workflow using https://app.stepsecurity.io/secureworkflow/src-d/lapjv/release.yml/master?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/release.yml:19: update your workflow using https://app.stepsecurity.io/secureworkflow/src-d/lapjv/release.yml/master?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/release.yml:26: update your workflow using https://app.stepsecurity.io/secureworkflow/src-d/lapjv/release.yml/master?enable=pin","Warn: pipCommand not pinned by hash: .github/workflows/push.yml:32","Warn: pipCommand not pinned by hash: .github/workflows/push.yml:69","Warn: pipCommand not pinned by hash: .github/workflows/push.yml:70","Warn: pipCommand not pinned by hash: .github/workflows/push.yml:71","Warn: pipCommand not pinned by hash: .github/workflows/release.yml:23","Info:   0 out of  13 GitHub-owned GitHubAction dependencies pinned","Info:   0 out of   3 third-party GitHubAction dependencies pinned","Info:   0 out of   5 pipCommand dependencies pinned"],"documentation":{"short":"Determines if the project has declared and pinned the dependencies of its build process.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#pinned-dependencies"}},{"name":"CII-Best-Practices","score":0,"reason":"no effort to earn an OpenSSF best practices badge detected","details":null,"documentation":{"short":"Determines if the project has an OpenSSF (formerly CII) Best Practices Badge.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#cii-best-practices"}},{"name":"Security-Policy","score":0,"reason":"security policy file not detected","details":["Warn: no security policy file detected","Warn: no security file to analyze","Warn: no security file to analyze","Warn: no security file to analyze"],"documentation":{"short":"Determines if the project has published a security policy.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#security-policy"}},{"name":"Fuzzing","score":0,"reason":"project is not fuzzed","details":["Warn: no fuzzer integrations found"],"documentation":{"short":"Determines if the project uses fuzzing.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#fuzzing"}},{"name":"License","score":10,"reason":"license file detected","details":["Info: project has a license file: LICENSE:0","Info: FSF or OSI recognized license: MIT License: LICENSE:0"],"documentation":{"short":"Determines if the project has defined a license.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#license"}},{"name":"Packaging","score":10,"reason":"packaging workflow detected","details":["Info: Project packages its releases by way of GitHub Actions.: .github/workflows/release.yml:61"],"documentation":{"short":"Determines if the project is published as a package that others can easily download, install, easily update, and uninstall.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#packaging"}},{"name":"Signed-Releases","score":-1,"reason":"no releases found","details":null,"documentation":{"short":"Determines if the project cryptographically signs release artifacts.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#signed-releases"}},{"name":"Vulnerabilities","score":9,"reason":"1 existing vulnerabilities detected","details":["Warn: Project is vulnerable to: PYSEC-2023-102"],"documentation":{"short":"Determines if the project has open, known unfixed vulnerabilities.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#vulnerabilities"}},{"name":"Branch-Protection","score":0,"reason":"branch protection not enabled on development/release branches","details":["Warn: branch protection not enabled for branch 'master'"],"documentation":{"short":"Determines if the default and release branches are protected with GitHub's branch protection settings.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#branch-protection"}},{"name":"SAST","score":0,"reason":"SAST tool is not run on all commits -- score normalized to 0","details":["Warn: 0 commits out of 18 are checked with a SAST tool"],"documentation":{"short":"Determines if the project uses static code analysis.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#sast"}}]},"last_synced_at":"2025-08-23T20:58:16.385Z","repository_id":15577579,"created_at":"2025-08-23T20:58:16.386Z","updated_at":"2025-08-23T20:58:16.386Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":274058944,"owners_count":25215200,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-09-07T02:00:09.463Z","response_time":67,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2025-05-05T05:05:06.192Z","updated_at":"2025-09-07T15:43:18.760Z","avatar_url":"https://github.com/src-d.png","language":"C++","readme":"[![Build Status](https://github.com/src-d/lapjv/workflows/Push/badge.svg?branch=master)](https://github.com/src-d/lapjv/actions) [![PyPI](https://img.shields.io/pypi/v/lapjv.svg)](https://pypi.python.org/pypi/lapjv)\n\nLinear Assignment Problem solver using Jonker-Volgenant algorithm\n==================================================================\n\nThis project is the rewrite of [pyLAPJV](https://github.com/hrldcpr/pyLAPJV) which\nsupports Python 3 and updates the core code. The performance is twice as high as\nthe original thanks to the optimization of the augmenting row reduction phase\nusing Intel AVX2 intrinsics. It is a native Python 3 module and does\nnot work with Python 2.x, stick to pyLAPJV otherwise.\n\n[![Blog post](doc/mapping.png)](http://web.archive.org/web/20180611012448/https://blog.sourced.tech/post/lapjv//)\n\n[Linear assignment problem](https://en.wikipedia.org/wiki/Assignment_problem)\nis the bijection between two sets with equal cardinality which optimizes the sum\nof the individual mapping costs taken from the fixed cost matrix. It naturally\narises e.g. when we want to fit [t-SNE](https://lvdmaaten.github.io/tsne/) results\ninto a rectangular regular grid.\nSee this awesome notebook for the details about why LAP matters:\n[CloudToGrid](https://github.com/kylemcdonald/CloudToGrid/blob/master/CloudToGrid.ipynb).\n\nJonker-Volgenant algorithm is described in the paper:\n\nR. Jonker and A. Volgenant, \"A Shortest Augmenting Path Algorithm for Dense and Sparse Linear Assignment Problems,\" _Computing_, vol. 38, pp. 325-340, 1987.\n\nThis paper is not publicly available though a brief description exists on\n[sciencedirect.com](http://www.sciencedirect.com/science/article/pii/S0166218X99001729).\nJV is faster in than the [Hungarian algorithm](https://en.wikipedia.org/wiki/Hungarian_algorithm) in practice,\nthough the complexity is the same - O(n\u003csup\u003e3\u003c/sup\u003e).\n\nThe C++ source of the algorithm comes from http://www.magiclogic.com/assignment.html\nIt has been reworked and partially optimized with OpenMP 4.0 SIMD.\n\nInstalling\n----------\n```\npip3 install lapjv\n```\nTested on Linux and Windows. *macOS is not supported, please do not report macOS build errors in the issues.*\nFeel free to PR macOS support, but I warn that it will be a rough ride.\n\nUsage\n-----\nRefer to [test.py](test.py) for the complete code.\n\n```\nfrom lapjv import lapjv\nrow_ind, col_ind, _ = lapjv(cost_matrix)\n```\n\nThe assignment matrix by row is `row_ind`: the value at n-th place is the assigned column index to the n-th row.\n`col_ind` is the reverse of `row_ind`: mapping from columns to row indexes.\n\nNote: a bijection is only possible for sets with equal cardinality. If you need to map A vectors to B vectors,\nderive the square symmetric (A+B) x (A+B) matrix: take the first A rows and columns from A and\nthe remaining [A..A+B] rows and columns from B. Set the A-\u003eA and B-\u003eB costs to some maximum distance value,\nbig enough so that you don't see assignment errors.\n\nIllegal instruction\n-------------------\n\nThis error appears if your CPU does not support the AVX2 instruction set. We do not ship builds for different CPUs so you need to build the package yourself:\n\n```\npip3 install git+https://github.com/src-d/lapjv\n```\n\nNAN-s\n-----\n\nNAN-s in the cost matrix lead to completely undefined result. It is the caller's responsibility to check them.\n\nLicense\n-------\nMIT Licensed,see [LICENSE](LICENSE)\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsrc-d%2Flapjv","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsrc-d%2Flapjv","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsrc-d%2Flapjv/lists"}