. Consider the graph below. You start at point A and wish to reach point B,...
Fantastic news! We've Found the answer you've been seeking!
Question:
Transcribed Image Text:
. Consider the graph below. You start at point A and wish to reach point B, only going downward at each step. When traveling an edge, you must pay the toll value associated with it. You wish to compute a path from A to B whose total cost is as small as possible. 4 G 2 6 2 5 3 The general problem is as follows: you are given a directed acyclic graph (DAG) with n vertices (named 1, 2,...,n), and a list of m edges (u, v) where u <v for every edge. You are also given a list of the edges' toll costs, written wuv for each edge (u, v). The goal is to compute a path of minimum cost from vertex 1 to n. The graph above gives one such example setup, but you should consider graphs with nodes that have an arbitrary number of edges. Assume that ⚫ each node v > 1 has at least an edge from a smaller node u < v to v, (u, v); • each node x <n has at least an edge to a larger node y > x, (x, y). This guarantees that there is a path from the first node to the last node. (a) Consider the following local search algorithm for this problem: start at vertex 1 and always traverse down the edge with the lowest possible cost until reaching n. What total cost will this algorithm yield for the above map? Is it optimal? (b) Describe a naïve algorithm for this problem such that the time complexity of this algo- rithm is O(2"), as a function of the number of vertices n. (c) Describe a dynamic-programming algorithm to solve this problem. Prove its correctness, and find its runtime as a function of m and n using big-O notation. . Consider the graph below. You start at point A and wish to reach point B, only going downward at each step. When traveling an edge, you must pay the toll value associated with it. You wish to compute a path from A to B whose total cost is as small as possible. 4 G 2 6 2 5 3 The general problem is as follows: you are given a directed acyclic graph (DAG) with n vertices (named 1, 2,...,n), and a list of m edges (u, v) where u <v for every edge. You are also given a list of the edges' toll costs, written wuv for each edge (u, v). The goal is to compute a path of minimum cost from vertex 1 to n. The graph above gives one such example setup, but you should consider graphs with nodes that have an arbitrary number of edges. Assume that ⚫ each node v > 1 has at least an edge from a smaller node u < v to v, (u, v); • each node x <n has at least an edge to a larger node y > x, (x, y). This guarantees that there is a path from the first node to the last node. (a) Consider the following local search algorithm for this problem: start at vertex 1 and always traverse down the edge with the lowest possible cost until reaching n. What total cost will this algorithm yield for the above map? Is it optimal? (b) Describe a naïve algorithm for this problem such that the time complexity of this algo- rithm is O(2"), as a function of the number of vertices n. (c) Describe a dynamic-programming algorithm to solve this problem. Prove its correctness, and find its runtime as a function of m and n using big-O notation.
Expert Answer:
Related Book For
Posted Date:
Students also viewed these programming questions
-
In a Hopfield neural network configured as an associative memory, with all of its weights trained and fixed, what three possible behaviours may occur over time in configuration space as the net...
-
Briefly describe ASCII and Unicode and draw attention to any relationship between them. [3 marks] (b) Briefly explain what a Reader is in the context of reading characters from data. [3 marks] A...
-
Glencoe First National Bank operated for years under the assumption that profitability can be increased by increasing dollar volumes. Historically, First Nationals efforts were directed toward...
-
The Gerard Tire Company manufactures racing tires for bicycles. Gerard sells tires for $90 each. Gerard is planning for the next year by developing a master budget by quarters. Gerard's balance sheet...
-
Flower Childs is a regional sales manager for Green-Grow, Inc., a producer of garden supplies. The company's fiscal year ends on April 30. In mid-April, Flower is contacted by the president of...
-
Describe and illustrate the differences among design defects, manufacturing defects, inadequate warnings and labels (marketing defects), and breach of express and implied warranties.
-
A bottled water distributor wants to estimate the amount of water contained in 1 gallon bottles purchased from a nationally known water bottling company. The water bottling companys specifications...
-
What piece of hardware connects a peripheral device like a keyboard or mouse to the system bus? 1 point a device driver a device controller a semaphore a network port
-
Assuming that yesterday's closing price of the S & P 500 was 1000, the daily logarithmic return volatility estimated using the GARCH (1,1) model was 1.2 per cent. The parameters of GARCH model are =...
-
If you see your boss violate ethical codes of conduct and mishandle client information on multiple occasions, you know he or she should be disciplined for it. If you try to go over your boss's head...
-
A patient's insurance card usually shows Question 36 options: the name of the payer's representative the former employer's name the date the policyholder first paid a premium or copayment none of the...
-
IF SOURCES ARE USED, CITE THEM; THEREORE, I CAN FURTHER UNDERSTAND THE PROBLEM. CoCs are required to widely advertise their coordinated entry system and offer both physical and virtual points of...
-
Explain why effective and efficient utilisation of information is necessary to logistics and supply chain managers. Discuss the six types of information systems and provide logistics application for...
-
The chemical benzene is highly toxic to humans. However, it is used in the manufacture of many medicine dyes, leather, and many coverings. In any production process involving benzene, the water in...
-
Representative data read from a plot that appeared in the paper Effect of Cattle Treading on Erosion from Hill Pasture: Modeling Concepts and Analysis of Rainfall Simulator Data (Australian Journal...
-
The catalytic hydrogenation of methyl linoleate to methyl oleate was carried out in a laboratory-scale slurry reactor in which hydrogen gas was bubbled up through the liquid containing spherical...
-
With the increasing demand for xylene in the petrochemical industry, the production of xylene from toluene disproportionation has gained attention in recent years (Ind. Eng. Chem. Res., 26, 1854...
-
Using a negative step tracer input, Cholette and Cloutier (Can. J. Chem. Eng., 37, 107 (1959)) studied the RTD in a tank for different stirring speeds. Their tank had a 30-in. diameter and a fluid...
-
Suppose a species of bacteria divides once every 20 minutes. You start with a single bacterium on your unrefrigerated egg-and-baloney sandwich at 8:00 am. Show that when you sit down to lunch at...
-
If two species belong to the same order, do they have to belong to the same class? Do they have to belong to the same genus?
-
The lightest and heaviest flying birds are the bee hummingbird of Cuba, which weighs about 1.6 grams, and the great bustard of Europe and Asia, which can weigh as much as 21 kilograms. Show that the...
Study smarter with the SolutionInn App