Learn R Programming

graphicalExtremes (version 0.2.0)

generate_random_connected_graph: Generate a random connected graph

Description

Generates a random connected graph. First tries to generate an Erdoes-Renyi graph, if that fails, falls back to producing a tree and adding random edges to that tree.

Usage

generate_random_connected_graph(
  d,
  m = NULL,
  p = 2/(d + 1),
  maxTries = 1000,
  ...
)

Value

An [igraph::graph] object

Arguments

d

Number of vertices in the graph

m

Number of edges in the graph (specify this or p)

p

Probability of each edge being in the graph (specify this or m)

maxTries

Maximum number of tries to produce a connected Eroes-Renyi graph

...

Ignored, only allowed for compatibility

See Also

Other Example generations: generate_random_Gamma(), generate_random_cactus(), generate_random_chordal_graph(), generate_random_graphical_Gamma(), generate_random_integer_Gamma(), generate_random_model(), generate_random_spd_matrix(), generate_random_tree()