godijkstra

module
v0.0.0-...-950f727 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jan 10, 2014 License: Apache-2.0

README

Go-Dijkstra
==========

[![Build Status](https://travis-ci.org/kirves/godijkstra.png?branch=master)](https://travis-ci.org/kirves/godijkstra)

Description
-----------

This is a library for the Go programming language implementing the Dijkstra, Dijkstra bidirectional and Yen's graph search algorithms.
It works with any graph object implementing the GraphObject interface, having therefore means of getting the successors and predecessors of any graph node and the weight of any edge in the graph.

Installation
------------

This package can be installed with the go get command:

	go get github.com/kirves/godijkstra/dijkstra


Example
-------

After creating a graph object it is simply a matter of calling the desired search algorithm function:

	path, valid := dijkstra.SearchPath(graph, "START", "END", dijkstra.VANILLA)

for standard Dijkstra algorithm

or

	path, valid := dijkstra.SearchPath(graph, "START", "END", dijkstra.BIDIR)

for the bidirectional version of the algorithm.

Yen's algorithm returns the k-shortest paths from a graph, using both a search algorithm and a deviation algorithm:

	paths := yen.Yen(graph, "START", "END", k, searchFunc)

where k is the number of paths to find and searchFunc is the search algorithm to use (the Dijkstra algorithm implemented in this package is fine).

Documentation
-------------

API documentation can be found here: http://godoc.org/github.com/kirves/godijkstra/dijkstra

Directories

Path Synopsis
common
path
Package DijkstraPath provides the path structures for the Go-Dijkstra component.
Package DijkstraPath provides the path structures for the Go-Dijkstra component.
structs
Package DijkstraStructs contains support structures for the Go-Dijkstra component.
Package DijkstraStructs contains support structures for the Go-Dijkstra component.
Package Dijkstra provides an implementation of Dijkstra Algorithm to find the shortest path in directed graph.
Package Dijkstra provides an implementation of Dijkstra Algorithm to find the shortest path in directed graph.
Package Yen implements Yen's algorithm for k-shortest paths search in a graph.
Package Yen implements Yen's algorithm for k-shortest paths search in a graph.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL