Sometimes it is useful to work with a standard representation of a graph, like an edge list.
Examples
g <- sample_gnp(10, 2 / 10)
as_edgelist(g)
#> [,1] [,2]
#> [1,] 1 3
#> [2,] 4 6
#> [3,] 4 7
#> [4,] 2 8
#> [5,] 5 8
#> [6,] 4 9
#> [7,] 6 9
#> [8,] 2 10
#> [9,] 9 10
V(g)$name <- LETTERS[seq_len(gorder(g))]
as_edgelist(g)
#> [,1] [,2]
#> [1,] "A" "C"
#> [2,] "D" "F"
#> [3,] "D" "G"
#> [4,] "B" "H"
#> [5,] "E" "H"
#> [6,] "D" "I"
#> [7,] "F" "I"
#> [8,] "B" "J"
#> [9,] "I" "J"
