{"id":20638416,"url":"https://github.com/pratikpakhale/kmb-cpu","last_synced_at":"2026-06-29T07:31:41.953Z","repository":{"id":221834337,"uuid":"755493705","full_name":"pratikpakhale/kmb-cpu","owner":"pratikpakhale","description":"Steiner Tree Problem (STP) KMB algorithm implementation in C++ and Python. Used OpenMP for faster calculation.","archived":false,"fork":false,"pushed_at":"2024-04-28T18:28:08.000Z","size":168096,"stargazers_count":0,"open_issues_count":0,"forks_count":1,"subscribers_count":1,"default_branch":"main","last_synced_at":"2026-06-07T15:27:04.434Z","etag":null,"topics":["cpp","openmp","python","steiner-tree-problem","stp"],"latest_commit_sha":null,"homepage":"","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/pratikpakhale.png","metadata":{"files":{"readme":"README.md","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":"2024-02-10T11:35:56.000Z","updated_at":"2024-04-28T18:28:12.000Z","dependencies_parsed_at":"2025-01-17T08:34:21.692Z","dependency_job_id":null,"html_url":"https://github.com/pratikpakhale/kmb-cpu","commit_stats":null,"previous_names":["pratikpakhale/kmb-cpu"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/pratikpakhale/kmb-cpu","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pratikpakhale%2Fkmb-cpu","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pratikpakhale%2Fkmb-cpu/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pratikpakhale%2Fkmb-cpu/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pratikpakhale%2Fkmb-cpu/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/pratikpakhale","download_url":"https://codeload.github.com/pratikpakhale/kmb-cpu/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pratikpakhale%2Fkmb-cpu/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":34918101,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-06-29T02:00:05.398Z","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":["cpp","openmp","python","steiner-tree-problem","stp"],"created_at":"2024-11-16T15:17:57.857Z","updated_at":"2026-06-29T07:31:41.925Z","avatar_url":"https://github.com/pratikpakhale.png","language":"C++","funding_links":[],"categories":[],"sub_categories":[],"readme":"# KMB algorithm for Steiner Trees\n\n## Run\n\n### Python\n\n```bash\ncd python\npython3 -m venv venv\nsource venv/bin/activate\npip install -r requirements.txt\npython main.py\n```\n\n### C++\n\n```bash\ncd cpp\ncmake .\nmake\n```\n\n### To run KMB algorithm with `instance050` as input from `instances/` folder:\n\n```bash\n./cpp/build/kmb \u003c instances/instance050.gr -o\n```\n\n### Flags\n\n- `-o` to run in outer parallel mode\n- `-i` to run in inner parallel mode\n- `-b` to run in both parallel mode\n- `-s` to run in sequential mode\n\n### Run original research code\n\n```bash\n./cpp/build/og \u003c instances/instance050.gr\n```\n\n## KMB Algorithm\n\n```code\n\nInput: G = (V, E, W), L ⊆ V\n\n// S1\nG1(L, E1= ∅);\n\n// S2\nfor u ∈ L do\n    for v ∈ L do\n        Path(u,v) = shortest_path(u, v);\n        W1(u,v) = |Path(u,v)|;\n        G1.add_edge(u,v);\n    end for\nend for\n\n// S3\nT1 = minimum_spanning_tree(G1);\n\n// S4\nG2 = ∅;\nfor (u,v) ∈ E1(T1) do\n    G2 = G2 ∪ Path(u,v);\nend for\n\n// S5\nT2 = minimum_spanning_tree(G2);\n\nOutput: T2\n```\n\n### KMB Algorithm Visualization\n\n![KMB Algorithm Visualization](https://github.com/pratikpakhale/kmb-cpu/blob/main/kmb.png?raw=true)\n\n### Steiner Tree\n\n![Steiner Tree](https://github.com/pratikpakhale/kmb-cpu/blob/main/steiner.png?raw=true)\n\n## Stats\n\n[Processor Information](./processor_info.txt)\n\n### Generate Results Data `results/`\n\nModify the `stats.sh` file as per requirements\n\n```bash\ncd cpp/\nchmod +x ./stats.sh\n./stats.sh \u003cexecutable_name\u003e \u003coutput_file_name\u003e \u003cstart_instance\u003e \u003cend_instance\u003e \u003cflags\u003e\n```\n\neg \u0026nbsp; `./stats.sh kmb test.csv 1 10 -o`\n\u003cbr /\u003eThis will create a `test.csv` file in `results/` which will contain results of instances from 1 to 10. The flag `-o` meaning the kmb algorithm will run in outer parallel mode\n\n### Parallel Execution Performance\n\n![Parallel Execution Performance](https://github.com/pratikpakhale/kmb-cpu/blob/main/performance_seq_parallel.png?raw=true)\n\n### Our vs Original | Accuracy\n\n![Our vs Original | Accuracy](https://github.com/pratikpakhale/kmb-cpu/blob/main/accuracy.png?raw=true)\n\n### Our vs Original | Time\n\n![Our vs Original | Time](https://github.com/pratikpakhale/kmb-cpu/blob/main/time.png?raw=true)\n\n## References\n\nPace Challenge 2018: [STP](https://pacechallenge.org/2018/)\n\u003cbr /\u003e\nACM Research Paper : [Accelerating Computation of Steiner Trees on GPUs\n](https://dl.acm.org/doi/abs/10.1007/s10766-021-00723-0)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpratikpakhale%2Fkmb-cpu","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpratikpakhale%2Fkmb-cpu","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpratikpakhale%2Fkmb-cpu/lists"}