{"id":18520480,"url":"https://github.com/yfe404/not-so-slow-knapsack","last_synced_at":"2025-05-14T17:13:22.243Z","repository":{"id":73813829,"uuid":"167897967","full_name":"yfe404/not-so-slow-knapsack","owner":"yfe404","description":"Multi-threaded Knapsack Solver - uses branch and bound and/or dynamic programming ","archived":false,"fork":false,"pushed_at":"2019-02-02T09:49:30.000Z","size":191,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"master","last_synced_at":"2025-02-17T05:14:22.553Z","etag":null,"topics":["knapsack","knapsack-problem","knapsack-solver","multithreading","operations-research","optimization","optimization-algorithms"],"latest_commit_sha":null,"homepage":null,"language":"C++","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/yfe404.png","metadata":{"files":{"readme":"readme.org","changelog":null,"contributing":null,"funding":null,"license":null,"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}},"created_at":"2019-01-28T04:18:33.000Z","updated_at":"2019-05-15T13:33:27.000Z","dependencies_parsed_at":null,"dependency_job_id":"f44766fc-8116-4233-be43-0d9854a157c3","html_url":"https://github.com/yfe404/not-so-slow-knapsack","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/yfe404%2Fnot-so-slow-knapsack","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yfe404%2Fnot-so-slow-knapsack/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yfe404%2Fnot-so-slow-knapsack/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yfe404%2Fnot-so-slow-knapsack/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/yfe404","download_url":"https://codeload.github.com/yfe404/not-so-slow-knapsack/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":254190431,"owners_count":22029636,"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":["knapsack","knapsack-problem","knapsack-solver","multithreading","operations-research","optimization","optimization-algorithms"],"created_at":"2024-11-06T17:20:35.225Z","updated_at":"2025-05-14T17:13:22.218Z","avatar_url":"https://github.com/yfe404.png","language":"C++","funding_links":[],"categories":[],"sub_categories":[],"readme":"* Not-So-Slow-Knapsack\n\n[[file:img/meme.jpg]]\n\n\n** Overview\n\n*** Installation \n\nBuild binary\n#+BEGIN_SRC sh\nmkdir bin; g++ --std=c++11 src/bb_knap.cpp -o bin/knapsack\n#+END_SRC\n\n*** Usage CLI \n\nNote: tested on =python3.6=, the only requirement is =click= library.\n\n#+BEGIN_SRC sh\n$ python cli/main.py \n#+END_SRC\n\n#+BEGIN_SRC \nChoose a problem instance:\n\n1) ks_60_0\n2) ks_4_0\n3) ks_45_0\n4) ks_30_0\n5) ks_lecture_dp_2\n6) ks_10000_0\n7) ks_300_0\n8) ks_200_0\n9) ks_100_1\n10) ks_100_0\n11) ks_200_1\n12) ks_500_0\n13) ks_400_0\n14) ks_lecture_dp_1\n15) ks_19_0\n16) ks_100_2\n17) ks_106_0\n18) ks_40_0\n19) ks_82_0\n20) ks_50_0\n21) ks_50_1\n22) ks_1000_0\n#+END_SRC\n\n\n#+BEGIN_SRC sh\n1\n#+END_SRC\n\n#+BEGIN_SRC sh\n./data/ks_60_0\n99837 1\n0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 1 0 1 0 1 0 1 0 0 0 1 0 1 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0\n#+END_SRC\n\n\n** Input Format \n\nThe first line contains 2 integers: =n= the number of lines i.e. the number of items and =K= the capacity of the knapsack.\nThe =n= next lines contain 2 integers: the *value* and the *weight* of an item. \n\n*** Format\n#+BEGIN_SRC sh\n\nn K\nv_0 w_0\nv_1 w_1\n...\nv_n-1 w_n-1\n\n#+END_SRC\n\n*** Input Example\n#+BEGIN_SRC sh\n4 11 \n84 10 \n5 15 \n8 43\n#+END_SRC\n\n** Output Format\n\nThe first line contains 2 integers =obj= which is the value of the knapsack i.e. the sum of the values of each items in the knapsack. The second integer =opt= \nis either 0 or 1, 1 if =obj= is the global optimum (proven), 0 else. The second (and last) line contains =n= integers (the number of items) with a value of \n1 if the item is in the knapsack or 0 else. \n\n*** Format\n#+BEGIN_SRC sh\nobj opt\nx_0 x_1 x_2 ... x_n-1\n#+END_SRC\n\n*** Output Format\n#+BEGIN_SRC sh\n19 0 \n0 0 1 1\n#+END_SRC\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fyfe404%2Fnot-so-slow-knapsack","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fyfe404%2Fnot-so-slow-knapsack","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fyfe404%2Fnot-so-slow-knapsack/lists"}