star() creates a star graph, in this every single vertex is
connected to the center vertex and nobody else.
Arguments
- n
Number of vertices.
- ...
These dots are for future extensions and must be empty.
- 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.
See also
Other deterministic constructors:
graph_from_atlas(),
graph_from_edgelist(),
graph_from_literal(),
make_(),
make_chordal_ring(),
make_circulant(),
make_empty_graph(),
make_full_citation_graph(),
make_full_graph(),
make_full_multipartite(),
make_graph(),
make_lattice(),
make_ring(),
make_tree(),
make_turan(),
make_wheel()
Examples
make_star(10, mode = "out")
#> ── <igraph> Out-star ──────────────────────────────────────────────── ed0b03f ──
#> ℹ directed
#> ℹ 10 vertices · 9 edges
#>
#> ── Attributes ──────────────────────────────────────────────────────────────────
#> → graph: name <chr>, mode <chr>, center <dbl>
#>
#> ── Edges ───────────────────────────────────────────────────────────────────────
#> [1] 1 → 2 1 → 3 1 → 4 1 → 5 1 → 6 1 → 7 1 → 8 1 → 9 1 → 10
make_star(5, mode = "undirected")
#> ── <igraph> Star ──────────────────────────────────────────────────── 6af9e70 ──
#> ℹ undirected
#> ℹ 5 vertices · 4 edges
#>
#> ── Attributes ──────────────────────────────────────────────────────────────────
#> → graph: name <chr>, mode <chr>, center <dbl>
#>
#> ── Edges ───────────────────────────────────────────────────────────────────────
#> [1] 1 ─ 2 1 ─ 3 1 ─ 4 1 ─ 5
