{"id":26573271,"url":"https://github.com/deprekate/fastpath","last_synced_at":"2025-03-23T00:40:00.020Z","repository":{"id":57428654,"uuid":"63991569","full_name":"deprekate/fastpath","owner":"deprekate","description":"A program to find the path through a network of nodes.","archived":false,"fork":false,"pushed_at":"2024-10-04T18:25:08.000Z","size":221,"stargazers_count":7,"open_issues_count":0,"forks_count":2,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-03-15T03:35:39.675Z","etag":null,"topics":["bellman-ford","digraph","edges","fastpath","graph","shortest-path","solving","weight"],"latest_commit_sha":null,"homepage":"","language":"C","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/deprekate.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":"2016-07-23T00:36:50.000Z","updated_at":"2024-10-04T18:25:13.000Z","dependencies_parsed_at":"2022-09-02T17:14:17.996Z","dependency_job_id":null,"html_url":"https://github.com/deprekate/fastpath","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/deprekate%2Ffastpath","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/deprekate%2Ffastpath/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/deprekate%2Ffastpath/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/deprekate%2Ffastpath/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/deprekate","download_url":"https://codeload.github.com/deprekate/fastpath/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":245040190,"owners_count":20551299,"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":["bellman-ford","digraph","edges","fastpath","graph","shortest-path","solving","weight"],"created_at":"2025-03-23T00:39:59.516Z","updated_at":"2025-03-23T00:39:59.999Z","avatar_url":"https://github.com/deprekate.png","language":"C","readme":"Introduction\n------------\n\nFastpath is a fast and lightweight tool for finding the shortest path in a weighted\ngraph.  As input it only needs the starting node, the ending node, and the weights\nof each node to node edge.  For versatility it uses the Bellman-Ford algorithm, which\nallows for negative weights.  Future version will incorporate the Dijkstra algorithm\nto speed up runtimes on graphs that do not contain negative edges.\nTo install `fastpath`,\n```sh\ngit clone git@github.com:deprekate/fastpath.git\ncd fastpath; make\n```\nThe only library dependency for fastpath is uthash (which is included).\nThe fastpathz has the extra dependency of mini-gmp (which is included).\n\nThere are two flavors of `fastpath`.  The first is the default `fastpath`, which will work\nfor 99% of needed cases.  It's limitation is that it uses the C-type long double for edge\nweights, which can cause rounding errors if you have extremely large/small numbers for edge\nweights (ie -1E50 or 1E50).\nThis is because during the path relaxation step of the Bellmanford code, C cannot distinguish\na difference between 1E50 and 1E50 + 1\n\nIf your numbers are extremely large/small, then you can use the `fastpathz` version, which\nuses infinite-precision integers as edge weights. The downside of using `fastpathz` is that\ndecimal places get dropped, so the C code does not distinguish between 1 and 1.1.  This \nlimitation can partially be overcome by just multiplying all your weights by an arbitrary\nnumber.\n\n\n\nFastpath Example\n--------------\n\nRun either flavor on the included sample data:\n```sh\nfastpath --source A --target Z \u003c edges.txt \n```\n```sh\nfastpathz --source A --target Z \u003c edges.txt \n```\nThe output of either command is the path of nodes, and should look like\n```sh\nA\nB\nD\nE\nZ\n```\n\nThe structure of the graph looks like:\n\n```sh\nA -----\u003e B -----\u003e C \u003c----- F\n         |        |\n         |        |\n         v        v\n         D -----\u003e E -----\u003e Z\n```\n\n* Strings can be used for the nodes, and the weights can be positive or negative long double \n  numbers. The weights can even be in the form of scientific shorthand (1.6E+9).\n\n\nPython Example\n--------------\n\nFastPath is now also available as a PIP package available at [pypi.org](https://pypi.org/project/fastpath/)\n\nIt is installable by simply using pip\n```sh\npip install fastpath \n```\n\nTo use in your python code, first import the module, write edges to the graph, and then provide a beginning node (source) and an end node (target)\n```sh\nimport fastpath as fp\n\nf = open(\"edges.txt\", \"r\")\nfor line in f:\n        ret = fp.add_edge(line)\n\nfor edge in fp.get_path(source=\"A\", target=\"Z\"):\n        print(edge)\n```\n\nOutput is the path of nodes, and should look like\n```sh\n$ python example.py \nA\nB\nD\nE\nZ\n```\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdeprekate%2Ffastpath","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdeprekate%2Ffastpath","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdeprekate%2Ffastpath/lists"}