Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

make_star

Create a star graph, a tree with n vertices and n - 1 leaves


Description

star creates a star graph, in this every single vertex is connected to the center vertex and nobody else.

Usage

make_star(n, mode = c("in", "out", "mutual", "undirected"), center = 1)

star(...)

Arguments

n

Number of vertices.

mode

It defines the direction of the edges, in: the edges point to the center, out: the edges point from the center, mutual: a directed star is created with mutual edges, undirected: the edges are undirected.

center

ID of the center vertex.

...

Passed to make_star.

Value

An igraph graph.

See Also

Examples

make_star(10, mode = "out")
make_star(5, mode = "undirected")

igraph

Network Analysis and Visualization

v1.2.10
GPL (>= 2)
Authors
See AUTHORS file.
Initial release

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.