https://github.com/xarg/gopathfinding
Pathfinding implementations in Go lang
https://github.com/xarg/gopathfinding
Last synced: over 1 year ago
JSON representation
Pathfinding implementations in Go lang
- Host: GitHub
- URL: https://github.com/xarg/gopathfinding
- Owner: xarg
- License: bsd-2-clause
- Created: 2011-08-03T15:29:47.000Z (almost 15 years ago)
- Default Branch: master
- Last Pushed: 2017-02-23T19:32:24.000Z (over 9 years ago)
- Last Synced: 2025-03-11T02:12:58.387Z (over 1 year ago)
- Language: Go
- Homepage:
- Size: 13.7 KB
- Stars: 33
- Watchers: 3
- Forks: 7
- Open Issues: 0
-
Metadata Files:
- Readme: README.rst
- License: LICENSE
Awesome Lists containing this project
README
.. image:: https://secure.travis-ci.org/xarg/gopathfinding.png?branch=master
gopathfinding
=================
A small package that implements pathfinding algorithms.
Implementions
---------------
* A* (A star) - implemented
* Dijkstra - not implemented
Installing
------------
Using goinstall
++++++++++++++++++
::
$ go get github.com/xarg/gopathfinding
Using make
+++++++++++++
::
$ git clone git://github.com/xarg/gopathfinding
$ cd gopathfinding
$ make install
Example
-----------
::
import (
"fmt"
pathfinding "github.com/xarg/gopathfinding"
)
func main() {
//A pathfinding.MapData containing the
//coordinates(x, y) of LAND, WALL, START and STOP of the map.
//If your map is something more than 2d matrix then you might want to modify adjacentNodes
graph := pathfinding.NewGraph(map_data)
//Returns a list of nodes from START to STOP avoiding all obstacles if possible
shortest_path := pathfinding.Astar(graph)
}
Documentation
---------------
http://gopkgdoc.appspot.com/pkg/github.com/xarg/gopathfinding
Or
::
$ go doc github.com/xarg/gopathfinding