{"id":51325315,"url":"https://github.com/n-tateiwa/csp","last_synced_at":"2026-07-01T17:33:08.390Z","repository":{"id":154192127,"uuid":"175756102","full_name":"n-tateiwa/csp","owner":"n-tateiwa","description":"Solver for the constrained shortest path problem","archived":false,"fork":false,"pushed_at":"2020-05-04T01:46:25.000Z","size":3250,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"master","last_synced_at":"2026-06-19T21:35:34.535Z","etag":null,"topics":["algorithm","graph","python"],"latest_commit_sha":null,"homepage":"","language":"Jupyter Notebook","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/n-tateiwa.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,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2019-03-15T05:41:59.000Z","updated_at":"2022-09-20T14:49:00.000Z","dependencies_parsed_at":null,"dependency_job_id":"8666ea18-b405-4244-87c5-105d07d20f9c","html_url":"https://github.com/n-tateiwa/csp","commit_stats":null,"previous_names":["n-tateiwa/csp"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/n-tateiwa/csp","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/n-tateiwa%2Fcsp","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/n-tateiwa%2Fcsp/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/n-tateiwa%2Fcsp/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/n-tateiwa%2Fcsp/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/n-tateiwa","download_url":"https://codeload.github.com/n-tateiwa/csp/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/n-tateiwa%2Fcsp/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":35017089,"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-07-01T02:00:05.325Z","response_time":130,"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":["algorithm","graph","python"],"created_at":"2026-07-01T17:33:07.828Z","updated_at":"2026-07-01T17:33:08.384Z","avatar_url":"https://github.com/n-tateiwa.png","language":"Jupyter Notebook","funding_links":[],"categories":[],"sub_categories":[],"readme":"## eppstein\n\nAlgorithm for finding the k shortest path problem\n\n* eppstein.ipynb (for DiGraph)\n* eppstein_multi.ipynb (for MultiDiGraph)\n* heap_tree (for eppstein*.ipynb)\n\n\n\n## dual_algorithm\n\nAlgorithm for finding constrained shroetst path problem\n\n+ dual_algorithm.py (main code)\n+ ShortestPath.py\n+ EppsteinKSP.py\n+ YenKSP.py\n+ heap_tree.py\n\n\n\n## Usage\n\n```python\nUsage:\n    dual_algorithm.py graph_file source target upper_bound [--print_path] [--yen]\n\nOptions:\n    --print_path\n    --yen        : Use Yen algorithm for the k shortest path problem\n\nNotes:\n    Build Date: Mar 7 2019\n    Main Algorithm            : Hander-Zang algorithm\n    Shortest Path Algorithm   : Dijkstr algorithm\n                              : Bellman-Ford algorithm\n    K Shortest Path Algorithm : Eppstein algorithm\n                              : Yen algorithm\n\nGraph (Multipul Directed Graph):\n    format of graph_fileis \n    tail_node,head_node,weight(float),cost(float)\n```\n\n\n\n**sample**\n\n```bash\n$ python dual_algorithm.py graph_data/fig1_graph.csv 1 10 1\n\nBuild Date: Mar 07 2019\nMain Algorithm            : Hander-Zang algorithm\nShortest Path Algorithm   : Dijkstra or Bellman-Ford algorithm\nK Shortest Path Algorithm : Eppstein algorithm\n\nthe number of nodes: 10\nthe number of edges: 22\n\nRemove the nodes which does not contained source - target path (#STEP0)\nremained the number of nodes: 10\nremained number of edges: 22\n\nWe obtain shortest path on weight (#STEP1)\n    f = 5.000, g = 2.000\n\nWe obtain shortest path on cost (#STEP2)\n    f = 20.000, g = 0.350\n\nBest Solution:  20.000\n\n------------------------------------------------------------\n Iter Step Update    Best      LB      UB     Gap    Time\n------------------------------------------------------------\n    1   #1     LB       -    5.00       -      -%      0s\n    2   #2     UB   20.00    5.00   20.00  78.95%      0s\n    3   #3          20.00    5.00   20.00  78.95%      0s\n    4   #3     UB   15.00    5.00   15.00  71.43%      0s\n    5   #3     LB   15.00   11.00   15.00  28.57%      0s\n    6   #4     LB   15.00   12.00   15.00  21.43%      0s\n    7   #4  LB UB   14.00   13.00   14.00   7.69%      0s\n    8   #4     LB   14.00   13.50   14.00   3.85%      0s\n    9   #4     LB   14.00   15.00   14.00  -7.69%      0s\n\n\n\n*Optimal Solution: 14.00\n    path [('1', '3', 0), ('3', '6', 0), ('6', '10', 0)]\n    f = 14.000, g = 0.900\n```\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fn-tateiwa%2Fcsp","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fn-tateiwa%2Fcsp","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fn-tateiwa%2Fcsp/lists"}