CarloLucibello / Erdos.jl

A library for graph analysis written Julia.
Other
40 stars 10 forks source link
graph graph-algorithms graph-generation graph-library graphs julia networks

Erdos

Docs CI codecov

A graph library entirely written in Julia. Install it with

]add Erdos

Erdos implements some graph types a large number of algorithms to work with them. Moreover edge and vertex properties can be internally stored in some of the graph types (we call them networks). These features can also be exported to most common graph formats. Custom graph types can be defined inheriting from Erdos' abstract types.

Usage Example

julia> using Erdos

julia> g = Network(10, 20) # create erdos-renyi random network

julia> add_edge!(g, 1, 6); # add edge (1, 6) if it doesn't exists already

julia> eprop!(g, "w", e -> dst(e) - src(e)) # add edge property named "w"
Network(10, 20) with [] graph, [] vertex, ["w"] edge properties

julia> vprop!(g, "x", v -> rand()) # add vertex property named "x"
Network(10, 20) with [] graph, ["x"] vertex, ["w"] edge properties

julia> eprop(g, 1, 6, "w")
5

julia> vprop(g, 1, "x")
0.9016965075429149

julia> writenetwork("mygraph.graphml", g)  # save graph and properties in .graphml format

Features

Refer to the documentation to explore all the features of Erdos. Here is a comprehensive list of the implemente algorithms. (EE) denotes algorithms in the companion package ErdosExtras.

Licence and Credits

Erdos is released under MIT License. Graphs stored in the datasets directory are released under GPLv3 License.

Huge credit goes to the contributors of LightGraphs.jl, from which this library is derived. Also thanks to Tiago de Paula Peixoto and his Python library graph-tool for inspiration and for the graphs in datasets.