How does random_edge_walk compute the probabilities in r-igraph?

How is the probability of selecting an edge computed by random_edge_walk()? Is it the weight of this edge multiplied by a normalizing constant? If so, is it the same constant for all the edges?

Thanks :slight_smile:

Hey Lynd,

Welcome to the forums!

When the walk is sitting on a vertex and choosing which edge to follow, the probability of each edge is proportional to its weight. So the probability is equal to the edge’s weight divided by the sum of the weights of all outgoing edges from the same vertex.

The R function calls the underlying C library, see the code for more info:



Thanks Fabio for the clarification.