On Saturday, 22 February 2014 22:24:24 UTC, Ed Scheinerman wrote:
>
> I have looked through the documentation for the Graphs package here:
> http://julialang.org/Graphs.jl/index.html
> <http://julialang.org/Graphs.jl/index.html>
> But I'm finding it difficult to get started, even creating simple graphs
> (undirected, no loops, no multiple edges). Adding vertices doesn't seem to
> work.
>
For an adjacency list representation, this short snippet may be helpful:
using Graphs
# Create new graph
g = adjlist(KeyVertex{ASCIIString}, is_directed=false)
# Add 2 vertices
v = add_vertex!(g, "v")
u = add_vertex!(g, "u")
# Add an edge between them
add_edge!(g, v, u)
# This will print:
# KeyVertex{ASCIIString}(1,"v")
# which is the neighbour of u
println(out_neighbors(u, g))
> Is there a tutorial somewhere to help me get started? Thanks.
>
I'm not aware of a tutorial (which would be indeed very helpful) but I
learnt how to use the Graphs package by looking at its tests like
https://github.com/JuliaLang/Graphs.jl/blob/master/test/adjlist.jl which
outline quite short how that package works.