Question: (20 pts.) Evacuation. A hurricane evacuation order is in effect, but some roads are becoming dangerous in unpredictable ways. To help citizens decide whether
(20 pts.) Evacuation. A hurricane evacuation order is in effect, but some roads are becoming dangerous in unpredictable ways. To help citizens decide whether it is now safer to evacuate or shelter in place, the government has announced a new set of guidelines that depend on a number of factors. One such factor is the number of paths that (under normal conditions) connect a citizen's current location to the shelter they would evacuate to. This number helps balance other considerations like the distance to the shelter and the probability that any given path may now be impassable. Your task is to provide a linear-time algorithm that determines how many paths connect a citizen to their assigned shelter. Assume you are given a directed acyclic graph G, where every vertex represents an intersection, every edge represents a one-way road, and any cycles have been removed to eliminate the possibility of an infinite number of paths. You are also given two vertices c and s, representing the intersections closest to the citizen and their shelter.
Step by Step Solution
There are 3 Steps involved in it
To determine how many paths connect a citizens current location to their assigned shelter in a direc... View full answer
Get step-by-step solutions from verified subject matter experts
