FancyPack.R.LiU.3-package: Euclidean+Dijkstra

Description Details Author(s) References See Also Examples

Description

The package includes two functions: 1.Euclidean function for finding GCD of two integers;2.Dijkstra algorithm for finding shortest route, given a cost table of data frame and a numerical source point. Output is a vector of distance for all nodes acorrding to requirement, but it is possible to genereate the shortest route as well which is stored in first elements of list "nodes"

Details

Two functions included: euclidean and dijkstra functions

Author(s)

Jun Li

Maintainer: Jun Li <junli559@student.liu.se>

References

https://en.wikipedia.org/wiki/Euclidean_algorithm

https://en.wikipedia.org/wiki/Dijkstra

See Also

N/A

Examples

1
2
3
4
5
6
euclidean(100, 1000)
wiki_graph <-
data.frame(v1=c(1,1,1,2,2,2,3,3,3,3,4,4,4,5,5,6,6,6),
           v2=c(2,3,6,1,3,4,1,2,4,6,2,3,5,4,6,1,3,5),
           w=c(7,9,14,7,10,15,9,10,11,2,15,11,6,6,9,14,2,9))
dijkstra(wiki_graph, 1)  

yewei369/FancyPack.R.LiU.3 documentation built on Nov. 5, 2019, 12:34 p.m.