{"id":20407941,"url":"https://github.com/mushoffa/dijkstra-shortest-path-go","last_synced_at":"2026-06-01T02:31:37.031Z","repository":{"id":180668759,"uuid":"538994828","full_name":"mushoffa/dijkstra-shortest-path-go","owner":"mushoffa","description":"The implementation of Dijkstra Algorithm in Go language","archived":false,"fork":false,"pushed_at":"2022-09-21T02:36:35.000Z","size":67,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-12-07T11:29:26.875Z","etag":null,"topics":["dijkstra","dijkstra-algorithm","dijkstra-shortest-path","go"],"latest_commit_sha":null,"homepage":"","language":"Go","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/mushoffa.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":"2022-09-20T13:09:21.000Z","updated_at":"2024-07-12T14:59:05.000Z","dependencies_parsed_at":null,"dependency_job_id":"f46b32df-e7ec-447a-a14b-3f1a4aa989d4","html_url":"https://github.com/mushoffa/dijkstra-shortest-path-go","commit_stats":null,"previous_names":["mushoffa/dijkstra-shortest-path-go"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/mushoffa/dijkstra-shortest-path-go","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mushoffa%2Fdijkstra-shortest-path-go","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mushoffa%2Fdijkstra-shortest-path-go/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mushoffa%2Fdijkstra-shortest-path-go/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mushoffa%2Fdijkstra-shortest-path-go/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/mushoffa","download_url":"https://codeload.github.com/mushoffa/dijkstra-shortest-path-go/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mushoffa%2Fdijkstra-shortest-path-go/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":33757790,"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-01T02:00:06.963Z","response_time":115,"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":["dijkstra","dijkstra-algorithm","dijkstra-shortest-path","go"],"created_at":"2024-11-15T05:27:07.281Z","updated_at":"2026-06-01T02:31:36.866Z","avatar_url":"https://github.com/mushoffa.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Dijkstra Algorithm - Shortest Path\nThis project repository demonstates the implementation of Djikstra Algorithm to find shortest path between two nodes using Go language. The solution of defined problem statement within this project is based on my perspective. You may have different approach to solve this problem.\n\n# Contents\n1. [Problem Statement](#problem-statement)\n   * [Function Description](#function-description)\n   * [Input Format](#input-format)\n   * [Constraints](#constraints)\n   * [Output Format](#output-format)\n   * [Graph](#graph)\n2. [Solution](#solution)\n3. [Run](#run)\n\n# Problem Statement\nA driver is assigned to pick and deliver a food orders. But the driver have a difficulty to find the best way / route to deliver all of this orders. Your task is to find routes with the lowest expenses for the driver !\n\nThe first parameters is a 2D Array of Integer, orders assigned to the driver. Each orders will have this format : `[pick,destination]`.\npick, means driver must go to this location first to pick the delivery.\nAfter driver arrives on pick location, then he will go to the destination.\nThe order must be done sequentially.\nThe second parameters is a 2D Array of Integer consisting of routes. Each items will represents bank transfer information in this format : `[from,to,cost]`.\nfrom and to indicates the location driver can access to.\nCost is the amount expenses needed to use this route.\n\n## Function Description\nComplete the solution function in the code editor. Solution has the following parameter(s):\n\n`orders` : Delivery orders assigned, can be more than 1.\u003cbr/\u003e\n`routes` : Routes that the driver can take and their costs.\nthis function will then returns :\u003cbr/\u003e\n`optimalRoute` : an array consisting of routes to finish this delivery. **Driver will always starts form position 1 !**\n\n## Input Format\nThe first line contains ***t***, the number of orders.\nEach of the order is as follow:\n* The line containes two space-separated integers ***x*** and ***y***, represents the pick up point and destination point respectively.\n\nThe next line, after list of order, contains ***u***, represents the number of weighted edges connection between nodes or vertices. The weight denotes cost or expenses amount needed to use as described on problem statement.\nEach of the edge connection is as follow:\n* The line contains three space-separated integers ***x***, ***y***, and ***z***, the direction of the beginning node to ending node of an edge, and the cost amount needed go through the edge.\n\n\nSample Input\n```bash\n2\n2 5\n5 1\n9\n1 2 3000\n1 5 7000\n2 1 3000\n2 3 2000\n3 5 5000\n4 1 5000\n5 4 5000\n5 3 5000\n3 2 1000\n```\n## Constraints\n\u003c!--\n1 \u003c= t \u003c= 10\n2 \u003c= x \u003c= N\n2 \u003c= y \u003c= N\n1000 \u003c= z \u003c= 10000\n--\u003e\n\n## Output Format\nThe output will be an Array of Integer `optimalRoute`, each number represents locations (defined in routes) to finish this delivery.\n\nSample Output\n```bash\n[1 2 3 5 3 2 1]\n```\n\n## Graph\n![](graph.png)\nPlease be advised that this is a directed graph which represents route that the driver is allowed to travel indicated by the arrow pointing toward the node. For instance, node `1` has a bidirectional connection to node `2` with the same weight, the driver can go through frome node `1` to node `2` and vice versa. \n\n\n# Solution\n\n# Run\n1. Clone this repository and change directory to the root of cloned project folder.\n```bash\ngit clone https://github.com/mushoffa/dijkstra-shortest-path-go.git\n```\n2. \n```bash\n/dijkstra-shortest-path-go$ make run\n```\n3. Compare output of the running program against defined solution on `out` file to check whether it computes correctly. The `diff` command will return new line on terminal in case of success where the output of program matches defined text solution on `out` file.\n```bash\n/dijkstra-shortest-path-go$ diff \u003c(go run main.go \u003c in) out\n/dijkstra-shortest-path-go$\n```","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmushoffa%2Fdijkstra-shortest-path-go","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmushoffa%2Fdijkstra-shortest-path-go","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmushoffa%2Fdijkstra-shortest-path-go/lists"}