Solution guidelines For problems that require you to provide an algorithm, you must provide: 1. pseudocode...
Fantastic news! We've Found the answer you've been seeking!
Question:
Transcribed Image Text:
Solution guidelines For problems that require you to provide an algorithm, you must provide: 1. pseudocode and, if helpful, a precise description of the algorithm in English. As always, pseudocode should include A clear description of the inputs and outputs Any assumptions you are making about the input (format, for example) Instructions that are clear enough that a classmate who hasn't thought about the prob- lem yet would understand how to turn them into working code. Inputs and outputs of any subroutines should be clear, data structures should be explained, etc. If the algorithm is not clear enough for graders to understand easily, it may not be graded. 2. a proof of correctness, 3. an analysis of running time and space. You may use algorithms from class as subroutines. You may also use facts that we proved in class. For full credit you need to find the most efficient algorithm. You should be as clear and concise as possible in your write-up of solutions. A simple, direct analysis is worth more points than a convoluted one, both because it is simpler and less prone to error and because it is easier to read and understand. 1. Unique topological order We've seen in class that a directed acyclic graph can have multiple topological orderings. However, some DAGS only have a single topological order. This problem will explore how to identify such graphs. Specifically, you will develop an algorithm to find the largest subgraph with a unique topological order. (a) (Not to be handed in) Here are examples of graphs. First decide which ones have unique topological orders. Try to draw some additional examples for yourself to help you figure out what makes a DAG have a unique topological order. Then formulate what type of maximum subgraph you should be looking for. f S (b) Design an algorithm that takes as input a DAG G (given to you in the form of an adjacency list implemented as a nested hash table) and returns the set of nodes in the subgraph G' that has a unique topological order, and has the most number of vertices among such subgraphs. h 9 Solution guidelines For problems that require you to provide an algorithm, you must provide: 1. pseudocode and, if helpful, a precise description of the algorithm in English. As always, pseudocode should include A clear description of the inputs and outputs Any assumptions you are making about the input (format, for example) Instructions that are clear enough that a classmate who hasn't thought about the prob- lem yet would understand how to turn them into working code. Inputs and outputs of any subroutines should be clear, data structures should be explained, etc. If the algorithm is not clear enough for graders to understand easily, it may not be graded. 2. a proof of correctness, 3. an analysis of running time and space. You may use algorithms from class as subroutines. You may also use facts that we proved in class. For full credit you need to find the most efficient algorithm. You should be as clear and concise as possible in your write-up of solutions. A simple, direct analysis is worth more points than a convoluted one, both because it is simpler and less prone to error and because it is easier to read and understand. 1. Unique topological order We've seen in class that a directed acyclic graph can have multiple topological orderings. However, some DAGS only have a single topological order. This problem will explore how to identify such graphs. Specifically, you will develop an algorithm to find the largest subgraph with a unique topological order. (a) (Not to be handed in) Here are examples of graphs. First decide which ones have unique topological orders. Try to draw some additional examples for yourself to help you figure out what makes a DAG have a unique topological order. Then formulate what type of maximum subgraph you should be looking for. f S (b) Design an algorithm that takes as input a DAG G (given to you in the form of an adjacency list implemented as a nested hash table) and returns the set of nodes in the subgraph G' that has a unique topological order, and has the most number of vertices among such subgraphs. h 9
Expert Answer:
Answer rating: 100% (QA)
Understood When providing a solution for a problem that requires an algorithm I will ensure to inclu... View the full answer
Related Book For
Introduction to Algorithms
ISBN: 978-0262033848
3rd edition
Authors: Thomas H. Cormen, Charles E. Leiserson, Ronald L. Rivest
Posted Date:
Students also viewed these programming questions
-
Listing 8.3 gives a program that finds two points in a two-dimensional space nearest to each other. Revise the program so that it finds two points in a three-dimensional space nearest to each other....
-
The table below shows the prices and quantities of the average household consumption basket (bundle) in two years. Using Year 1 is the base year, the inflation rate in the CPI is 5%. Is this...
-
Planning is one of the most important management functions in any business. A front office managers first step in planning should involve determine the departments goals. Planning also includes...
-
A company is deciding whether to produce a new gadget at a plant located in a country close to consumers at a higher labor cost and shorter lead time or to outsource it to a country with a low labor...
-
The two isotopes of uranium, 235U and 238 U (the superscripts refer to their atomic mass), can be separated by a gas-diffusion process by combining them with flouring to make the gaseous compound...
-
In Problem set up definite integrals that represent the shaded areas in the figure over the indicated intervals. Interval [b, c] y = f(x) a d y = g(x)
-
Mr. Jones was considering a new grapefruit venture that would generate a random sequence of yearly cash flows. He asked his son. Gavin, "People tell me I should use a cost of capital figure to...
-
In early 20X1, SpaceTel Communications, a U.S.-based international telephone communications company, purchased the controlling interest in Sofia Telecom, Ltd. (STL) in Bulgaria. A key productivity...
-
Before they become eligible to receive CPP retirement benefits, Lian and Cheng have calculated that they will have an essential expense gap of $1,450 per month between age 55 and age 60. Assuming a...
-
The Gilbert Air-Conditioning Company is considering the purchase of a special shipment of portable air conditioners manufactured in Japan. Each unit will cost Gilbert $80, and it will be sold for...
-
In the regression Y = B1 + BX + u, what is the estimate of B? Y - 3 X O, X, Y, O Y + BX O (X-X)(Y-Y) 2 (X-X)
-
a. For the allowed energies of a particle in a box to be large, should the box be very big or very small? Explain. b. Which is likely to have larger values for the allowed energies: an atom in a...
-
To have the best resolution, should an electron microscope use very fast electrons or very slow electrons? Explain.
-
X rays with a wavelength of \(0.20 \mathrm{~nm}\) undergo first-order diffraction from a crystal at a \(54^{\circ}\) angle of incidence. At what angle does first-order diffraction occur for...
-
The molecules in the rods and cones in the eye are tuned to absorb photons of particular energies. The retinal molecule, like many molecules, is a long chain. Electrons can freely move along one...
-
The spacing between atomic planes in a crystal is \(0.110 \mathrm{~nm}\). If \(12.0 \mathrm{keV} \mathrm{x}\) rays are diffracted by this crystal, what are the angles of (a) first-order and (b)...
-
48. In terms of time line and travel; endocrine system has longer control but slower travel as compared to nervous system. True CFalse 49. Sarcomere is the functional unit of myofibril and it is...
-
APC16550D UART has a clock running at18.432 MHz and its baud rate is set to 2000.Determine the HEX contents of its DLM and DLL registers. Please can you explain step by step and in detail how you get...
-
Suppose that in a 0-1 knapsack problem, the order of the items when sorted by increasing weight is the same as their order when sorted by decreasing value. Give an efficient algorithm to find an...
-
Let X be a nonnegative random variable, and suppose that E [X] is well defined. Prove Markov?s inequality: Pr {X > t} < E [X]/t
-
Verify axiom 2 of the probability axioms for the geometric distribution.
-
We normally think that dissipative forces tend to decrease the velocity of an object. This is correct for isolated systems. Consider the case of an artificial satellite of mass \(m\) in a circular...
-
Determine the work required to transport \(10 \mathrm{~kg}\) of material from Earth to the ISS, the International Space Station, in orbit \(420 \mathrm{~km}\) above the Earth's surface.
-
An artificial satellite of mass \(m=3.4\) ton is in a circular orbit at the altitude \(h_{1}=5000 \mathrm{~km}\). Due to various causes, it gradually loses energy and reaches an altitude \(h_{2}=600...
Study smarter with the SolutionInn App