Graphs.jl provides a number of methods for creating a graph. These include tools for building and modifying graph objects, a wide array of graph generator functions, and the ability to read and write graphs from files (using GraphIO.jl).
Graphs.jl implements numerous graph generators, including random graph generators, constructors for classic graphs, numerous small graphs with familiar topologies, and random and static graphs embedded in Euclidean space. See Generators for common graphs for a complete list of available templates.
Other notorious graphs and integration with the
MatrixDepot.jl package are available in the
Datasets submodule of the companion package LightGraphsExtras.jl. Selected graphs from the Stanford Large Network Dataset Collection may be found in the SNAPDatasets.jl package.
Starting from a (possibly empty) graph
g, one can modify it using the following functions:
add_vertex!(g)adds one vertex to
add_edge!(g, s, d)adds the edge
rem_vertex!(g, v)removes vertex
rem_edge!(g, s, d)removes edge
If an iterator of edges
edgelist is available, then one can directly use
In addition to these core functions, more advanced operators can be found in Operators.