{"id":32191881,"url":"https://github.com/ageneau/blossom","last_synced_at":"2025-10-22T01:53:05.941Z","repository":{"id":55022397,"uuid":"189361628","full_name":"ageneau/blossom","owner":"ageneau","description":"Edmonds's blossom algorithm for maximum weight matching in undirected graphs","archived":false,"fork":false,"pushed_at":"2021-01-14T22:39:39.000Z","size":127,"stargazers_count":18,"open_issues_count":0,"forks_count":1,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-09-21T16:52:16.347Z","etag":null,"topics":["clojure","clojurescript","graph-algorithms"],"latest_commit_sha":null,"homepage":null,"language":"Clojure","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/ageneau.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2019-05-30T06:51:11.000Z","updated_at":"2024-07-29T15:43:26.000Z","dependencies_parsed_at":"2022-08-14T09:20:25.080Z","dependency_job_id":null,"html_url":"https://github.com/ageneau/blossom","commit_stats":null,"previous_names":[],"tags_count":5,"template":false,"template_full_name":null,"purl":"pkg:github/ageneau/blossom","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ageneau%2Fblossom","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ageneau%2Fblossom/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ageneau%2Fblossom/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ageneau%2Fblossom/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ageneau","download_url":"https://codeload.github.com/ageneau/blossom/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ageneau%2Fblossom/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":280365582,"owners_count":26318385,"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-10-21T02:00:06.614Z","response_time":58,"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":["clojure","clojurescript","graph-algorithms"],"created_at":"2025-10-22T01:53:03.152Z","updated_at":"2025-10-22T01:53:05.937Z","avatar_url":"https://github.com/ageneau.png","language":"Clojure","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Edmonds's blossom algorithm for maximum weight matching in undirected graphs\n\nThis library implements the Blossom algorithm that computes a maximum weighted matching of an undirected graph in O(number of nodes ** 3).\n\nIt was ported from the python code authored by Joris van Rantwijk included in the NetworkX graph library and modified.\n\n## Getting started\n\nAdd the necessary dependencies to your project:\n\n```clojure\n[ageneau/blossom \"0.1.4\"]\n[aysylu/loom \"1.0.2\"]\n```\n\n## Usage\n\n\n```clojure\n(ns test.blossom\n  (:require [blossom.max-weight-matching :as mwm]\n            [blossom.matching :as m]\n            [loom.graph :as lg]))\n \n(def edges [[1 2 2][1 3 -2][2 3 1][2 4 -1][3 4 -6]])\n(def g (-\u003e (lg/weighted-graph) (lg/add-edges* edges)))\n\n;; Compute a maximum weigted matching\n(def maxw-matching (mwm/max-weight-matching edges))\n;; =\u003e #{#{1 2}}\n\n;; Compute the maximum-cardinality matching with maximum weight among all\n;; maximum-cardinality matchings.\n(def maxc-matching (mwm/max-weight-matching edges {:max-cardinality true}))\n;; =\u003e #{#{4 2} #{1 3}}\n\n;; Compute a maximal matching (not necessarily max weight)\n(def max-matching (m/maximal-matching g))\n;; =\u003e #{#{4 3} #{1 2}}\n\n(m/is-matching? g maxw-matching)\n;; =\u003e true\n\n(m/is-maximal-matching? g maxw-matching)\n;; =\u003e false\n\n(m/is-maximal-matching? g maxc-matching)\n;; =\u003e true\n\n(m/is-maximal-matching? g max-matching)\n;; =\u003e true\n\n\n```\n\n## Unit tests\n\nSome unit tests are auto-generated by instrumenting the python code which this project is based on running the python unit tests and outputting internal data to JSON which is then compared to the equivalent Clojure data structures.\n\nThe JSON data for these unit tests can be generated doing:\n\n```\nmake -C python\n```\n\nTo run the Clojure unit tests:\n\n```\nlein do clean, test\n```\n\nTo run the Clojurescript unit tests:\n\n```\nlein do clean, doo node node-test once\n```\n\n\n## License\n\nCopyright \u0026copy; NetworkX developers.\nCopyright (C) 2004-2018 by\n    Aric Hagberg \u003chagberg@lanl.gov\u003e\n    Dan Schult \u003cdschult@colgate.edu\u003e\n    Pieter Swart \u003cswart@lanl.gov\u003e\n\nCopyright \u0026copy; 2008 by\n    Joris van Rantwijk.\n\nCopyright \u0026copy; 2011 by\n    Nicholas Mancuso \u003cnick.mancuso@gmail.com\u003e\n\nCopyright \u0026copy; 2018 Sylvain Ageneau\n\nAll rights reserved.\n\nThis project is licensed under the [BSD 3-Clause \"New\" or \"Revised\" License][license].\n\n[license]: https://opensource.org/licenses/BSD-3-Clause\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fageneau%2Fblossom","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fageneau%2Fblossom","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fageneau%2Fblossom/lists"}