环是一维格子,此函数是 make_lattice()
的一个特例。
参见
其他确定性构造函数:graph_from_atlas()
、graph_from_edgelist()
、graph_from_literal()
、make_()
、make_chordal_ring()
、make_empty_graph()
、make_full_citation_graph()
、make_full_graph()
、make_graph()
、make_lattice()
、make_star()
、make_tree()
示例
print_all(make_ring(10))
#> IGRAPH 8ca7c9e U--- 10 10 -- Ring graph
#> + attr: name (g/c), mutual (g/l), circular (g/l)
#> + graph attributes:
#> | + name:
#> | [1] "Ring graph"
#> | + mutual:
#> | [1] FALSE
#> | + circular:
#> | [1] TRUE
#> + edges from 8ca7c9e:
#> [1] 1-- 2 2-- 3 3-- 4 4-- 5 5-- 6 6-- 7 7-- 8 8-- 9 9--10 1--10
print_all(make_ring(10, directed = TRUE, mutual = TRUE))
#> IGRAPH 330b279 D--- 10 20 -- Ring graph
#> + attr: name (g/c), mutual (g/l), circular (g/l)
#> + graph attributes:
#> | + name:
#> | [1] "Ring graph"
#> | + mutual:
#> | [1] TRUE
#> | + circular:
#> | [1] TRUE
#> + edges from 330b279:
#> [1] 1-> 2 2-> 1 2-> 3 3-> 2 3-> 4 4-> 3 4-> 5 5-> 4 5-> 6 6-> 5
#> [11] 6-> 7 7-> 6 7-> 8 8-> 7 8-> 9 9-> 8 9->10 10-> 9 10-> 1 1->10