1. Home
  2. Explore
  3. Mathematics
  4. Discrete-Time Random Walks

Study methods

Flashcards
Quiz
Fill in the blanks
Written test
Lesson
Notes
Podcast
Content

Discrete-Time Random Walks

Speaker 1Speaker 2

Discrete-Time Random Walks

17:50
0:00-17:50
  1. Hope

    Hello everyone, and welcome to week six of the networks course. This week is centered on random walks, beginning with discrete-time random walks on graphs, then moving to PageRank, respondent-driven sampling, and finally continuous-time random walks.

  2. Corey

    Let’s begin with the basic process. We have a graph and an ensemble of walkers. At each discrete time step—one, two, three, and so on—every walker moves from its current node to one of its neighboring nodes.

  3. Hope

    If a node has three neighbors, for example, the walker can choose each one with probability one third. The probabilities of all possible moves from a node must add up to one, because that expresses conservation of total probability: the walker has to end up somewhere.

  4. Corey

    We represent the probability of finding walkers at the nodes using a vector p of t. Its entries are p one of t through p n of t, where each entry gives the probability associated with one node at time t.

  5. Hope

    A random walk on a network is mathematically equivalent to a Markov chain. The graph’s nodes become the chain’s states, and the links determine the transition probabilities between states.

  6. Corey

    For an unweighted graph, the transition probability from node i to node j is T i j equals A i j divided by k i. Here, A i j indicates whether the link exists, and k i is the degree of node i. Since node i has k i outgoing neighbors, summing A i j divided by k i over all j gives k i divided by k i, which is one.

  7. Hope

    That transition rule leads to the update equation p j of t plus one equals the sum over neighboring nodes i of p i of t times T i j. In words, probability arrives at node j from all the nodes that could have sent a walker there during the previous step.

  8. Corey

    Using row-vector notation, the update is p of t plus one equals p of t times T. Repeating the update gives the formal solution p of t equals p of zero times T to the power t.

  9. Hope

    Although the original graph might be undirected, the transition matrix is generally directed, because the probability of moving from i to j is divided by the degree of i. Moving from i to j and moving from j to i need not have the same probability unless the graph has the right degree structure.

  10. Corey

    Markov chains contain several useful types of states. An absorbing state satisfies T i i equals one, meaning that once probability reaches that state, it cannot escape. All transitions from that state to other states have probability zero.

  11. Hope

    An ergodic set is a group of states such that every state in the set can eventually reach every other state, while probability cannot leave the set. Once a walker enters that set, it remains there, and the states communicate with one another.

  12. Corey

    A transient state is not a member of an ergodic set. Probability can flow away from transient states, and asymptotically the probability of finding a walker there goes to zero. An absorbing state is actually a special ergodic set containing just one state.

  13. Hope

    The long-term distribution is called the stationary density, written p star. It satisfies p star equals p star times T, so it is a left eigenvector of the transition matrix with eigenvalue one.

  14. Corey

    Why does an eigenvalue of one exist? Because T times the vector of all ones equals the vector of all ones, which follows from the fact that the transition probabilities in each row sum to one. Therefore, the transition matrix has eigenvalue one, with a corresponding left eigenvector that can serve as a stationary distribution.

  15. Hope

    To understand the dynamics more deeply, we change from the node basis to an eigenvector basis. For an undirected graph, the transition matrix is usually asymmetric, but it is related to the symmetric matrix A tilde with entries A i j divided by the square root of k i times k j.

  16. Corey

    Because A tilde is symmetric, its eigenvalues are real, and its eigenvectors can be chosen to be orthogonal and normalized. The transition matrix is similar to A tilde through the degree matrix D, so the two matrices have the same eigenvalues.

  17. Hope

    The left and right eigenvectors of the transition matrix can be constructed from the eigenvectors of A tilde. The left eigenvectors are obtained by multiplying each component by the square root of the corresponding degree, while the right eigenvectors are obtained by dividing by that square root.

  18. Corey

    This gives a spectral expression for T to the power t: each eigenmode is multiplied by lambda sub l to the power t. Consequently, the probability vector can be written as a sum of contributions from independent eigen-directions, with amplitudes evolving according to a sub l of t equals lambda sub l to the power t times a sub l of zero.

  19. Hope

    This change of representation is called the Graph Fourier Transform. It is analogous to the ordinary Fourier transform, where a signal is decomposed into components associated with different spatial frequencies. Here, the eigenvectors of the transition matrix provide a basis adapted to the network, making the time evolution easier to interpret.

  20. Corey

    The eigenvalues of the transition matrix lie between minus one and one. The eigenvalue one corresponds to the stationary state. For a connected graph, the eigenvalue one is unique, and the smallest eigenvalue is minus one exactly when the graph is bipartite.

  21. Hope

    That bipartite case matters because it can produce oscillations. If all the probability starts on one side of a bipartite graph, it moves to the other side at the next step and then back again, producing an up-and-down pattern instead of convergence to a stationary distribution.

  22. Corey

    If we set aside that bipartite complication, all modes with eigenvalues whose magnitude is less than one eventually decay. The eigenvalue-one mode remains, so the process converges to the stationary density, which is the left eigenvector associated with eigenvalue one.

  23. Hope

    The next-largest eigenvalue controls the leading correction to stationarity. The convergence is approximately exponential, with the important quantity being the spectral gap, one minus lambda two. A small spectral gap means slow relaxation, while a large gap means fast convergence.

  24. Corey

    The spectral gap also connects dynamics to graph structure through the Cheeger inequality. The conductance, or Cheeger constant, measures how easily a graph can be divided into two relatively balanced parts with only a few edges crossing between them.

  25. Hope

    More precisely, for a partition into S and its complement, conductance involves the number of edges crossing the partition divided by the smaller of the two volumes. The volume of S is the sum of the degrees of all nodes in S.

  26. Corey

    A graph with low conductance has a bottleneck: two substantial groups are connected by only a few links. The Cheeger relationship tells us that low conductance corresponds to a small spectral gap, which means a random walk takes a long time to diffuse between the groups and reach global stationarity.

  27. Hope

    Now let’s apply stationary random walks to centrality. PageRank defines the importance of a node using the stationary density of a random walk, especially on directed networks.

  28. Corey

    On a directed graph, the walker at node i chooses one of its out-neighbors. The transition probability from i to j is A i j divided by the out-degree of i. Incoming and outgoing neighbors must be distinguished, because the walker can follow an edge only in its directed direction.

  29. Hope

    The PageRank of node j is its stationary probability: p j star equals the sum over i of p i star times A i j divided by the out-degree of i. In vector form, PageRank is the eigenvector with eigenvalue one of the directed transition matrix.

  30. Corey

    This creates an important recursive interpretation. A node is important when important nodes point to it, but the contribution from each pointing node is divided among that node’s outgoing links. So a link from an important node with only a few outgoing connections can contribute more than a link from an important node that points to millions of places.

  31. Hope

    For example, being followed by a highly important account that follows only you gives a stronger contribution than being followed by that same account when it follows a million other accounts. The source of the link matters, but so does how widely that source distributes its importance.

  32. Corey

    There is a problem, though: directed graphs do not necessarily have a unique stationary distribution. A graph may contain several strongly connected components, absorbing states, and transient nodes. Then the long-term result can depend on the initial position, while transient nodes may receive PageRank zero.

  33. Hope

    The standard solution is teleportation. At each step, with probability alpha, the walker follows an ordinary directed edge. With probability one minus alpha, the walker ignores the graph and jumps to a node according to a preference vector U.

  34. Corey

    The preference vector has positive entries that sum to one, so it acts like a probability distribution. If alpha is less than one and every preference value is positive, teleportation makes the process ergodic and guarantees a unique stationary PageRank vector, regardless of the original graph’s connectivity.

  35. Hope

    The value of alpha balances topology against numerical behavior. If alpha is too small, teleportation happens too often and the network structure contributes less. If alpha is too close to one, convergence can be very slow and numerical instability can become a concern. A traditional choice is alpha equals zero point eighty-five.

  36. Corey

    That historical value came from modeling web browsing: people follow a sequence of links and then begin again from an unrelated page. The observed lengths of click chains were considered compatible with an alpha around zero point eight-five.

  37. Hope

    A common preference vector is uniform, with U i equal to one over N, giving every node equal teleportation probability. In practice, PageRank can also be personalized, so the preference vector favors topics or pages related to a particular user’s interests.

  38. Corey

    Formally, PageRank can be written using the inverse of the identity minus alpha times the transition matrix, multiplied by the preference vector. This resembles Katz centrality, but PageRank does not require the same restriction on alpha, because the transition matrix has largest eigenvalue one and its probabilities obey conservation.

  39. Hope

    The expanded expression shows that PageRank combines walks of different lengths. Contributions from walks of length L are weighted by powers of alpha, so larger alpha places relatively more emphasis on longer walks.

  40. Corey

    Two useful special cases follow. In a regular directed graph where every node has the same in-degree and out-degree, the nodes are structurally equivalent in this calculation, and PageRank is one over N for every node. In an undirected connected graph, the stationary probability is proportional to degree—specifically, degree divided by twice the number of edges—so PageRank adds little beyond degree centrality.

  41. Hope

    That is why PageRank is especially meaningful for directed networks. Direction and the global pattern of incoming and outgoing links allow it to capture information that ordinary degree centrality does not.

  42. Corey

    One final PageRank issue is the dangling node: a node with incoming links but no outgoing links. The usual procedure is to force teleportation whenever the walker reaches such a node.

  43. Hope

    Let’s turn to respondent-driven sampling, or RDS. This is useful when we want to estimate properties of a population that cannot be fully sampled, but whose members have social relationships we can use to explore the population.

  44. Corey

    Each person has an attribute Y, such as age or whether they are infected with a disease. RDS starts with a seed participant, who receives a limited number of coupons and recruits friends. Those participants can then recruit their own friends, creating a recursive sample through the social network.

  45. Hope

    A naive estimate would average the observed Y values equally. But under a simple model with one recruitment at each step and sampling with replacement, the recruitment process behaves like a discrete-time random walk.

  46. Corey

    For an unweighted, connected graph, the stationary probability of visiting node i is proportional to its degree k i. High-degree people are therefore sampled more often than low-degree people, creating a biased sample.

  47. Hope

    This bias matters especially when Y and degree are correlated. For instance, if infection probability increases with the number of social connections, oversampling high-degree people would overestimate disease prevalence in the full population.

  48. Corey

    The RDS2 estimator corrects for this by weighting each observed value inversely by degree. The estimated mean is the sum of Y i divided by k i over sampled nodes, divided by the sum of one divided by k i over those same nodes. High-degree participants receive less weight because the random walk visits them more frequently.

  49. Hope

    The same idea works for categorical attributes. To estimate the population fraction in category A, add one divided by k i over sampled nodes belonging to A, then divide by the sum of one divided by k i over all sampled nodes.

  50. Corey

    These estimators can be used for continuous or discrete variables, including demographic characteristics and epidemiological quantities. But they rely on important assumptions, including sufficiently long sampling and reasonably accurate reports of each participant’s degree.

  51. Hope

    Finite sampling creates another limitation. If the network has communities joined by only a few links, a sample may remain inside the starting community for the entire observation period. If the sampling time is shorter than the mixing time, the sample may not represent the whole population.

  52. Corey

    That problem is closely related to the spectral gap and conductance we discussed earlier. A bottleneck slows mixing, so the random walk needs more time to move between communities and reach its overall stationary behavior.

  53. Hope

    There is also a behavioral limitation: people may be unlikely to recruit the person who recruited them. Standard random walks allow immediate backtracking, but real recruitment may not.

  54. Corey

    A possible refinement is a non-backtracking random walk. After moving from one node to another, the walker cannot immediately return along the edge it just used. If the current node has three neighbors and one is the node just visited, the next choice is made among the other two, with probability one half for each.

  55. Hope

    Now let’s move from discrete to continuous time. In discrete time, all walkers move synchronously at steps one, two, three, and so on. In continuous time, each walker moves according to its own random schedule, so their movements are no longer synchronized.

  56. Corey

    A continuous-time random walk needs two ingredients: a rule for which edge is taken when a jump occurs, and a rule for when jumps occur. The edge-selection rule can be the same as in the discrete-time walk, while the jump times are determined by a stochastic process.

  57. Hope

    In a node-centric continuous-time walk, the waiting time is associated with the node. When a walker arrives at a node, it waits for an exponentially distributed time generated by an independent Poisson process, then chooses one of the node’s neighbors uniformly.

  58. Corey

    Taking the event rate to be one, the node-centric master equation is d p transpose over d t equals p transpose times the transition matrix minus the identity. The identity term accounts for walkers leaving their current nodes, and the transition matrix distributes them across neighboring nodes.

  59. Hope

    This generator has the same eigenvectors as the discrete-time transition matrix, while its eigenvalues are shifted. Since transition-matrix eigenvalues lie between minus one and one, the corresponding random-walk Laplacian eigenvalues lie between zero and two. Zero corresponds to the stationary mode, and two is associated with the bipartite case.

  60. Corey

    For an undirected connected graph, the node-centric continuous-time walk has the same stationary distribution as the discrete-time walk: p i star equals k i divided by twice the number of edges. Again, high-degree nodes hold more stationary probability.

  61. Hope

    The second model is edge-centric. Here, each edge has its own Poisson process, with rate one. A node with many incident edges therefore has a higher total rate of leaving than a node with only a few edges.

  62. Corey

    The edge-centric master equation is d p transpose over d t equals p transpose times minus D plus A, which is minus the combinatorial Laplacian. Its stationary distribution on an undirected connected graph is uniform: p i star equals one over N.

  63. Hope

    So the two continuous-time models are different on irregular graphs. The node-centric model assigns equal total leaving rate to each node and produces a degree-proportional stationary distribution. The edge-centric model gives each edge the same rate and produces a uniform stationary distribution.

  64. Corey

    On a regular graph, where all degrees are equal, the distinction disappears because the two constructions can be mapped onto one another. On an irregular graph, however, whether timing is attached to nodes or edges changes the dynamics and the long-term density.

  65. Hope

    These random-walk equations also have a dual relationship with consensus dynamics. The edge-centric walk uses the combinatorial Laplacian, whose corresponding consensus process drives node values toward a common value. The stationary vector for that dual process is the normalized all-ones vector.

  66. Corey

    More generally, a random-walk process built from a Laplacian can be paired with a consensus process using that Laplacian in the appropriate left or right multiplication. Thus, random walks and consensus dynamics are two related ways of using the same spectral structure.

  67. Hope

    So the main story of this week is that random walks provide both a dynamical process and a powerful analytical tool. Their stationary distributions reveal centrality, their spectral modes explain convergence, their bottlenecks connect graph structure to mixing time, and their sampling behavior helps us study hidden populations.

  68. Corey

    We also saw that modeling details matter: directed versus undirected edges, teleportation, dangling nodes, backtracking, synchronous versus asynchronous motion, and node-centric versus edge-centric timing can all change the result.

  69. Hope

    That concludes our discussion of discrete- and continuous-time random walks for this week. Next, these ideas will be used to study communities in networks and the relationship between random-walk methods and modularity.

Ask anything

We've read this whole study set, so questions about it get the best answers.

FlashcardsQuizFill in the blanksWritten testLessonNotesPodcastContent