create_graphs {tidygraph}R Documentation

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")

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)

Value

A tbl_graph

Functions

Examples

# Create a complete graph with 10 nodes
create_complete(10)


[Package tidygraph version 1.3.1 Index]