{"id":24509056,"url":"https://github.com/dgisolfi/mkp","last_synced_at":"2025-03-15T09:23:03.532Z","repository":{"id":50172755,"uuid":"249286904","full_name":"dgisolfi/mkp","owner":"dgisolfi","description":"The multidimensional 0–1 knapsack problem solved using a greedy algorithm.","archived":false,"fork":false,"pushed_at":"2022-12-26T21:31:49.000Z","size":110,"stargazers_count":2,"open_issues_count":6,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-01-22T00:19:19.267Z","etag":null,"topics":["multidimensional-knapsack-problem"],"latest_commit_sha":null,"homepage":null,"language":"Python","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/dgisolfi.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}},"created_at":"2020-03-22T22:47:30.000Z","updated_at":"2023-01-07T16:21:22.000Z","dependencies_parsed_at":"2023-01-31T01:45:48.843Z","dependency_job_id":null,"html_url":"https://github.com/dgisolfi/mkp","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dgisolfi%2Fmkp","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dgisolfi%2Fmkp/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dgisolfi%2Fmkp/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dgisolfi%2Fmkp/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/dgisolfi","download_url":"https://codeload.github.com/dgisolfi/mkp/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243708430,"owners_count":20334836,"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","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":["multidimensional-knapsack-problem"],"created_at":"2025-01-22T00:19:12.402Z","updated_at":"2025-03-15T09:23:03.513Z","avatar_url":"https://github.com/dgisolfi.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# mkp\nThe multidimensional 0–1 knapsack problem solved using a greedy algorithm.\n\n## About\n\nThis tool was born from nessecity and can be used to determine any combination of balanced knapsacks based on an object's value.\n\n## Problem Statement\n\n*note: Although the following is not the only use for this tool, this was the original use case.*\n\nYou are holding a Beer Olympics, the goal is to create teams that are equally matched(or as close as possible) to ensure each team has a fair chance. Each player has a rating for each event, the ratings add up to the player's overall value. Implement a greedy algorithm to solve the multidimensional 0–1 knapsack problem.\n\nDetails:\n\n* Each team has 3 players\n* there are 5 teams\n* Each player has a total value that is calculated by the given file inputs\n\n### File input:\n\nBelow are the details about each player. The rating for each player is separated by a semi-colon, all ratings should be summed to find a player's value.\n\n```\n-- Name; Case Race; Beer Ball; Flip 50;\nNicole;1;2;2;\nJenna;2;2;5;\nKrendan;4;3;3;\nDylan;4;3;3;\nLuke;5;5;3;\nJason;5;4;3;\nBrendan;5;4;3;\nJames E;3;3;3;\nAidan;3;4;5;\nDaniel;4;5;4;\nMaya;3;3;5;\nJames C;3;3;3;\nKayvan;3;2;2;\nSteph;3;2;4;\nKevin;3;3;3;\n```\n\n## Installation\n\nFor installation just run the make target\n\n`make`\n\n## Usage\n\n### CLI\n\n```\nmkp -h\nUsage: __main__.py [OPTIONS]\n\nOptions:\n  -h, --help               Show this message and exit.\n  --version                Show the version and exit.\n  -e, --examples           Generate example files\n  -k, --knapsacks INTEGER  The total number of knapsacks to fill  [required]\n  -c, --capacity INTEGER   The capacity of each knapsack  [required]\n  -f, --file PATH          Path to objects for knapsacking  [required]\n```\n\n### Input\n\nthe object input is provided via a file, the format for which is defined below.\n\n*Comment Deliminator: `--`* \n\n```\n-- Object Title; Event 1 Rating; Event 2 Rating; ... Event N Rating;\n```\n\n## Development\n\nTo get all necessary dependencies run:\n\n```\nmake init\n```\n\nThen enter a new pipenv shell via:\n\n```\npipenv shell\n```\n\nNow to run the cli from source run\n\n```\npython3 -m mkp\n```\n\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdgisolfi%2Fmkp","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdgisolfi%2Fmkp","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdgisolfi%2Fmkp/lists"}