library(igraph)
g.1 <- make_graph(c(1, 3, 2, 3, 3, 4, 4, 5))
g.2 <- make_graph(c(2, 1, 3, 1, 4, 1, 5, 1))
g.3 <- make_graph(c(1, 2, 2, 3, 3, 4, 4, 1, 5, 1))
plot(g.1)
plot(g.2)
plot(g.3)
ug <- make_ring(10)
plot(ug)
dg <- make_ring(10, directed = TRUE)
plot(dg)
Reference: "Network Analysis and Visualization" pages 18-19