Constructors

Various example graphs, where possible with vertex coordinates, can be constructed by predefined functions.

MeGraPDE.MetricGraphs.metric_star_graphFunction
metric_star_graph(; ℓ=1)

Create a star graph with n=5 vertices and m=4 edges of lengths 'ℓ'.

metric_star_graph(ℓ_vec::Vector)

Create a star graph with edge lengths 'ℓ_vec'.

MeGraPDE.MetricGraphs.metric_lollipop_graphFunction
metric_lollipop_graph(n1::Int, n2::Int; ℓ=1)

Create a lollipop graph with clique of size 'n1' connected by an edge to a path of size 'n2', equilateral edge lengths 'ℓ'

MeGraPDE.MetricGraphs.metric_barabasi_albertFunction
metric_barabasi_albert(n::Int, k::Int; ℓ=1, seed=nothing)

Create equilateral Barbási-Albert graph with 'n' vertices by growing an initial graph with 'k' vertices and attaching each vertex with 'k' edges, see Graphs.barabasi_albert.

Optional Arguments

  • ℓ=1: equilateral edge length.
  • seed=nothing: set the RNG seed.
MeGraPDE.MetricGraphs.metric_erdos_renyiFunction
metric_erdos_renyi(n::Int, p::Number; ℓ=1)

Create equilateral Erdos-Renyi graph with 'n' vertices connected by edges with probability 'p', see Graphs.erdos_renyi