Question: Additional question: Consider a graph G = (V, E) where V is a list of vertices and E is a list of edges (undirected). For

 Additional question: Consider a graph G = (V, E) where V

Additional question: Consider a graph G = (V, E) where V is a list of vertices and E is a list of edges (undirected). For example, a triangle can be represented by V = {1, 2, 3} and E = {(1, 2), (1, 3), (2, 3)}. The adjacency matrix of a graph is a matrix indexed by the vertices, where the (i, j)th entry is equal to 1 if there is an edge between i and j, and 0 otherwise. For example, the adjacency matrix of a triangle is [0 1 1 1 0 1 1 1 0] Imagine a particle moving among the vertices in the following way. Suppose it is at a vertex A currently, then at the next iteration it is equally likely to be at each of the vertices adjacent to A. In this problem we try to simulate the behavior of this particle and summarize quantities of interest. (a): Draw a graph with a few vertices (for example, the small square lattice with 9 vertices that looks like a Chinese character). Write R code to store the adjacency matrix of your graph. (b): Set a starting value of the particle by randomly choosing among the vertices. Then simulate 10000 iterations of the movements of your particle and store its locations. (c) Display a table of the frequency of its locations. How often does the particle visit each of the vertices? (d) A theoretical result says that in the long run, the particle visits the vertices with frequencies proportional to the degrees of the vertices. The degree of a vertex is defined as the number of edges associated with it. Compare your simulation results in (c) with this theoretical result

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!