Learn R Programming

tidygraph (version 1.3.1)

create_graphs: Create different types of well-defined graphs

Description

These functions creates a long list of different types of well-defined graphs, that is, their structure is not based on any randomisation. All of these functions are shallow wrappers around a range of igraph::make_* functions but returns tbl_graph rather than igraph objects.

Usage

create_ring(n, directed = FALSE, mutual = FALSE)

create_path(n, directed = FALSE, mutual = FALSE)

create_chordal_ring(n, w)

create_de_bruijn(alphabet_size, label_size)

create_empty(n, directed = FALSE)

create_bipartite(n1, n2, directed = FALSE, mode = "out")

create_citation(n)

create_complete(n)

create_notable(name)

create_kautz(alphabet_size, label_size)

create_lattice(dim, directed = FALSE, mutual = FALSE, circular = FALSE)

create_star(n, directed = FALSE, mutual = FALSE, mode = "out")

create_tree(n, children, directed = TRUE, mode = "out")

Value

A tbl_graph

Arguments

n, n1, n2

The number of nodes in the graph

directed

Should the graph be directed

mutual

Should mutual edges be created in case of the graph being directed

w

A matrix specifying the additional edges in the chordan ring. See igraph::make_chordal_ring()

alphabet_size

The number of unique letters in the alphabet used for the graph

label_size

The number of characters in each node

mode

In case of a directed, non-mutual, graph should the edges flow 'out' or 'in'

name

The name of a notable graph. See a complete list in igraph::make_graph()

dim

The dimensions of the lattice

circular

Should each dimension in the lattice wrap around

children

The number of children each node has in the tree (if possible)

Functions

  • create_ring(): Create a simple ring graph

  • create_path(): Create a simple path

  • create_chordal_ring(): Create a chordal ring

  • create_de_bruijn(): Create a de Bruijn graph with the specified alphabet and label size

  • create_empty(): Create a graph with no edges

  • create_bipartite(): Create a full bipartite graph

  • create_citation(): Create a full citation graph

  • create_complete(): Create a complete graph (a graph where all nodes are connected)

  • create_notable(): Create a graph based on its name. See igraph::make_graph()

  • create_kautz(): Create a Kautz graph with the specified alphabet and label size

  • create_lattice(): Create a multidimensional grid of nodes

  • create_star(): Create a star graph (A single node in the center connected to all other nodes)

  • create_tree(): Create a tree graph

Examples

Run this code
# Create a complete graph with 10 nodes
create_complete(10)

Run the code above in your browser using DataLab