Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

A number of art museums around the country have been featuring work by an artist

ID: 3206341 • Letter: A

Question

A number of art museums around the country have been featuring work by an artist named Mark Lombardi (1951-2000), consisting of a set of intricately rendered graphs. Building on a great deal of research, these graphs encode the relationships among people involved in major political scandals over the past several decades: the nodes correspond to participants, and each edge indicates some type of relationship between a pair of participants And so, if you peer closely enough at the drawings, you can trace out ominous-looking paths from a high-ranking U.S. government official, to a former business partner, to a bank in Switzerland, to a shadowy arms dealer Such pictures form striking examples of social networks, which, as we discussed in Section 3.1, have nodes representing people and organizations, and edges representing relationships of various kinds. And the short paths that abound in these networks have attracted considerable attention recently, as people ponder what they mean. In the case of Mark Lombardi's graphs, they hint at the short set of steps that can carry you from the reputable to the disreputable Of course, a single, spurious short path between nodes v and omega in such a network may be more coincidental than anything else; a large number of short paths between v and w can be much more convincing. So in addition to the problem of computing a single shortest v - omega path in a graph G, social networks researchers have looked at the problem of determining the number of shortest v - omega paths This turns out to be a problem that can be solved efficiently. Suppose we are given an undirected graph G = (V, E), and we identify two nodes v and omega in G. Give an algorithm that computes the number of shortest v - omega paths in G. (The algorithm should not list all the paths; just the number suffices.) The running time of your algorithm should be O(m +n) for a graph with n nodes and m edges.

Explanation / Answer

Solution:

We will solve the more general problem of computing the number of shortest paths from v
to every other node.
We perform BFS from v, obtaining a set of layers L0, L1, L2, . . ., where L0 = {v}. By the
definition of BFS, a path from v to a node x is a shortest v-x path if and only if the layer
numbers of the nodes on the path increase by exactly one in each step.
We use this observation to comptue the number of shortest paths from v to each other node x. Let S(x) denote this number for a node x. For each node x in L1, we have S(x) = 1,
since the only shortest-path consists of the single edge from v to x. Now consider a node y
in layer Lj for j > 1. The shortest v-y paths all have the following form: they are a shortest
path to some node x in layer Lj1, and then they take one more step to get to y. Thus
S(y) is the sum of S(x) over all nodes x in layer Lj1 with an edge to y.
After performing BFS, we can compute all these values in order of the layers; the time spent to compute a given S(y) is at most the degree of y (wince at most this many terms figure
into the sum from the previous paragraph). Since we have seen that the sum of degrees in
a graph is O(m), this gives an overall running time of O(m + n).

Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote