Skip to contents

Create a graph with the specified edges

Usage

graph_create(edges, n = 0L, directed = TRUE)

Arguments

edges

An integer vector of vertex IDs; the first two elements are the first edge, etc.

n

An integer value, the number of vertices.

directed

A logical value, whether to consider directed paths. Ignored for undirected graphs.

Value

An igraph_ptr object.

Examples

graph_create(seq_len(6L))
#> $V  tibble [6 × 0] (S3: tbl_df/tbl/data.frame)
#>  Named list()
#> # A tibble: 3 × 2
#>    from    to
#>   <int> <int>
#> 1     1     2
#> 2     3     4
#> 3     5     6