ItemGraphs.jl

Shortest paths between items
Author helgee
Popularity
2 Stars
Updated Last
12 Months Ago
Started In
December 2017

ItemGraphs

Shortest paths between items

Build Status Unix Build Status Windows Coveralls Codecov Docs Stable Docs Latest

ItemGraphs is a simple wrapper around LightGraphs that enables my most common use case for graph-like data structures: I have a collection of items that are in relations between each other and I want to get the shortest path between two items. That's it!

Installation

The package can be installed through Julia's package manager:

julia> import Pkg; Pkg.add("ItemGraphs")

Quickstart

# Create an ItemGraph that has integers as vertices
g = ItemGraph{Int}()

# Add some vertices
add_vertex!(g, 101)
add_vertex!(g, 202)

# Add some edges. If the vertices do not exists, they will be added as well
add_edge!(g, 101, 202)
add_edge!(g, 202, 303)
add_edge!(g, 202, 404)

# Get the shortest path, returns [101, 202, 404]
items(g, 101, 404)

# Create an ItemGraph that has integers as vertices and floats as edges
g = ItemGraph{Int, Float64}()
add_edge!(g, 101, 202, 1.0)
add_edge!(g, 202, 303, 2.0)
add_edge!(g, 202, 404) # The item assigned to the edge will be zero by default

# Get all items on the edges between 101 and 404, returns [1.0, 0.0]
edgeitems(g, 101, 404)

Documentation

Please refer to the documentation for additional information.