{"id":39360370,"url":"https://github.com/jpierer/astar","last_synced_at":"2026-01-18T02:41:06.190Z","repository":{"id":57619195,"uuid":"388594550","full_name":"jpierer/astar","owner":"jpierer","description":"a* pathfinding algorithm written in go","archived":false,"fork":false,"pushed_at":"2021-07-28T14:56:41.000Z","size":25,"stargazers_count":32,"open_issues_count":1,"forks_count":6,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-10-01T05:43:04.366Z","etag":null,"topics":["astar","astar-algorithm","go","golang","pathfinding"],"latest_commit_sha":null,"homepage":"","language":"Go","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/jpierer.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":"2021-07-22T20:54:23.000Z","updated_at":"2025-05-15T20:54:54.000Z","dependencies_parsed_at":"2022-09-14T12:41:28.555Z","dependency_job_id":null,"html_url":"https://github.com/jpierer/astar","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/jpierer/astar","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jpierer%2Fastar","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jpierer%2Fastar/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jpierer%2Fastar/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jpierer%2Fastar/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/jpierer","download_url":"https://codeload.github.com/jpierer/astar/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jpierer%2Fastar/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28526689,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-18T00:39:45.795Z","status":"online","status_checked_at":"2026-01-18T02:00:07.578Z","response_time":98,"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":["astar","astar-algorithm","go","golang","pathfinding"],"created_at":"2026-01-18T02:41:05.543Z","updated_at":"2026-01-18T02:41:06.177Z","avatar_url":"https://github.com/jpierer.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# astar \n\na* (a-star) pathfinding algorithm written in go\n\n\n## Wikipedia:\n[EN: A* search algorithm](https://en.wikipedia.org/wiki/A*_search_algorithm)\n\n[DE: A*-Algorithmus](https://de.wikipedia.org/wiki/A*-Algorithmus)\n\nInstall\n-------\n    go get github.com/jpierer/astar@main\n\nExample\n-------\n\n```go\npackage main\n\nimport (\n\t\"fmt\"\n\t\"github.com/jpierer/astar\"\n)\n\nfunc main() {\n\n\t// Example 5x5 Grid\n\t//\n\t// [ ] [ ] [ ] [ ] [ ]   S: StartNode    (The node were you are)\n\t// [ ] [E] [P] [ ] [ ]   E: EndNode      (The destination point where you want to go)\n\t// [ ] [O] [P] [O] [O]   O: ObstacleNode (Some obstacles you cannot access)\n\t// [W] [O] [S] [ ] [ ]   P: Valid Path   (This is just a visualisation of the returned found path)\n\t// [W] [ ] [ ] [ ] [ ]   W: WeightedNode (Nodes like water, which are harder to enter)\n\t//\n\t// IMPORTANT: The grid coordinates starts on the \"bottom left\" -\u003e X:0 / Y:0\n\n\tstartNode := astar.Node{X: 2, Y: 1}\n\tendNode := astar.Node{X: 1, Y: 3}\n\n\tobstacleNodes := []astar.Node{\n\t\t{X: 3, Y: 2},\n\t\t{X: 4, Y: 2},\n\t\t{X: 1, Y: 1},\n\t\t{X: 1, Y: 2},\n\t}\n\twaterNodes := []astar.Node{\n\t\t{X: 0, Y: 0, Weighting: 20},\n\t\t{X: 0, Y: 1, Weighting: 20},\n\t}\n\n\t// set nodes to the config\n\taConfig := astar.Config{\n\t\tGridWidth:     5,\n\t\tGridHeight:    5,\n\t\tInvalidNodes:  obstacleNodes,\n\t\tWeightedNodes: waterNodes,\n\t}\n\n\t// create the algo with defined config\n\talgo, err := astar.New(aConfig)\n\tif err != nil {\n\t\tfmt.Println(\"invalid astar config\", err)\n\t\treturn\n\t}\n\n\t// run it\n\tfoundPath, err := algo.FindPath(startNode, endNode)\n\tif err != nil || len(foundPath) == 0 {\n\t\tfmt.Println(\"No path found ...\")\n\t\treturn\n\t}\n\n\t// the foundPath has now the way to the target\n\n\t// IMPORTANT:\n\t// the path is in the opposite way so the endpoint node is on index 0\n\t// you can avoid it by switching the startNode\u003c\u003eendNode parameter\n\tfor _, node := range foundPath {\n\t\tfmt.Println(node)\n\t}\n\n\t// output:\n\t// Node [X:1 Y:3 F:1 G:1 H:0]\n\t// Node [X:2 Y:3 F:2 G:1 H:1]\n\t// Node [X:2 Y:2 F:3 G:1 H:2]\n\n}\n\n```\n\n### Support Me\nGive a ⭐ if this project was helpful in any way!\n\n### License\nThe code is released under the [MIT LICENSE](/LICENSE).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjpierer%2Fastar","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjpierer%2Fastar","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjpierer%2Fastar/lists"}