Answered step by step
Verified Expert Solution
Question
1 Approved Answer
The Island of Sodor is home to a large number of towns and villages, connected by an extensive rail network. Recently, several cases of a
The Island of Sodor is home to a large number of towns and villages, connected by an extensive rail network. Recently, several cases of a deadly contagious disease (either swine flu or zombies; reports are unclear) have been reported in the village of Ffarquhar. The controller of the Sodor railway plans to close down certain railway stations to prevent the disease from spreading to Tidmouth, his home town. No trains can pass through a closed station. To minimize expense (and public notice), he wants to close down as few stations as possible. However, he cannot close the Ffarquhar station, because that would expose him to the disease, and he cannot close the Tidmouth station, because then he couldn't visit his favorite pub. Describe an algorithm to find the minimum number of stations that must be closed to block all rail travel from Ffarquhar to Tidmouth. Write down the pseudocode, analyze its running time and prove that it works correctly. The Sodor rail network is represented by an undirected graph G-(V, E), with a vertex for each station and an edge for each rail connection between two stations. Two special vertices f and t represent the stations in Ffarquhar and Tidmouth. For example, given the graph from Figure 2 as input, your algorithm should return the number 2 Figure 2: An example for Problem 4: The two stations to be closed are marked in red The Island of Sodor is home to a large number of towns and villages, connected by an extensive rail network. Recently, several cases of a deadly contagious disease (either swine flu or zombies; reports are unclear) have been reported in the village of Ffarquhar. The controller of the Sodor railway plans to close down certain railway stations to prevent the disease from spreading to Tidmouth, his home town. No trains can pass through a closed station. To minimize expense (and public notice), he wants to close down as few stations as possible. However, he cannot close the Ffarquhar station, because that would expose him to the disease, and he cannot close the Tidmouth station, because then he couldn't visit his favorite pub. Describe an algorithm to find the minimum number of stations that must be closed to block all rail travel from Ffarquhar to Tidmouth. Write down the pseudocode, analyze its running time and prove that it works correctly. The Sodor rail network is represented by an undirected graph G-(V, E), with a vertex for each station and an edge for each rail connection between two stations. Two special vertices f and t represent the stations in Ffarquhar and Tidmouth. For example, given the graph from Figure 2 as input, your algorithm should return the number 2 Figure 2: An example for Problem 4: The two stations to be closed are marked in red
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started