{"id":48024581,"url":"https://github.com/euxhenh/multiset-multicover","last_synced_at":"2026-04-04T13:49:39.718Z","repository":{"id":42179340,"uuid":"440840449","full_name":"euxhenh/multiset-multicover","owner":"euxhenh","description":"Multiset multicover using the extended greedy cover algorithm implemented in C++ and exposed to Python.","archived":false,"fork":false,"pushed_at":"2022-10-07T19:57:12.000Z","size":69,"stargazers_count":5,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-02-16T09:39:06.462Z","etag":null,"topics":["cover","cpp","multiset","python","set","set-cover","set-cover-problem"],"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/euxhenh.png","metadata":{"files":{"readme":"README.rst","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}},"created_at":"2021-12-22T11:49:04.000Z","updated_at":"2024-03-02T05:55:03.000Z","dependencies_parsed_at":"2022-09-10T02:11:21.766Z","dependency_job_id":null,"html_url":"https://github.com/euxhenh/multiset-multicover","commit_stats":null,"previous_names":["euxhenh/multiset_multicover"],"tags_count":6,"template":false,"template_full_name":null,"purl":"pkg:github/euxhenh/multiset-multicover","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/euxhenh%2Fmultiset-multicover","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/euxhenh%2Fmultiset-multicover/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/euxhenh%2Fmultiset-multicover/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/euxhenh%2Fmultiset-multicover/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/euxhenh","download_url":"https://codeload.github.com/euxhenh/multiset-multicover/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/euxhenh%2Fmultiset-multicover/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31402276,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-04T10:20:44.708Z","status":"ssl_error","status_checked_at":"2026-04-04T10:20:06.846Z","response_time":60,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"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":["cover","cpp","multiset","python","set","set-cover","set-cover-problem"],"created_at":"2026-04-04T13:49:39.523Z","updated_at":"2026-04-04T13:49:39.701Z","avatar_url":"https://github.com/euxhenh.png","language":"C++","readme":".. role:: python(code)\n   :language: python\n\nThis package implements the Greedy Cover algorithm for multisets\nin `C++` and exposes it to Python.\nGiven a universe of elements U, and a family of subsets F = {S1, ..., Sn}\nof U, the set cover problem asks to find the smallest number of sets in F\nsuch that every element of U appears in at least one such set.\nThis can be extended to a multicover problem, where we ask that\nevery element be included at least k sets. This in turn, can be extended\nto accomodate multisets, where each element in Si also has a given\nmultiplicity.\n\nThe set cover problem is NP hard. The best known algorithm\nis a greedy approach that iteratively selects the set with the largest\nnumber of elements that have not been covered yet. This algorithm\nhas a log(n)-approximation guarantee where n is the size of the largest set.\nThe same guarantee also applies to the multicover problem, as well as the\nmultiset multicover problem (n here corresponds to the size of the largest\nset, counting multiplicities).\n\nBasic Example\n________\n\nTo run the greedy cover algorithm, one needs to create a GreedyCoverInstance\nobject and add multisets to it. The coverage factor can be a single integer\nor a specific integer for each element in U.\nThe solution is a list of integers corresponding to the index of the sets\nincluded (in order of selection).\n\nNOTE: Make sure any numpy arrays are converted to lists by calling :python:`arr.tolist()`.\n\n    \u003e\u003e\u003e import multiset_multicover as mm\n\n    \u003e\u003e\u003e gci = mm.GreedyCoverInstance(4)\n    \u003e\u003e\u003e gci.add_multiset([1, 2, 3])  # if no multiplicity provided, it defaults to 1\n    \u003e\u003e\u003e gci.add_multiset([0, 1, 2], multiplicity=[2, 3, 1])\n    \u003e\u003e\u003e gci.add_multiset([0, 1, 2, 3])\n\n    \u003e\u003e\u003e gci.cover(1)\n    Output: [2]\n    \u003e\u003e\u003e gci.cover([2, 1, 1, 1])\n    Output: [1, 0]\n\nFor more detailed explanation see `doc \u003chttps://github.com/ferrocactus/multiset_multicover/tree/main/doc/usage.rst\u003e`__.\n\nInstallation\n____________\n\nTo install this package, run\n\n.. code:: bash\n\n    $ pip install multiset-multicover\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Feuxhenh%2Fmultiset-multicover","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Feuxhenh%2Fmultiset-multicover","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Feuxhenh%2Fmultiset-multicover/lists"}