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...
-
To make VLANs work, configuration tables are needed in the switches and bridges. What if the VLANs of Fig. 4-49(a) use hubs rather than multi drop cables? Do the hubs need configuration tables, too?...
-
A says "We are both knaves" and B says nothing. Exercises 24-31 relate to inhabitants of an island on which there are three kinds of people: knights who always tell the truth, knaves who always lie,...
-
The filament-wound E-glass/epoxy pressure vessel described in Example 4.4 is to be used in a hot-wet environment with temperature \(T=100^{\circ} \mathrm{F}\) \(\left(38^{\circ} \mathrm{C} ight)\)...
-
Jim Tallon, the consultant introduced at the beginning of section two of the chapter (p. 472), has obtained the following data relative to the Gibbs & Vaughan consulting job: Assume that the Wilkes...
-
Consider flow between two large parallel plates. Fluid is placed between two plates separated by a distance of 8. The upper plate at temperature T2 moves at velocity U while the lower plate at...
-
Four pesticides used in dormant California orchards are chlorpyrifos, diazinon, methidathion, and parathion. Environmental Science & Technology (Oct. 1993) reported the number of applications of...
-
Colbert sells 20 nonrefundable $100 gift cards for 3D printer paper on March 1, 2017. The paper has a standalone selling price of $100 (cost $80). The gift cards expiration date is June 30, 2017....
-
ASSUME A COMPANY. YOUR BUSINESS IS GOING INTERNATIONAL. 1. MENTION MISSION, VISION AND GOAL 2. STEPS TO CONSIDER AND WHY 3. DEFINE EACH FACTOR (POLITICAL, LEGAL, CULTURAL, ECONOMIC, SOCIAL ETC) IN...
-
Do you believe that Lafarge's actions in Syria were ethical or unethical? Use the four methods of ethical reasoning to support your view.
-
Why is a need to chart a positive direction for the future?
-
What is the difference between the American Association for Physical Activity and Recreation (AAPAR) and the National Association for Sport and Physical Education (NASPE)?
-
Suppose a spring with spring constant 6 N/m is horizontal and has one end attached to a wall and the other end attached to a mass. You want to use the spring to weigh items. You put the spring into...
-
Fund A has an expected return of 9.5%, a standard deviation of 15.6% and a beta of 0.95. Fund B has an expected return of 11.5%, a standard deviation of 17.8% and a beta of 1.10. The S&P 500 index...
-
How do the principles of (a) Physical controls and (b) Documentation controls apply to cash disbursements?
-
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.
-
Explain any four types of statistical analysis and their underlying statistical concepts. Describe how each of them has a unique role in the data analysis process.
-
Located in Tokyo, Japan, Sony Mobile Communications is a prominent competitor in the worldwide electronics equipment market. Because of stagnant sales in its ultra HD TVs, that division has decided...
-
Cory Rogers of CMG Research was happy to call Nick Thomas to inform him that Auto Concepts survey data were collected and ready for analysis. Of course, Cory had other marketing research projects and...
Study smarter with the SolutionInn App