Skip to contents

Graph ids are used to check that a vertex or edge sequence belongs to a graph. If you create a new graph by changing the structure of a graph, the new graph will have a new id. Changing the attributes will not change the id.

Usage

graph_id(x, ...)

Arguments

x

A graph or a vertex sequence or an edge sequence.

...

Not used currently.

Value

The id of the graph, a character scalar. For vertex and edge sequences the id of the graph they were created from.

Examples

g <- make_ring(10)
graph_id(g)
#> [1] "46ac4209-5538-4d75-a818-4e19076c5257"
graph_id(V(g))
#> [1] "46ac4209-5538-4d75-a818-4e19076c5257"
graph_id(E(g))
#> [1] "46ac4209-5538-4d75-a818-4e19076c5257"

g2 <- g + 1
graph_id(g2)
#> [1] "2cb0889c-80d9-42cd-867c-b8ed8c68cc14"