Skip to content

jfb-h/MainPaths.jl

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

63 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

MainPaths

Stable Dev

A package for computing main paths in the Julia programming language.

THIS PACKAGE IS IN AN EARLY STAGE AND MIGHT BREAK OR CHANGE WITHOUT WARNING

Installation

The package is currently not registered but can be added directly via the github package URL. From the julia REPL, type ] to enter the Pkg REPL and run:

pkg> add https://github.com/jfb-h/MainPaths.jl

julia> using MainPaths

Example

First, define an example graph:

julia> using Graphs, MainPaths

julia> A = [
 0  0  1  0  0  0  0  0  0  0  0
 0  0  1  1  0  0  0  0  0  0  0
 0  0  0  0  1  0  1  0  0  0  0
 0  0  0  0  0  1  0  0  0  1  1
 0  0  0  0  0  0  0  1  1  0  0
 0  0  0  0  0  0  0  0  1  1  0
 0  0  0  0  0  0  0  0  0  0  0
 0  0  0  0  0  0  0  0  0  0  0
 0  0  0  0  0  0  0  0  0  0  0
 0  0  0  0  0  0  0  0  0  0  0
 0  0  0  0  0  0  0  0  0  0  0
];

julia> g = SimpleDiGraph(A)
{11, 12} directed simple Int64 graph

Then, specify the main path weights and traversal algorithm and compute the main path:

julia> weight = SPCEdge(normalize=:none)
SPCEdge(:none)

julia> start = [1,2];

julia> traversal = ForwardLocal(start)
ForwardLocal{Int64}([1, 2])

julia> mainpath(g, weight, traversal)
MainPath with 9 vertices and 8 edges.

Literature

Batagelj (2003): Efficient Algorithms for Citation Networks. arXiv:cs/0309023

About

A julia package for main path analysis.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages