3 Pages

hw4

Course: CS 521, Winter 2009
School: Washington
Rating:
 
 
 
 
 

Word Count: 931

Document Preview

521: CSE Design and Analysis of Algorithms Assignment #4 January 27, 2005 Due: Wednesday, February 2 Reading Assignment: Kleinberg and Tardos, Network Flow, handout on linear programming, section 11.6 in new book. Problems: 1. Let G = (V, E) be a graph with n nodes in which each pair of nodes is joined by an edge. There is a positive weight wij on each edge (i, j); and we will assume these weights satisfy the...

Register Now

Unformatted Document Excerpt

Coursehero >> Washington >> Washington >> CS 521

Course Hero has millions of student submitted documents similar to the one
below including study guides, practice problems, reference materials, practice exams, textbook help and tutor support.

Course Hero has millions of student submitted documents similar to the one below including study guides, practice problems, reference materials, practice exams, textbook help and tutor support.
521: CSE Design and Analysis of Algorithms Assignment #4 January 27, 2005 Due: Wednesday, February 2 Reading Assignment: Kleinberg and Tardos, Network Flow, handout on linear programming, section 11.6 in new book. Problems: 1. Let G = (V, E) be a graph with n nodes in which each pair of nodes is joined by an edge. There is a positive weight wij on each edge (i, j); and we will assume these weights satisfy the triangle inequality wik wij +wjk . For a subset V V , we will use G[V ] to denote the subgraph (with edge weights) induced on the nodes in V . We are given a set X V of k terminals that must be connected by edges. We say that a Steiner tree on X is a set Z so that X Z V , together with a sub-tree T of G[Z]. The weight of the Steiner tree is the weight of the tree T . Show that there is function f () and a polynomial function p() so that the problem of finding a minimum-weight Steiner tree on X can be solved in time O(f (k) p(n)). Hint: Here is Yiannis's hint from last year. "In case you're wondering if a Steiner tree can contain vertices not in X, consider the following example. "V1 , V2 , V3 X, form a triangle connected with edges of weight 7. "Consider a vertex V4 in the middle, not in X, connected with the other 3 using edges of weight 4. "Observe the triangle inequality holds. "The Steiner tree of minimum weight would be to select the middle edges and not two of the triangle. "In fact, since your graph needs to satisfy the triangle inequality, a good idea is to think of edge weights as the distance between the vertices. Therefore, drawing examples on scratch paper could be quite informative and give you ideas about a solution..." 1 Additional hint: You should think about minimum spanning trees. And as with all dynamic programming problems, you should build up the bigger solution by solving smaller problems. 2. The problem of searching for cycles in graphs arises naturally in financial trading applications. Consider a firm trades shares in n different companies. For each pair i = j they maintain a trade ratio rij meaning that one share of i trades 2 for rij shares of j. Here we allow the rate r to be fractional, i.e., rij = 3 means that you can trade 3 shares of i to get a 2 shares of j. A trading cycle for a sequence of shares i1 , i2 , . . . , ik consists of successively trading shares in company i1 for shares in company i2 , then shares in company i2 for shares i3 , and so on, finally trading shares in ik back to shares in company i1 . After such a sequence of trades, one ends up with shares in the same company i1 one that starts with. Trading around a cycle is usually a bad idea, as you tend to end up with fewer shares than what you started with. But occasionally, for short periods of time, there are opportunities to increase shares. We will call such a cycle an opportunity cycle, if trading along the cycle increases the number of shares. This happens exactly if the product of the ratios along the cycle is above 1. In analyzing the state of the market, a firm engaged in trading would like to know if there are any opportunity cycles. Give a polynomial time algorithm that finds such an opportunity cycle, if one exists. 3. One way to assess how "well-connected" two nodes in a directed graph are is to look not just at the length of the shortest path between them, but also to count the number of shortest paths. This turns out to be a problem that can be solved efficiently, subject to some restrictions on the edge costs. Suppose we are given a directed graph G = (V, E), with costs on the edges; the costs may be positive or negative, but every cycle in the graph has strictly positive cost. We are also given two nodes v, w V . Give an efficient algorithm that computes the number of shortest v-w paths in G. (The algorithm should not list all the paths; just the number suffices.) 4. Hidden surface removal is a problem in computer graphics that scarcely needs an introduction -- when Woody is standing in front of Buzz you should be able to see Woody but not Buzz; when Buzz is standing in front of Woody, . . . well, you get the idea. The magic of hidden ...

