Introduction to Analysis of Algorithms - Graph and algorithms Please provide step by step explanation and runtime
No answer yet for this question.
Ask a Tutor
Question:
Introduction to Analysis of Algorithms - Graph and algorithms
Please provide step by step explanation and runtime analysis thank you.
Transcribed Image Text:
Problem 1 (Construction work ). Suppose we have access to undirected graph G = (V,E) that represents a set of towns and roads connecting them. We also know the distance d of each road (u, v) E. The local government is tasked with building roads between two towns s,t V with the goal of decreasing the driving time between them as much as possible. They have narrowed down a list of candidate roads P = {(a1, bi)..... (ak, bk)} that we could build. Here, a, b; V are towns with no direct route between them in E. We also know the distance d'; between them. Due to financial constraints, the city government only has funding to build up to 2 roads. Your task is to find which roads would reduce the driving time between s and t by as much as possible when added to G (or none at all). You may use that Dijkstra's algorithm can run in time O(E + V log V). a. Describe a brute-force-like algorithm to determine which roads from P to use. State the runtime of this algorithm with respect to n = |V|, m = |E|, k. The local mayor realizes that with how large k is, your simple algorithm will not finish before re-election season. Towns s and t are home to many important residents and so finding the best way to connect them is top priority. Suddenly, an idea pops into your head: you can reduce to finding the shortest path on a new graph G = (V', E') created from G and P (and some ingenuity). This new graph should encode that you have original paths in G as well as new possible paths using edges in P while respecting that we can construct only 2 new roads. b. C. d. First, describe how to create this new graph G' = (V', E') using G and P. [Hint: V' should consist of existing towns while also tracking of how many new roads it took to reach there.] Explain how you can use Dijkstra's algorithm and G' to determine the solution. What is V' and edges |E' in terms of n, m, k? Use these to state and prove the asymptotic runtime of your algorithm in terms of n, m, k. Problem 1 (Construction work ). Suppose we have access to undirected graph G = (V,E) that represents a set of towns and roads connecting them. We also know the distance d of each road (u, v) E. The local government is tasked with building roads between two towns s,t V with the goal of decreasing the driving time between them as much as possible. They have narrowed down a list of candidate roads P = {(a1, bi)..... (ak, bk)} that we could build. Here, a, b; V are towns with no direct route between them in E. We also know the distance d'; between them. Due to financial constraints, the city government only has funding to build up to 2 roads. Your task is to find which roads would reduce the driving time between s and t by as much as possible when added to G (or none at all). You may use that Dijkstra's algorithm can run in time O(E + V log V). a. Describe a brute-force-like algorithm to determine which roads from P to use. State the runtime of this algorithm with respect to n = |V|, m = |E|, k. The local mayor realizes that with how large k is, your simple algorithm will not finish before re-election season. Towns s and t are home to many important residents and so finding the best way to connect them is top priority. Suddenly, an idea pops into your head: you can reduce to finding the shortest path on a new graph G = (V', E') created from G and P (and some ingenuity). This new graph should encode that you have original paths in G as well as new possible paths using edges in P while respecting that we can construct only 2 new roads. b. C. d. First, describe how to create this new graph G' = (V', E') using G and P. [Hint: V' should consist of existing towns while also tracking of how many new roads it took to reach there.] Explain how you can use Dijkstra's algorithm and G' to determine the solution. What is V' and edges |E' in terms of n, m, k? Use these to state and prove the asymptotic runtime of your algorithm in terms of n, m, k.
Expert Answer:
Related Book For
Microeconomics An Intuitive Approach with Calculus
ISBN: 978-0538453257
1st edition
Authors: Thomas Nechyba
Posted Date:
Students also viewed these algorithms questions
-
"internet radios" for streaming audio, and personal video recorders and players. Describe design and evaluation processes that could be used by a start-up company to improve the usability of such...
-
CANMNMM January of this year. (a) Each item will be held in a record. Describe all the data structures that must refer to these records to implement the required functionality. Describe all the...
-
Using a spreadsheet, compute the average return and standard deviation of each of the three asset classes. Compute the annual return of a portfolio consisting of 50% stocks, 40% real estate, and 10%...
-
Consider again the salesperson discussed in Problems 2.1.9 and 2.3.4 who is trying to locate a particular product. Calculate the variance and standard deviation of the number of warehouses called by...
-
Evaluate C F(r) dr counterclockwise around the boundary C of the region R by Greens theorem, where F = [x 2 e y , y 2 e x ], R the rectangle with vertices (0, 0), (2, 0), (2, 3), (0, 3)
-
The Anchor Glass Container Corporation and its parent company, Consumers Packaging, Inc. (CPI), entered into a series of agreements with Encore Glass, Inc., to supply glass containers of a specific...
-
Takemoto Corporation borrowed $60,000 on November 1, 2010, by signing a $61,350, 3-month, zero-interest-bearing note. Prepare Takemotos November 1, 2010, entry; the December 31, 2010, annual...
-
1) Write a Python function to convert mass values from gram to ounce and return the conversion result. The conversion formula is ounce = gram x 0.035274. The function header is: def gm_to_ounce...
-
Why does a larger government budget deficit increase the magnitude of the crowding-out effect?
-
The geodesics on the plane are just straight lines. Such lines are parametrized as x (A) = a+xo, y (A) = bx+yo (1) Let us now consider the same plane in polar coordinates. The metric, as we know, is...
-
2. External Javascript An external Javascript http://courses.cs.cityu.edu.hk/cs2204/cw3/cinemas.js must be used in the Now Showing and Ticket pages. This script provides a function getCinemas() to...
-
A supplier has the following financial information available: Cash: $100,000 Current Assets: $1,000,000 Fixed Assets: $1,000,000 Total Assets: $2,000,000 Current Liabilities: $500,000 Total...
-
"What does Marx signify by the concept of 'economic determinism'?"
-
Adanac Corp. has a Defined Benefit Pension Plan (DBPP) and they are considering converting their plan to a Defined Contribution Pension Plan (DCPP). Why would Adanac Corp. convert from a DBPP to a...
-
The residents of Austin, Texas, complain that parking fines given in their city are higher than the parking fines that are given in Houston. Independent random samples of the amounts paid by...
-
Which of the following is NOT a magnetic dipole when viewed from far away? a) A permanent bar magnet. b) Several circular loops of wire closely stacked together with the same current running in each...
-
The data in Table 2 represent the length (in seconds) of a random sample of songs released in the 1970s. Find the median length of the songs. Approach Follow the steps listed above. Table 2 Song Name...
-
Yolanda wants to know how much time she typically spends on her cell phone. She goes to her phones website and records the call length for a random sample of 12 calls, shown in Table 3. Find the mean...
-
Find the median score of the data in Table 1. Approach Follow the steps listed on the previous page. Table 1 Student Score 1. Michelle 82 2. Ryanne 77 3. Bilal 90 4. Pam 71 5. Jennifer 62 6. Dave 68...
Ghosts Of Tsavo Stalking The Mystery Lions Of East Africa 1st Edition - ISBN: 0792241002 - Free Book
Study smarter with the SolutionInn App