Computers and Technology

Suppose we have a community of n people. We can create a directed graph from this community as follows: the vertices are people, and there is a directed edge from person A to person B if A would forward a rumor to B. Assume that if there is an edge from A to B, then A will always forward any rumor they hear to B. Notice that this relationship isn't symmetric: A might gossip to B but not vice versa. Suppose there are m directed edges total, so G = (V, E) is a graph with n vertices and m edges. Define a person P to be influential if for all other people A in the community, there is a directed path from P to A in G. Thus, if you tell a rumor to an influential person P, eventually the rumor will reach everybody. You have a rumor that you'd like to spread, but you don't have time to tell more than one person, so you'd like to find an influential person to tell the rumor to.
In the following questions, assume that G is the directed graph representing the community, and that you have access to G as an array of adjacency lists: for each vertex v, in O(1) time you can get a pointer to the head of the linked lists v. outgoing_neighbors and v. incoming_neighbors. Notice that G is not necessarily acyclic.
(a) Show that all influential people in G are in the same strongly connected component, and that everyone in this strongly connected component is influential. [Hint: You need to refer the definition of strongly connected component, and you can prove using either induction or contradiction.]
(b) Suppose that an influential person exists. Give an algorithm that, given G, finds an influential person. [We are expecting a description or pseudocode of your algorithm and a short argument about the runtime.

answer
Answers: 1

Other questions on the subject: Computers and Technology

image
Computers and Technology, 23.06.2019 20:30, batmandillon21
1. for which of the following are you not required to signal beforehand? a. changing lanes b. speeding up c. stopping
Answers: 2
image
Computers and Technology, 24.06.2019 07:00, sudotoxic
Into what form does the barcode reader convert individual bar patterns?
Answers: 1
image
Computers and Technology, 25.06.2019 08:50, JadeCaldwell
A-12.3 an american spy is deep undercover in the hostile country of phonemia. in order not to waste scarce resources, any time he wants to send a message back home, he removes all the punctuation from his message and converts all the letters to uppercase. so, for example, to send the message, “abort the plan! meet at the dark cabin.” he would transmit given such a string, s, of n uppercase letters, describe an efficient way of breaking it into a sequence of valid english words. you may assume that you have a function, valid(s), which can take a character string, s, and return true if and only if s is a valid english word. what is the running time of your algorithm, assuming each call to the function, valid, runs in o(1) time?
Answers: 3
image
Computers and Technology, 25.06.2019 15:30, penny3109
Finally, think about a way to add 1 to the score each time the ball touches the edge of the stage. see if you can add this to the project. answer quickly
Answers: 1
Do you know the correct answer?
Suppose we have a community of n people. We can create a directed graph from this community as follo...

Questions in other subjects:

Konu
Mathematics, 22.03.2021 15:40