Random walk on a graph

Starting with a vertex, the algorithm takes the specified number of steps by selecting another vertex at random. Let us see a random walk:

> random_walk(simple.graph, start = "alice", steps = 3)+ 3/6 vertices, named, from 7432b4a:[1] alice eli   alice

We see that the algorithm moved to eli and came back to alice.

We hope this gives you an overview of how to use the igraph package. Let's now move to our use case and see how we can leverage the igraph package to solve our problem.

Get R Data Analysis Projects now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.