Find millions of documents on Course Hero - Study Guides, Lecture Notes, Reference Materials, Practice Exams and more. Course Hero has millions of course specific materials providing students with the best way to expand their education.

Below is a small sample set of documents:

Washington - CS - 521
CSE 521: Design and Analysis of Algorithms Assignment #5 February 2, 2005 Due: Wednesday, February 9Reading Assignment: Kleinberg and Tardos, Network Flow, handout on linear programming Problems: 1. Your friends have written a very fast piece of ma
Washington - CS - 521
CSE 521: Design and Analysis of Algorithms Assignment #6 Due: Wednesday, February 16Reading Assignment: Linear programming handouts, chapter on randomized algorithms, other randomized algorithms handouts (we'll send out mail about them.) Problems:
Washington - CS - 521
CSE 521: Design and Analysis of Algorithms Assignment #7 Due: Wednesday, Feb 23Problems:1. QuickSelect is the following simple algorithm for finding the k-th smallest element in an unsorted set S. QuickSelect(S, k): (a) Pick a pivot element p uni
Washington - CS - 521
Name:1 2 3 4 total/ 9 /10 /16 /39 /74CSE 521 Final ExamMarch 15, 2004 Instructions: You have 1 hour and 50 minutes to complete the exam. The exam is closed book, closed notes. Please do not turn the page until you are instructed to do so.
Washington - CS - 421
Measuring efficiency: The RAM modelnRAM = Random Access Machine Time # of instructions executed in an ideal assembly languagennComplexity and Representative ProblemsWinter 2005 Paul Beameneach simple operation (+,*,-,=,if,call) takes on
Washington - CS - 421
Undirected Graph G = (V,E)1 2 3 11 10Graph TraversalWinter 2005 Paul Beame12 4 5 6 7 8 13 9Directed Graph G = (V,E)1 2 3 11 12 4 5 6 7 8 13 9n n nGraph TraversalLearn the basic structure of a graph Walk from a fixed starting vertex s to
Washington - CS - 421
Greedy AlgorithmsnHard to define exactly but can give general propertiesn nGreedy AlgorithmsWinter 2005 Paul BeamenSolution is built in small steps Decisions on how to build the solution are made to maximize some criterion without looking t
Washington - CS - 421
Dynamic ProgrammingnDynamic ProgrammingnGive a solution of a problem using smaller sub-problems where all the possible sub-problems are determined in advance Useful when the same sub-problems show up again and again in the solutionDynamic Pro
Washington - CS - 421
Bipartite MatchingnnGiven: A bipartite graph G=(V,E)ME is a matching in G iff no two edges in M share a vertexnNetwork FlowWinter 2005 Paul BeameGoal: Find a matching M in G of maximum possible sizeBipartite MatchingBipartite Matchin
Washington - CS - 421
Dealing with NP-completenessWinter 2005 Paul BeameWhat to do if the problem you want to solve is NP-hardnYou might have phrased your problem too generallyne.g., in practice, the graphs that actually arise are far from arbitrary n maybe they
Washington - CSE - 590
Washington - CSEP - 590
Homeland Security / Cyber Security Autumn 2005N.B. CONTINUALLY IN FLUX Version 24: November 22 Course Requirements: Red Team Exercise (~25%): You are a member of a 5-6 person team of engineers and policy professionals that has been hired by the Depa
Washington - CSEP - 590
Homeland Security / Cyber Security Autumn 2005N.B. CONTINUALLY IN FLUX Version 24: November 22 Course Requirements: Red Team Exercise (~25%): You are a member of a 5-6 person team of engineers and policy professionals that has been hired by the Depa
Washington - CSEP - 590
CSE P 590TU: Homeland Security / Cyber Security Course Grade Histogram for UW Students4.0 3.9 3.8 3.7 3.6 3.5 3.4 3.3 3.2 3.1 3.0X X X X X X X X X XX X X X X X X X X XX X X X X X X X X X X X X X X X X X X X X X X X X
Washington - CSEP - 590
Red Team ReportHemavathy Alaganandam Parvez Anandam Jameel Alsalam Yi-Kai Liu Pravin Mittal Elena Rodriguez-Vieitez Santeri VoutilainenUniversity of Washington CSE P 590TU UC Berkeley PP 190/290-009 UCSD CSE 291 (C00) Christine Hartmann-Siantar P
Washington - CSEP - 590
Buffer Overflows: Implications for Civilian CybersecurityAndrew Hoskinsahoskins@microsoft.comMark O. Ihimoyanmark.ihimoyan@microsoft.comAdeel Rasul Iqbalaiqbal@uclink.berkeley.eduKeunwoo Leeklee@cs.washington.eduThanh Nhut Nguyenttnguye
Washington - CSEP - 590
Homeland Security / Cyber Security Autumn 2005 Course Project ("White Paper") Assignment, and Topic SuggestionsVersion 5: November 2 White Paper (~55%): Teams of 3-5 students will provide a comprehensive report describing a particular threat, assess
Washington - CSEP - 590
Homeland Security / Cyber Security Autumn 2005 Course Project ("White Paper") Assignment, and Topic SuggestionsVersion 5: November 2 White Paper (~55%): Teams of 3-5 students will provide a comprehensive report describing a particular threat, assess
Washington - CSEP - 590
Homeland Security / Cyber SecurityChris Hartmann-Siantar, Lawrence Livermore National Laboratory Ed Lazowska, UW Computer Science & Engineering Steve Maurer, UC Berkeley Goldman School of Public Policy Stefan Savage, UCSD Computer Science & Engineer
Washington - CSEP - 590
Information Technology and Public PolicyEd Lazowska, Computer Science & Engineering, University of Washington Steve Maurer, Goldman School of Public Policy, University of California Berkeley Notes for presenters Students will be located at four site
Washington - CS - 321
CSE 321: Discrete Structures Assignment #1 January 7, 2009 Due: Wednesday, January 14Reading Assignment: Read Sections 1.1 - 1.4 carefully (make sure that you understand the examples). Problems: 1. Let p, q, r be the propositions. p You get sued by
Washington - CS - 321
CSE 321: Discrete Structures Assignment #2 January 15, 2009 Due: Thursday, January 22, in SectionReading Assignment: Sections 1.5 1.7 and handout on logic. Problems: 1. Determine the truth value of xy(x y 2 ) when the universe of discourse is the
Washington - CS - 321
CSE 321: Discrete Structures Assignment #3 January 22, 2009 Due: Wednesday, January 28, in ClassReading Assignment: Sections 2.1 2.3, and 3.4 3.6. Problems: 1. Section 1.6, exercise 28. 2. Prove that if you pick 10 numbers from 1 to 1000, then th
Washington - CS - 321
CSE 321: Discrete Structures Assignment #4 January 28, 2009 Due: Wednesday, February 4, in classReading Assignment: Sections 3.4 3.7 and 4.1 4.2. Problems: 1. Let a, b and c be integers. Prove that if a does not divide bc, then a does not divide
Washington - CS - 321
CSE 321: Discrete Structures Assignment #5 February 4, 2009 Due: Wednesday, February 11, in classReading Assignment: Sections 4.1 4.3 and 5.1. Problems: 1. Which amounts of money can be formed using just dimes and quarters? Prove your answer using
Washington - CS - 321
CSE 321: Discrete Structures Assignment #5 February 15, 2009 Due: Friday, February 20, in classReading Assignment: Sections 5.1 5.4. Justify your answers to the following problems. Problems: 1. Assume that friendship is always mutual; that is, if
Washington - CS - 321
CSE 321: Discrete Structures Assignment #7 February 20, 2009 Due: Wednesday, February 25, in classReading Assignment: Sections 6.1 6.4. Justify your answers to the following problems. You do not need to provide explicit numbers for permutations an
Washington - CS - 321
CSE 321: Discrete Structures Assignment #8 February 25, 2009 Due: Wednesday, March 4, in classReading Assignment: Read Sections 6.1 6.4, 8.1 8.2. Problems: 1. (a) Prove or disprove: If events E and F are independent, then so are their complementa
Washington - CS - 321
CSE 321: Discrete Structures Assignment #9 March 4, 2009 Due: Friday, March 13, in classReading Assignment: Read Sections 8.1 8.5, 9.1 9.5. Problems: 1. For the relation R = {(b, c), (b, e), (c, e), (d, a), (e, b), (e, c)} on {a, b, c, d, e}, dra
Washington - CS - 321
Discrete Structures LogicChapter 1, Sections 1.11.4Dieter FoxD. Fox, CSE-321Chapter 1, Sections 1.11.40-0Outline Propositional Logic Propositional Equivalences First-order LogicD. Fox, CSE-321Chapter 1, Sections 1.11.40-1Proposit
Washington - CS - 321
Supplementary Logic NotesCSE 321 Winter 200911.1Propositional LogicMore efcient truth table methodsThe method of using truth tables to prove facts about propositional formulas can be a very tedious procedure, especially if the formulas conta