UNIVERSITY of OSLO. Faculty of Mathematics and Natural Sciences. INF 4130/9135: Algorithms: Design and efficiency Date of exam: 8th December 2016

Size: px
Start display at page:

Download "UNIVERSITY of OSLO. Faculty of Mathematics and Natural Sciences. INF 4130/9135: Algorithms: Design and efficiency Date of exam: 8th December 2016"

Transcription

1 UNIVERIY of OLO Faculty of Mathematics and Natural ciences Exam in: INF 4130/9135: Algorithms: Design and efficiency Date of exam: 8th December 2016 Exam hours: 09:00 13:00 (4 hours) Exam paper consists of: 6 pages (including attachment) Attachment: 1 page Permitted materials: All written and printed Make sure that your copy of this examination paper is complete before answering. You can give your answers in English or in Norwegian, as you like. Read the text carefully, and good luck! Including answers Assignment 1 (16%) Note: his exercise can be answered without any knowledge of bio-informatics, DNA or amino acids, we are really just looking at strings. Question 1.a We are given a string = AAA. Your tasks: (1) Draw an uncompressed suffix tree for string. (2) Use your drawing to explain what the specific running time for checking whether the pattern P = AAA is a substring of is. Let processing of one letter in P represent one step, and use that as the unit in your answer. Do not include the running time for building the suffix tree. (3) Give a general expression for the running time for a pattern of n letters. Answer 1.a he suffixes of = AAA are as follows: A AA AAA 1

2 A A A earching for the pattern P = AAA will have a running time of 6 (steps) (indicated in white). he general expression for a pattern of length n is O(n). Question 1.b is part of a slightly longer string ꞌ = AAGGAAAA. his longer string happens to be a DNA sequence encoding the amino acid sequence a = KDK. he encoding is simply a translation where triples of letters in the DNA sequence are mapped into letters of a different alphabet. he alphabet for DNA sequences consists of four letters; so there are 4 3 = 64 possible triplets that map to an alphabet of about 20 letters representing the amino acids. In our example we have the following five mappings: AAG = K, GA = D, AAA = K, =, =. Your tasks: (1) Draw an uncompressed suffix tree for string a. (2) Use your drawing to explain what the specific running time for checking whether the pattern P a = K is a substring of a is. Let processing of one letter in P a represent one step, and use that as the unit in your answer. Do not include the running time for building the suffix tree. 2

3 (3) ompare this running time with the one from Question 1.a. In reality we searched for the same string. What part does the encoding (the length of the input) play here? Answer 1.b he suffixes of = AAA are as follows: K DK KDK D K K D K earching for the pattern P a = K will have a running time of 2 (steps) (indicated in white). When we represent three letters from 1.a as one letter here in 1.b, comparing two letters will not be directly comparable operations. In 1.a we can assume that one letter comparison will consist of 2 bit comparisons (assuming four letters in the alphabet). In 1.b on letter comparison will consist of 2*3 bit comparisons. his makes up for the difference in running time when we only count steps: 6 steps (6*2 = 12 bit comparisons ) versus 2 steps (2*2*3 = 12 bit comparisons ). Question 1.c he Horspool variant if the Boyer-Moore algorithm is also an option for checking whether the pattern P = AAA is part of the string = AAA. ompute the shift values as used by the Horspool algorithmm, the alphabet is A = {A,,G, (the four letters used to make up DNA sequences). Answer 1.c hift (A) = 3, hift () = 1, hift (G) = 6, hift() = 2. 3

4 Assignment 2 (20%) We are given a boolean matrix B with values either (true) or F (false), and with indices i from 0 to m-1 and j from 0 to n-1. he aim is to find the size of the largest (connected) square within the matrix containing only values (and by size of a square we mean the length of the edges). For a given matrix B we shall denote this maximal size max(b), and we will find its value using dynamic programming. By definition we shall say that, if B contains only F-values, then max(b)=0. A sub-square of the matrix with only -values is called a -square. In the figure below a matrix B (with m=6 and n=7) is given, and blank entries have value F. We see that in this case max(b) = 3. We will use an integer matrix of size m x n as a table for our computation. We give two alternatives for what the element [i, j] ( i=0 to n-1, j=0 to n-1 ) should contain, but it turns out that only one of them will work properly for our task. In 2.b you will have to decide which one this is. 1. [i, j] contains the size of the largest -square within the rectangular area between B[0,0] and B[i, j]. 2. [i, j] contains the size of the largest -square that includes B[i, j] in the rectangular area between B[0,0] and B[i, j]. Question 2.a he initialization of the first row and the first column (for i = 0 or j = 0) of the table will depend on whether you use rule 1 or 2 above. Describe for each of these cases how you would initialize the matrix. You can describe it either in English/Norwegian, or by sketching a few program lines for each of the cases. Answer 2.a he answers for Rule 1 and for Rule 2 are: // Rule 1 (Value 1 if a occurres earlier or now in the row/column, otherwise 0): boolean haveeen; int i, j; haveeen = false; for (i = 0; i < m; i++) { if (B[i,0] == true) { haveeen = true; // or only: if (B[i,0]) { haveeen = true; if (haveeen == true) { [i, 0] = 1; else { [i, 0] = 0; haveeen = false; for (j = 0; j < n; j++) { 4

5 if (B[0,j] == true) { haveeen = true; if (haveeen == true) { [0, j] = 1; else { [0, j] = 0; // Rule 2 (Value 1 if the corresponding entry in B is, otherwise 0): int i, j; for (i = 0; i < m; i++) { if (B[i,0] == true) { [i, 0] = 1; else { [i, 0] = 0; for (j = 0; j < n; j++) { if (B[0,j] == true) { [0, j] = 1; else { [0, j] = 0; Question 2.b You shall here find a recurrence formula that can solve the problem above for i > 0 and j > 0. For this you should choose the most suited of the rules 1 and 2 above, and write the recurrence formula you obtain with this rule. Explain why your formula will work, and why it won t miss any of the possible -squares. Answer 2.b It seems difficult to solve this problem with rule 1 above, but with rule 2 we can try with the following recurrence formula : for 0 < i < m and 0 < j < m: if (B[i, j] == false) { // Or if (! B[i, j] ) [i, j] = 0; else { [i, j] = min([i-1, j], [i, j-1], [i-1, j-1]) + 1; Here the first case is easy to verify: When B[i, j] == false we can obviously not have any - square that includes B[i, j] at all, and then [i, j] = 0 is correct. However, if B[i, j] == true, then [i, j] should be at least 1, and from a simple drawing one will see that [i, j] cannot be larger than any of the three values: (1): [i, j-1] +1 (2): [i-1, j] +1 (3): [i-1, j-1] +1 F somewhere here ase (1), and by symmetry case (2), above: j j B: : i i 3? B[i, j-1] [i, j-1] annot be larger than 4 5

6 F somewhere here j B: : i ase (3): i 3? j B[i-1, j-1] [i-1, j-1] annot be larger than 4 Also if: m = min( [i-1, j], [i, j-1], [i-1, j-1] ) + 1 then we will know that there will be a -square (with B[i, j] as its lower right corner) of size m as indicated by the following figure: All here, because of (3) B: i j All here, because of (2) All here, because of (1) here, because of the if-test hus, as all possible -squares must have a lower right corner, and we have been through all possibilities for such a corner, we must find the largest of these by the above procedure. Question 2.c Write a procedure/method/function max( ) that receives the matrix B and its size as parameter(s), generates and fills the matrix, and delivers the size of the largest -square of B. Also include the initialization. Note that we are only interested in the size of the largest - square, not where it is positioned. You may generate the matrix by the following statement (or something corresponding to that): = new integer array[m, n] 6

7 Answer 2.c In a suitably language, it can be written as follows: integer function max(boolean array B[m, n], integer m, integer n) { integer i, j, maxize; for (i = 0; i < m; i++) { if (B[i,0] == true) { [i, 0] = 1; else { [i, 0] = 0; for (j = 1; j < n; j++) { // We don t look at B[0, 0] twice if (B[0,j] == true) { [0, j] = 1; else { [0, j] = 0; maxize = 0; for ( i =1, i < m, i++) { for (j = 1; j < n; j++) { if (B[i, j] == false) { [i, j] = 0; else { [i, j] = 1 + min([i-1, j], [i, j-1], [i-1, j-1]); if ([i, j] > maxize) maxize = [i, j]; // an be moved to the else-case above return maxize; Question 2.d Evaluate briefly whether or not a top-down (recursive) dynamic programming solution would be preferable for the above problem. Answer 2.d his was probably not easy, so we considered it a reasonable answer to say something like: here seem to be no obvious way to avoid making recursive calls for all the n x m entries of B. Notice e.g. that if B contain only F-values except for one -value, this -value can occur anywhere in B (e.g. in the corners), so we cannot stop the recursion without looking into all corners. It is not a good answer if you indicate that you can avoid making recurive calls if B[i, j] = false. his will not work! hus, with the well-known overhead connected to calling recursive functions, a top-down method will probably use more time than a bottom up version. If we are very eager to find ways to avoid looking through all entries in B, one way we could consider is to try to detect situations satisfying the following conditions: (1) you have already found a -square of size s, (2) you know that no -square in the explored area can be extended (e.g. because of a full column/row of F-values) and (3) the length of the smallest dimension of the unexplored territory do not exceed s. If all these conditions are satisfied, 7

8 you can obviously stop the search for a larger -square. However, to detect such a situation in an efficient way seems difficult. In addition, it will probably not occur very often. Assignment 3 (16%) Which of the following languages are undecidable? Prove your answers. Question 3.a {M uring machine M never writes anything on its tape when started on a blank input Question 3.b {M uring machine M never writes an A on its tape when started on a blank input Question 3.c {M Whenever uring machine M writes an A on its tape, it writes a B immediately afterwards, when started on a blank input Answer 3.a, 3.b and 3.c a. Decidable without righting anything on its tape, after a constant number of steps (equal to the number of states of M), M must repeat the same state and reveal that it is in an infinite loop. o a decision procedure needs to simulate M only a constant number of steps to find the answer. b. Undecidable proof by a modification of the standard reduction from the Halting problem, where M is imulate M on x (the M and the x that are the instance of Halting) and writes an A. It must also be secured that an A cannot be written otherwise (for ex. By replacing A in the alphabet by another symbol). wap Yes and No to get the answer to Halting. c. Undecidable the proof is the same as in (b). Assignment 4 (12%) When NP-complete problems occur in practice there are often special conditions that might make the problem simpler. Are the following simplified versions of the corresponding known NP-complete problems still NP-complete? Prove your answers. Question 4.a While studying DM (three-dimensional matching), we used an example with triples as compatibility constraints, each consisting of a boy, a girl and a car. However, in a real case all that matters is that the boy and the girl like the same car model of which there are of course many instances available. Model this problem as a graph problem. Is the problem still NP-complete? 8

9 Question 4.b Regarding the clique problem (to determine if input graph G has a complete graph of K nodes), one might say that the cliques are a subject of concern only when they become too large. Is the clique problem still NP-complete if the input instance is only a graph G, and the associated question is whether G has a clique that includes at least one half of its vertices? Answer 4.a and 4.b a. he problem is no longer NP-complete. It becomes the matching problem when a compatible pair (a boy and a girl) have no car model that they both like, their compatibility (edge) is removed; then the problem is solved by a bipartite matching algorithm. b. he problem remains NP-complete. he proof is an easy reduction from the clique, where we create an instance G of the new problem by adding m vertices to the input graph G. m is chosen so that m + k = (m + n) / 2. Each of the new m vertices is made adjacent to every vertex in G, and to all other new vertices. hen the new graph G has a clique that includes half of its vertices ((m + n) / 2) if and only if G has a clique of size k. Assignment 5 (16%) We are given the following set P of points in the plane: p 1 p 2 p 3 p 4 p 5 p 6 p 7 Figure 1. Point set P Question 5.a he convex hull of point set P is uniquely defined. Describe the convex hull of P by listing its corners in a well-ordered manner. Answer 5.a he corners must be given either clockwise or counter clockwise order, from an arbitrarily chosen staring point when we describe a polygon. ounter clockwise is the most common way. o, for instance: 9

10 H = p6, p7, p3, p1, p2. (H = p1, p3, p7, p6, p2 is also OK) (BU H = p1, p2, p3, p6, p7 is NO correct) Question 5.b here are many triangulations of the point set P. Draw the Delaunay triangulation of P. Justify/prove your answer. Answer 5.b ee figure. Quadrangles p6, p5, p4, p2 and p5, p7, p3, p4 may have confused the students. It is hard to see by looking at the drawing whether these four points lie on the same circle or not. Assuming they do, both possible triangulations of each of the quadrangles are legal Delaunay triangulations. Assuming they don t, one must argue that p5 lies outside the circumcircle of triangles p6, p4, p2 and p7, p4, p3. An argument based on circumcircles is what is required, both assumptions for quadrangles p6, p5, p4, p2 and p5, p7, p3, p4 (all four points on the same circle, or p5 outside) should be considered correct. Question 5.c Draw another triangulation of P and explain why it is not a Delaunay triangulation. Answer 5.c A triangulation containing p6, p1, p2 as a triangle will for instance be particularly bad. You may use the copy of Figure 1 included twice in the appendix to give your answers for Question 5.b and 5.c above. ear out the page and hand it in with the white version of your answers. 10

11 Assignment 6 (20%) Below you find questions from different areas discussed in the course. In your answers you can use facts included in the curriculum, even if no proof is given there. Question 6.a Alice claims that, in a general graph with a given matching M, there will always be an augmenting path (relative to M) if there exists a matching with more edges than in M. Bob says that Alice s claim is wrong If you think Alice is right give an argument showing that she is, otherwise give an example showing that Bob is right. Answer 6.a Here, Alice is right. he way one can prove this from facts discussed in the course is to look at the algorithm (with trees and blossoms etc.) for finding a matching with as many edges as possible in a general graph. It is stated there (without any proof) that if we have a matching M and there exists a larger matching, then this algorithm will find an augementing path. hus, it follows that Alice is right. Question 6.b In a (general) graph G, we shall say that a subset of nodes such that all edges have at least one end in the set is an edge covering set. We can easily prove that the size of is at least as large as (the number of edges in) any matching M in G (and you need not prove that). We look at the following claims: Alice: In a (general) graph, there will always be a matching M and an edge covering set so that the sizes of M and are the same. Bob says that Alice s claim is wrong If you think Alice is right give an argument showing that she is, otherwise give an example showing that Bob is right. Answer 6.b Here Bob is right. he simple example is a triangle graph where a matching can have at most one edge, but two nodes are needed to cover all the edges. However, for bipartite graphs Alice s claim is correct. Question 6.c We consider the N-puzzle from the mandatory exercise, and the following two claims about heuristics for the A* algorithm: Alice: If we allow diagonal moves, and the cost of each move is 1, then the sum of the Manhattan distances between the current position and the correct position for all tiles is a non-monotone heuristic, but simply counting the number of misplaced tiles will be a monotone heuristic. he empty position does not count as a tile. Bob says that Alice s claim is wrong. If you think Alice is right, give an argument showing that she is, otherwise give an example showing that Bob is right. 11

12 Answer 6.c Here Alice is right. For the first part of her claim a simple drawing of a 2x2 board should suffice as an example: Here only one move is needed, but its Manhattan heuristic will be 2. his is against the requirements for monotone heuristics, which says that that the heuristics for a situation should never exceed the fewest number of steps to the final position. For the second part, we first state that the heuristic of the correct (final) situation is 0, as required. We then observe that in each move, at most one tile can move from an incorrect to a correct position, so that the heuristic for the whole board can diminish at most 1 in one move. hus, if we do one move from situation s1 to situations s2, we will know that h(s1) 1+h(s2), and the second requirement for monotonicity is therby satisfried. Question 6.d Alice claims that no NP-hard problems have a polynomial-time ɛ-approximation algorithm for ɛ = 0.1 Bob says that Alice s claim is wrong If you think Alice is right give an argument showing that she is, otherwise give an example showing that Bob is right. Answer 6.d Bob is right. It was shown in class that the 0-1 Knapsack and some other problems have Polynomial ime Approximation chemes algorithms that take /epsilon as part of the input instance, and produce a solution to that instance that is within the /epsilon interval from the optimum, in polynomial time (where the shape of the polynomial depends on /epsilon). Hence this is also true for the specific /epsilon, 0.1 Question 6.e Alice claims that all NP-hard problems have a polynomial-time ɛ-approximation algorithm for ɛ = 0.1 Bob says that Alice s claim is wrong If you think Alice is right give an argument showing that she is, otherwise give an example showing that Bob is right. Answer 6.e Bob is right. It was shown in class that the raveling alesperson s Problem has no /epsilon approximation for any constant /epsilon, unless P=NP. [END] 12

13 Attachment for answering Assignment 5 ide nr.: Emne : INF 4130 Kandidatnr. : Dato : 8. des, 2016 p 1 p 2 p 3 p 4 p 5 p 6 p 7 p 1 p 2 p 3 p 4 p 5 p 6 p 7 6

UNIVERSITY of OSLO. Faculty of Mathematics and Natural Sciences. INF 4130/9135: Algoritmer: Design og effektivitet Date of exam: 14th December 2012

UNIVERSITY of OSLO. Faculty of Mathematics and Natural Sciences. INF 4130/9135: Algoritmer: Design og effektivitet Date of exam: 14th December 2012 UNIVERSITY of OSLO Faculty of Mathematics and Natural Sciences Exam in: INF 40/9: Algoritmer: Design og effektivitet Date of exam: 4th December 202 Exam hours: 09:00 :00 (4 hours) Exam paper consists of:

More information

Faculty of Mathematics and Natural Sciences

Faculty of Mathematics and Natural Sciences UNIVERSITY of OSLO Faculty of Mathematics and Natural Sciences Exam in: INF 4130/9135: Algoritmer: Design og effektivitet Date of exam: 16th December 2013 Exam hours: 09:00 13:00 (4 hours) Exam paper consists

More information

1 Definition of Reduction

1 Definition of Reduction 1 Definition of Reduction Problem A is reducible, or more technically Turing reducible, to problem B, denoted A B if there a main program M to solve problem A that lacks only a procedure to solve problem

More information

ICS 161 Algorithms Winter 1998 Final Exam. 1: out of 15. 2: out of 15. 3: out of 20. 4: out of 15. 5: out of 20. 6: out of 15.

ICS 161 Algorithms Winter 1998 Final Exam. 1: out of 15. 2: out of 15. 3: out of 20. 4: out of 15. 5: out of 20. 6: out of 15. ICS 161 Algorithms Winter 1998 Final Exam Name: ID: 1: out of 15 2: out of 15 3: out of 20 4: out of 15 5: out of 20 6: out of 15 total: out of 100 1. Solve the following recurrences. (Just give the solutions;

More information

Subset sum problem and dynamic programming

Subset sum problem and dynamic programming Lecture Notes: Dynamic programming We will discuss the subset sum problem (introduced last time), and introduce the main idea of dynamic programming. We illustrate it further using a variant of the so-called

More information

CMSC Theory of Algorithms Second Midterm

CMSC Theory of Algorithms Second Midterm NAME (please PRINT in large letters): SECTION: 01 02 (circle one) CMSC 27200 Theory of Algorithms Second Midterm 02-26-2015 The exam is closed book. Do not use notes. The use of ELECTRONIC DEVICES is strictly

More information

Dynamic Programming Homework Problems

Dynamic Programming Homework Problems CS 1510 Dynamic Programming Homework Problems 1. Consider the recurrence relation T(0) = T(1) = 2 and for n > 1 n 1 T(n) = T(i)T(i 1) i=1 We consider the problem of computing T(n) from n. (a) Show that

More information

Triangulation and Convex Hull. 8th November 2018

Triangulation and Convex Hull. 8th November 2018 Triangulation and Convex Hull 8th November 2018 Agenda 1. Triangulation. No book, the slides are the curriculum 2. Finding the convex hull. Textbook, 8.6.2 2 Triangulation and terrain models Here we have

More information

Computational Geometry: Lecture 5

Computational Geometry: Lecture 5 Computational Geometry: Lecture 5 Don Sheehy January 29, 2010 1 Degeneracy In many of the algorithms that we have discussed so far, we have run into problems when that input is somehow troublesome. For

More information

Final Exam 2, CS154. April 25, 2010

Final Exam 2, CS154. April 25, 2010 inal Exam 2, CS154 April 25, 2010 Exam rules. he exam is open book and open notes you can use any printed or handwritten material. However, no electronic devices are allowed. Anything with an on-off switch

More information

Final Exam May 8, 2018

Final Exam May 8, 2018 Real name: CS/ECE 374 A Spring 2018 Final Exam May 8, 2018 NetID: Gradescope name: Gradescope email: Don t panic! If you brought anything except your writing implements and your two double-sided 8½" 11"

More information

CMPSCI611: The SUBSET-SUM Problem Lecture 18

CMPSCI611: The SUBSET-SUM Problem Lecture 18 CMPSCI611: The SUBSET-SUM Problem Lecture 18 We begin today with the problem we didn t get to at the end of last lecture the SUBSET-SUM problem, which we also saw back in Lecture 8. The input to SUBSET-

More information

Solutions to Problem 1 of Homework 3 (10 (+6) Points)

Solutions to Problem 1 of Homework 3 (10 (+6) Points) Solutions to Problem 1 of Homework 3 (10 (+6) Points) Sometimes, computing extra information can lead to more efficient divide-and-conquer algorithms. As an example, we will improve on the solution to

More information

Reductions. Linear Time Reductions. Desiderata. Reduction. Desiderata. Classify problems according to their computational requirements.

Reductions. Linear Time Reductions. Desiderata. Reduction. Desiderata. Classify problems according to their computational requirements. Desiderata Reductions Desiderata. Classify problems according to their computational requirements. Frustrating news. Huge number of fundamental problems have defied classification for decades. Desiderata'.

More information

Examples of P vs NP: More Problems

Examples of P vs NP: More Problems Examples of P vs NP: More Problems COMP1600 / COMP6260 Dirk Pattinson Australian National University Semester 2, 2017 Catch Up / Drop in Lab When Fridays, 15.00-17.00 Where N335, CSIT Building (bldg 108)

More information

Algorithms Exam TIN093/DIT600

Algorithms Exam TIN093/DIT600 Algorithms Exam TIN093/DIT600 Course: Algorithms Course code: TIN 093 (CTH), DIT 600 (GU) Date, time: 22nd October 2016, 14:00 18:00 Building: M Responsible teacher: Peter Damaschke, Tel. 5405 Examiner:

More information

University of Nevada, Las Vegas Computer Science 456/656 Fall 2016

University of Nevada, Las Vegas Computer Science 456/656 Fall 2016 University of Nevada, Las Vegas Computer Science 456/656 Fall 2016 The entire examination is 925 points. The real final will be much shorter. Name: No books, notes, scratch paper, or calculators. Use pen

More information

Name: CS 341 Practice Final Exam. 1 a 20 b 20 c 20 d 20 e 20 f 20 g Total 207

Name: CS 341 Practice Final Exam. 1 a 20 b 20 c 20 d 20 e 20 f 20 g Total 207 Name: 1 a 20 b 20 c 20 d 20 e 20 f 20 g 20 2 10 3 30 4 12 5 15 Total 207 CS 341 Practice Final Exam 1. Please write neatly. You will lose points if we cannot figure out what you are saying. 2. Whenever

More information

1. [5 points each] True or False. If the question is currently open, write O or Open.

1. [5 points each] True or False. If the question is currently open, write O or Open. University of Nevada, Las Vegas Computer Science 456/656 Spring 2018 Practice for the Final on May 9, 2018 The entire examination is 775 points. The real final will be much shorter. Name: No books, notes,

More information

HW1. Due: September 13, 2018

HW1. Due: September 13, 2018 CSCI 1010 Theory of Computation HW1 Due: September 13, 2018 Attach a fully filled-in cover sheet to the front of your printed homework. Your name should not appear anywhere; the cover sheet and each individual

More information

Second Midterm Exam, CMPSC 465, Spring 2009 Practice problems

Second Midterm Exam, CMPSC 465, Spring 2009 Practice problems Second idterm Exam, S 465, Spring 2009 ractice problems idterm will be on Tuesday, arch 31, 8:15, in 60 and 61 Willard. This will be open book exam, you can also have notes (several sheets or one notebook).

More information

Basic Combinatorics. Math 40210, Section 01 Fall Homework 4 Solutions

Basic Combinatorics. Math 40210, Section 01 Fall Homework 4 Solutions Basic Combinatorics Math 40210, Section 01 Fall 2012 Homework 4 Solutions 1.4.2 2: One possible implementation: Start with abcgfjiea From edge cd build, using previously unmarked edges: cdhlponminjkghc

More information

Notes and Answers to Homework Exam 1, Geometric Algorithms, 2017

Notes and Answers to Homework Exam 1, Geometric Algorithms, 2017 Notes and Answers to Homework Exam 1, Geometric Algorithms, 2017 Below are some notes and sketches of correct answers for the first homework exam. We have also included the most common mistakes that were

More information

Preferred directions for resolving the non-uniqueness of Delaunay triangulations

Preferred directions for resolving the non-uniqueness of Delaunay triangulations Preferred directions for resolving the non-uniqueness of Delaunay triangulations Christopher Dyken and Michael S. Floater Abstract: This note proposes a simple rule to determine a unique triangulation

More information

Dynamic Programming Algorithms

Dynamic Programming Algorithms CSC 364S Notes University of Toronto, Fall 2003 Dynamic Programming Algorithms The setting is as follows. We wish to find a solution to a given problem which optimizes some quantity Q of interest; for

More information

Problem A - EPIC. Line Width of Letters (# characters) EEEEEEEEEE EEEEEEEEEE EE EE EEEEEEEEEE EEEEEEEEEE EE EE EEEEEEEEEE EEEEEEEEEE

Problem A - EPIC. Line Width of Letters (# characters) EEEEEEEEEE EEEEEEEEEE EE EE EEEEEEEEEE EEEEEEEEEE EE EE EEEEEEEEEE EEEEEEEEEE Problem A - EPIC Professor Plum likes the idea of visiting EPIC for MICS 4. He wants you to write a program to generate ASC art printing EPIC vertically for a sign to tape to the back of the van on the

More information

Notes for Lecture 24

Notes for Lecture 24 U.C. Berkeley CS170: Intro to CS Theory Handout N24 Professor Luca Trevisan December 4, 2001 Notes for Lecture 24 1 Some NP-complete Numerical Problems 1.1 Subset Sum The Subset Sum problem is defined

More information

9 Bounds for the Knapsack Problem (March 6)

9 Bounds for the Knapsack Problem (March 6) 9 Bounds for the Knapsack Problem (March 6) In this lecture, I ll develop both upper and lower bounds in the linear decision tree model for the following version of the (NP-complete) Knapsack 1 problem:

More information

Recursively Enumerable Languages, Turing Machines, and Decidability

Recursively Enumerable Languages, Turing Machines, and Decidability Recursively Enumerable Languages, Turing Machines, and Decidability 1 Problem Reduction: Basic Concepts and Analogies The concept of problem reduction is simple at a high level. You simply take an algorithm

More information

On the undecidability of the tiling problem. Jarkko Kari. Mathematics Department, University of Turku, Finland

On the undecidability of the tiling problem. Jarkko Kari. Mathematics Department, University of Turku, Finland On the undecidability of the tiling problem Jarkko Kari Mathematics Department, University of Turku, Finland Consider the following decision problem, the tiling problem: Given a finite set of tiles (say,

More information

To illustrate what is intended the following are three write ups by students. Diagonalization

To illustrate what is intended the following are three write ups by students. Diagonalization General guidelines: You may work with other people, as long as you write up your solution in your own words and understand everything you turn in. Make sure to justify your answers they should be clear

More information

Exercises Computational Complexity

Exercises Computational Complexity Exercises Computational Complexity March 22, 2017 Exercises marked with a are more difficult. 1 Chapter 7, P and NP Exercise 1. Suppose some pancakes are stacked on a surface such that no two pancakes

More information

1 Algorithm and Proof for Minimum Vertex Coloring

1 Algorithm and Proof for Minimum Vertex Coloring Solutions to Homework 7, CS 173A (Fall 2018) Homework 7 asked you to show that the construction problems Maximum Independent Set, Minimum Vertex Coloring, and Maximum Clique could all be solved in polynomial

More information

/633 Introduction to Algorithms Lecturer: Michael Dinitz Topic: Approximation algorithms Date: 11/27/18

/633 Introduction to Algorithms Lecturer: Michael Dinitz Topic: Approximation algorithms Date: 11/27/18 601.433/633 Introduction to Algorithms Lecturer: Michael Dinitz Topic: Approximation algorithms Date: 11/27/18 22.1 Introduction We spent the last two lectures proving that for certain problems, we can

More information

Theorem 2.9: nearest addition algorithm

Theorem 2.9: nearest addition algorithm There are severe limits on our ability to compute near-optimal tours It is NP-complete to decide whether a given undirected =(,)has a Hamiltonian cycle An approximation algorithm for the TSP can be used

More information

Computational Geometry

Computational Geometry Computational Geometry 600.658 Convexity A set S is convex if for any two points p, q S the line segment pq S. S p S q Not convex Convex? Convexity A set S is convex if it is the intersection of (possibly

More information

CMPSCI 311: Introduction to Algorithms Practice Final Exam

CMPSCI 311: Introduction to Algorithms Practice Final Exam CMPSCI 311: Introduction to Algorithms Practice Final Exam Name: ID: Instructions: Answer the questions directly on the exam pages. Show all your work for each question. Providing more detail including

More information

Graph Theory Questions from Past Papers

Graph Theory Questions from Past Papers Graph Theory Questions from Past Papers Bilkent University, Laurence Barker, 19 October 2017 Do not forget to justify your answers in terms which could be understood by people who know the background theory

More information

Chapter 8. NP-complete problems

Chapter 8. NP-complete problems Chapter 8. NP-complete problems Search problems E cient algorithms We have developed algorithms for I I I I I finding shortest paths in graphs, minimum spanning trees in graphs, matchings in bipartite

More information

Solutions to the European Kangaroo Grey Paper

Solutions to the European Kangaroo Grey Paper Solutions to the European Kangaroo Grey Paper. C Since angles in a triangle add to 80 and one angle is given as 90, the two blank angles in the triangle add to 90. Since angles on a straight line add to

More information

Chapter 10 Part 1: Reduction

Chapter 10 Part 1: Reduction //06 Polynomial-Time Reduction Suppose we could solve Y in polynomial-time. What else could we solve in polynomial time? don't confuse with reduces from Chapter 0 Part : Reduction Reduction. Problem X

More information

15-451/651: Design & Analysis of Algorithms November 4, 2015 Lecture #18 last changed: November 22, 2015

15-451/651: Design & Analysis of Algorithms November 4, 2015 Lecture #18 last changed: November 22, 2015 15-451/651: Design & Analysis of Algorithms November 4, 2015 Lecture #18 last changed: November 22, 2015 While we have good algorithms for many optimization problems, the previous lecture showed that many

More information

My Favorite Problems, 4 Harold B. Reiter University of North Carolina Charlotte

My Favorite Problems, 4 Harold B. Reiter University of North Carolina Charlotte My Favorite Problems, 4 Harold B Reiter University of North Carolina Charlotte This is the fourth of a series of columns about problems I am soliciting problems from the readers of M&I Quarterly I m looking

More information

CS 532: 3D Computer Vision 14 th Set of Notes

CS 532: 3D Computer Vision 14 th Set of Notes 1 CS 532: 3D Computer Vision 14 th Set of Notes Instructor: Philippos Mordohai Webpage: www.cs.stevens.edu/~mordohai E-mail: Philippos.Mordohai@stevens.edu Office: Lieb 215 Lecture Outline Triangulating

More information

Planar Graphs. 1 Graphs and maps. 1.1 Planarity and duality

Planar Graphs. 1 Graphs and maps. 1.1 Planarity and duality Planar Graphs In the first half of this book, we consider mostly planar graphs and their geometric representations, mostly in the plane. We start with a survey of basic results on planar graphs. This chapter

More information

S. Dasgupta, C.H. Papadimitriou, and U.V. Vazirani 165

S. Dasgupta, C.H. Papadimitriou, and U.V. Vazirani 165 S. Dasgupta, C.H. Papadimitriou, and U.V. Vazirani 165 5.22. You are given a graph G = (V, E) with positive edge weights, and a minimum spanning tree T = (V, E ) with respect to these weights; you may

More information

2017 SOLUTIONS (PRELIMINARY VERSION)

2017 SOLUTIONS (PRELIMINARY VERSION) SIMON MARAIS MATHEMATICS COMPETITION 07 SOLUTIONS (PRELIMINARY VERSION) This document will be updated to include alternative solutions provided by contestants, after the competition has been mared. Problem

More information

Three applications of Euler s formula. Chapter 10

Three applications of Euler s formula. Chapter 10 Three applications of Euler s formula Chapter 10 A graph is planar if it can be drawn in the plane R without crossing edges (or, equivalently, on the -dimensional sphere S ). We talk of a plane graph if

More information

15-451/651: Design & Analysis of Algorithms October 11, 2018 Lecture #13: Linear Programming I last changed: October 9, 2018

15-451/651: Design & Analysis of Algorithms October 11, 2018 Lecture #13: Linear Programming I last changed: October 9, 2018 15-451/651: Design & Analysis of Algorithms October 11, 2018 Lecture #13: Linear Programming I last changed: October 9, 2018 In this lecture, we describe a very general problem called linear programming

More information

Dynamic Programming Algorithms

Dynamic Programming Algorithms Based on the notes for the U of Toronto course CSC 364 Dynamic Programming Algorithms The setting is as follows. We wish to find a solution to a given problem which optimizes some quantity Q of interest;

More information

International Mathematics TOURNAMENT OF THE TOWNS. Junior A-Level Solutions Fall 2013

International Mathematics TOURNAMENT OF THE TOWNS. Junior A-Level Solutions Fall 2013 International Mathematics TOURNAMENT OF THE TOWNS Junior A-Level Solutions Fall 201 1. There are 100 red, 100 yellow and 100 green sticks. One can construct a triangle using any three sticks all of different

More information

Problem Set 1. Solution. CS4234: Optimization Algorithms. Solution Sketches

Problem Set 1. Solution. CS4234: Optimization Algorithms. Solution Sketches CS4234: Optimization Algorithms Sketches Problem Set 1 S-1. You are given a graph G = (V, E) with n nodes and m edges. (Perhaps the graph represents a telephone network.) Each edge is colored either blue

More information

Integrated Math I. IM1.1.3 Understand and use the distributive, associative, and commutative properties.

Integrated Math I. IM1.1.3 Understand and use the distributive, associative, and commutative properties. Standard 1: Number Sense and Computation Students simplify and compare expressions. They use rational exponents and simplify square roots. IM1.1.1 Compare real number expressions. IM1.1.2 Simplify square

More information

INF 4130 Exercise set 4, 15th Sept 2015 w/ solutions

INF 4130 Exercise set 4, 15th Sept 2015 w/ solutions INF 4130 Exercise set 4, 15th Sept 2015 w/ solutions Exercise 1 List the order in which we extract the nodes from the Live Set queue when we do a breadth first search of the following graph (tree) with

More information

CSE 417 Dynamic Programming (pt 4) Sub-problems on Trees

CSE 417 Dynamic Programming (pt 4) Sub-problems on Trees CSE 417 Dynamic Programming (pt 4) Sub-problems on Trees Reminders > HW4 is due today > HW5 will be posted shortly Dynamic Programming Review > Apply the steps... 1. Describe solution in terms of solution

More information

8.1 Polynomial-Time Reductions

8.1 Polynomial-Time Reductions 8.1 Polynomial-Time Reductions Classify Problems According to Computational Requirements Q. Which problems will we be able to solve in practice? A working definition. Those with polynomial-time algorithms.

More information

1. CONVEX POLYGONS. Definition. A shape D in the plane is convex if every line drawn between two points in D is entirely inside D.

1. CONVEX POLYGONS. Definition. A shape D in the plane is convex if every line drawn between two points in D is entirely inside D. 1. CONVEX POLYGONS Definition. A shape D in the plane is convex if every line drawn between two points in D is entirely inside D. Convex 6 gon Another convex 6 gon Not convex Question. Why is the third

More information

ELEC-270 Solutions to Assignment 5

ELEC-270 Solutions to Assignment 5 ELEC-270 Solutions to Assignment 5 1. How many positive integers less than 1000 (a) are divisible by 7? (b) are divisible by 7 but not by 11? (c) are divisible by both 7 and 11? (d) are divisible by 7

More information

Ma/CS 6b Class 26: Art Galleries and Politicians

Ma/CS 6b Class 26: Art Galleries and Politicians Ma/CS 6b Class 26: Art Galleries and Politicians By Adam Sheffer The Art Gallery Problem Problem. We wish to place security cameras at a gallery, such that they cover it completely. Every camera can cover

More information

Statistics Case Study 2000 M. J. Clancy and M. C. Linn

Statistics Case Study 2000 M. J. Clancy and M. C. Linn Statistics Case Study 2000 M. J. Clancy and M. C. Linn Problem Write and test functions to compute the following statistics for a nonempty list of numeric values: The mean, or average value, is computed

More information

6.045J/18.400J: Automata, Computability and Complexity. Practice Quiz 2

6.045J/18.400J: Automata, Computability and Complexity. Practice Quiz 2 6.045J/18.400J: Automata, omputability and omplexity March 21, 2007 Practice Quiz 2 Prof. Nancy Lynch Elena Grigorescu Please write your name in the upper corner of each page. INFORMATION ABOUT QUIZ 2:

More information

Reductions. designing algorithms establishing lower bounds establishing intractability classifying problems. Bird s-eye view

Reductions. designing algorithms establishing lower bounds establishing intractability classifying problems. Bird s-eye view Bird s-eye view Reductions designing algorithms establishing lower bounds establishing intractability classifying problems Desiderata. Classify problems according to computational requirements. Linear:

More information

COMP Analysis of Algorithms & Data Structures

COMP Analysis of Algorithms & Data Structures COMP 3170 - Analysis of Algorithms & Data Structures Shahin Kamali Approximation Algorithms CLRS 35.1-35.5 University of Manitoba COMP 3170 - Analysis of Algorithms & Data Structures 1 / 30 Approaching

More information

CPSC 121 Some Sample Questions for the Final Exam Tuesday, April 15, 2014, 8:30AM

CPSC 121 Some Sample Questions for the Final Exam Tuesday, April 15, 2014, 8:30AM CPSC 121 Some Sample Questions for the Final Exam Tuesday, April 15, 2014, 8:30AM Name: Student ID: Signature: Section (circle one): George Steve Your signature acknowledges your understanding of and agreement

More information

1 Matching in Non-Bipartite Graphs

1 Matching in Non-Bipartite Graphs CS 369P: Polyhedral techniques in combinatorial optimization Instructor: Jan Vondrák Lecture date: September 30, 2010 Scribe: David Tobin 1 Matching in Non-Bipartite Graphs There are several differences

More information

Improved Results on Geometric Hitting Set Problems

Improved Results on Geometric Hitting Set Problems Improved Results on Geometric Hitting Set Problems Nabil H. Mustafa nabil@lums.edu.pk Saurabh Ray saurabh@cs.uni-sb.de Abstract We consider the problem of computing minimum geometric hitting sets in which,

More information

2009 HMMT Team Round. Writing proofs. Misha Lavrov. ARML Practice 3/2/2014

2009 HMMT Team Round. Writing proofs. Misha Lavrov. ARML Practice 3/2/2014 Writing proofs Misha Lavrov ARML Practice 3/2/2014 Warm-up / Review 1 (From my research) If x n = 2 1 x n 1 for n 2, solve for x n in terms of x 1. (For a more concrete problem, set x 1 = 2.) 2 (From this

More information

Application of recursion. Grammars and Parsing. Recursive grammar. Grammars

Application of recursion. Grammars and Parsing. Recursive grammar. Grammars Application of recursion Grammars and Parsing So far, we have written recursive programs on integers. Let us now consider a new application, grammars and parsing, that shows off the full power of recursion.

More information

Combinatorial Gems. Po-Shen Loh. June 2009

Combinatorial Gems. Po-Shen Loh. June 2009 Combinatorial Gems Po-Shen Loh June 2009 Although this lecture does not contain many offical Olympiad problems, the arguments which are used are all common elements of Olympiad problem solving. Some of

More information

Module 7. Independent sets, coverings. and matchings. Contents

Module 7. Independent sets, coverings. and matchings. Contents Module 7 Independent sets, coverings Contents and matchings 7.1 Introduction.......................... 152 7.2 Independent sets and coverings: basic equations..... 152 7.3 Matchings in bipartite graphs................

More information

Cardinality of Sets. Washington University Math Circle 10/30/2016

Cardinality of Sets. Washington University Math Circle 10/30/2016 Cardinality of Sets Washington University Math Circle 0/0/06 The cardinality of a finite set A is just the number of elements of A, denoted by A. For example, A = {a, b, c, d}, B = {n Z : n } = {,,, 0,,,

More information

1. Meshes. D7013E Lecture 14

1. Meshes. D7013E Lecture 14 D7013E Lecture 14 Quadtrees Mesh Generation 1. Meshes Input: Components in the form of disjoint polygonal objects Integer coordinates, 0, 45, 90, or 135 angles Output: A triangular mesh Conforming: A triangle

More information

Principles of Algorithm Design

Principles of Algorithm Design Principles of Algorithm Design When you are trying to design an algorithm or a data structure, it s often hard to see how to accomplish the task. The following techniques can often be useful: 1. Experiment

More information

Phil 320 Chapter 1: Sets, Functions and Enumerability I. Sets Informally: a set is a collection of objects. The objects are called members or

Phil 320 Chapter 1: Sets, Functions and Enumerability I. Sets Informally: a set is a collection of objects. The objects are called members or Phil 320 Chapter 1: Sets, Functions and Enumerability I. Sets Informally: a set is a collection of objects. The objects are called members or elements of the set. a) Use capital letters to stand for sets

More information

Student Name and ID Number. MATH 3012 Final Exam, December 11, 2014, WTT

Student Name and ID Number. MATH 3012 Final Exam, December 11, 2014, WTT MATH 3012 Final Exam, December 11, 2014, WTT Student Name and ID Number 1. Consider the 11-element set X consisting of the three capital letters {A, B, C} and the eight digits {0, 1, 2,..., 7}. a. How

More information

Pebble Sets in Convex Polygons

Pebble Sets in Convex Polygons 2 1 Pebble Sets in Convex Polygons Kevin Iga, Randall Maddox June 15, 2005 Abstract Lukács and András posed the problem of showing the existence of a set of n 2 points in the interior of a convex n-gon

More information

FINAL EXAM SOLUTIONS

FINAL EXAM SOLUTIONS COMP/MATH 3804 Design and Analysis of Algorithms I Fall 2015 FINAL EXAM SOLUTIONS Question 1 (12%). Modify Euclid s algorithm as follows. function Newclid(a,b) if a

More information

CONNECTIVITY AND NETWORKS

CONNECTIVITY AND NETWORKS CONNECTIVITY AND NETWORKS We begin with the definition of a few symbols, two of which can cause great confusion, especially when hand-written. Consider a graph G. (G) the degree of the vertex with smallest

More information

PRACTICAL GEOMETRY SYMMETRY AND VISUALISING SOLID SHAPES

PRACTICAL GEOMETRY SYMMETRY AND VISUALISING SOLID SHAPES UNIT 12 PRACTICAL GEOMETRY SYMMETRY AND VISUALISING SOLID SHAPES (A) Main Concepts and Results Let a line l and a point P not lying on it be given. By using properties of a transversal and parallel lines,

More information

Decision Problems. Observation: Many polynomial algorithms. Questions: Can we solve all problems in polynomial time? Answer: No, absolutely not.

Decision Problems. Observation: Many polynomial algorithms. Questions: Can we solve all problems in polynomial time? Answer: No, absolutely not. Decision Problems Observation: Many polynomial algorithms. Questions: Can we solve all problems in polynomial time? Answer: No, absolutely not. Definition: The class of problems that can be solved by polynomial-time

More information

1 Counting triangles and cliques

1 Counting triangles and cliques ITCSC-INC Winter School 2015 26 January 2014 notes by Andrej Bogdanov Today we will talk about randomness and some of the surprising roles it plays in the theory of computing and in coding theory. Let

More information

To prove something about all Boolean expressions, we will need the following induction principle: Axiom 7.1 (Induction over Boolean expressions):

To prove something about all Boolean expressions, we will need the following induction principle: Axiom 7.1 (Induction over Boolean expressions): CS 70 Discrete Mathematics for CS Fall 2003 Wagner Lecture 7 This lecture returns to the topic of propositional logic. Whereas in Lecture 1 we studied this topic as a way of understanding proper reasoning

More information

Chapter Summary. Mathematical Induction Recursive Definitions Structural Induction Recursive Algorithms

Chapter Summary. Mathematical Induction Recursive Definitions Structural Induction Recursive Algorithms Chapter Summary Mathematical Induction Recursive Definitions Structural Induction Recursive Algorithms Section 5.1 Sec.on Summary Mathematical Induction Examples of Proof by Mathematical Induction Mistaken

More information

Technische Universität München Zentrum Mathematik

Technische Universität München Zentrum Mathematik Technische Universität München Zentrum Mathematik Prof. Dr. Dr. Jürgen Richter-Gebert, Bernhard Werner Projective Geometry SS 208 https://www-m0.ma.tum.de/bin/view/lehre/ss8/pgss8/webhome Solutions for

More information

Final. Name: TA: Section Time: Course Login: Person on Left: Person on Right: U.C. Berkeley CS170 : Algorithms, Fall 2013

Final. Name: TA: Section Time: Course Login: Person on Left: Person on Right: U.C. Berkeley CS170 : Algorithms, Fall 2013 U.C. Berkeley CS170 : Algorithms, Fall 2013 Final Professor: Satish Rao December 16, 2013 Name: Final TA: Section Time: Course Login: Person on Left: Person on Right: Answer all questions. Read them carefully

More information

Tutorial for Algorithm s Theory Problem Set 5. January 17, 2013

Tutorial for Algorithm s Theory Problem Set 5. January 17, 2013 Tutorial for Algorithm s Theory Problem Set 5 January 17, 2013 Exercise 1: Maximum Flow Algorithms Consider the following flow network: a) Solve the maximum flow problem on the above network by using the

More information

AP Computer Science Principles Programming Question Tips. 1: Which algorithm/code segment achieves some result?

AP Computer Science Principles Programming Question Tips. 1: Which algorithm/code segment achieves some result? AP Computer Science Principles Programming Question Tips Name: Recall that roughly 40 percent of the questions on the AP exam will be programming or algorithm questions. These will often fall into one

More information

CS 373: Combinatorial Algorithms, Spring 1999

CS 373: Combinatorial Algorithms, Spring 1999 CS 373: Combinatorial Algorithms, Spring 1999 Final Exam (May 7, 1999) Name: Net ID: Alias: This is a closed-book, closed-notes exam! If you brought anything with you besides writing instruments and your

More information

Chapter 1. Math review. 1.1 Some sets

Chapter 1. Math review. 1.1 Some sets Chapter 1 Math review This book assumes that you understood precalculus when you took it. So you used to know how to do things like factoring polynomials, solving high school geometry problems, using trigonometric

More information

Greedy algorithms is another useful way for solving optimization problems.

Greedy algorithms is another useful way for solving optimization problems. Greedy Algorithms Greedy algorithms is another useful way for solving optimization problems. Optimization Problems For the given input, we are seeking solutions that must satisfy certain conditions. These

More information

(Refer Slide Time 3:31)

(Refer Slide Time 3:31) Digital Circuits and Systems Prof. S. Srinivasan Department of Electrical Engineering Indian Institute of Technology Madras Lecture - 5 Logic Simplification In the last lecture we talked about logic functions

More information

APCS-AB: Java. Recursion in Java December 12, week14 1

APCS-AB: Java. Recursion in Java December 12, week14 1 APCS-AB: Java Recursion in Java December 12, 2005 week14 1 Check point Double Linked List - extra project grade Must turn in today MBCS - Chapter 1 Installation Exercises Analysis Questions week14 2 Scheme

More information

6th Bay Area Mathematical Olympiad

6th Bay Area Mathematical Olympiad 6th Bay Area Mathematical Olympiad February 4, 004 Problems and Solutions 1 A tiling of the plane with polygons consists of placing the polygons in the plane so that interiors of polygons do not overlap,

More information

6. Lecture notes on matroid intersection

6. Lecture notes on matroid intersection Massachusetts Institute of Technology 18.453: Combinatorial Optimization Michel X. Goemans May 2, 2017 6. Lecture notes on matroid intersection One nice feature about matroids is that a simple greedy algorithm

More information

MT5821 Advanced Combinatorics

MT5821 Advanced Combinatorics MT5821 Advanced Combinatorics 4 Graph colouring and symmetry There are two colourings of a 4-cycle with two colours (red and blue): one pair of opposite vertices should be red, the other pair blue. There

More information

Inapproximability of the Perimeter Defense Problem

Inapproximability of the Perimeter Defense Problem Inapproximability of the Perimeter Defense Problem Evangelos Kranakis Danny Krizanc Lata Narayanan Kun Xu Abstract We model the problem of detecting intruders using a set of infrared beams by the perimeter

More information

We will give examples for each of the following commonly used algorithm design techniques:

We will give examples for each of the following commonly used algorithm design techniques: Review This set of notes provides a quick review about what should have been learned in the prerequisite courses. The review is helpful to those who have come from a different background; or to those who

More information

COMP260 Spring 2014 Notes: February 4th

COMP260 Spring 2014 Notes: February 4th COMP260 Spring 2014 Notes: February 4th Andrew Winslow In these notes, all graphs are undirected. We consider matching, covering, and packing in bipartite graphs, general graphs, and hypergraphs. We also

More information

Dr. Amotz Bar-Noy s Compendium of Algorithms Problems. Problems, Hints, and Solutions

Dr. Amotz Bar-Noy s Compendium of Algorithms Problems. Problems, Hints, and Solutions Dr. Amotz Bar-Noy s Compendium of Algorithms Problems Problems, Hints, and Solutions Chapter 1 Searching and Sorting Problems 1 1.1 Array with One Missing 1.1.1 Problem Let A = A[1],..., A[n] be an array

More information

Vertex Cover Approximations

Vertex Cover Approximations CS124 Lecture 20 Heuristics can be useful in practice, but sometimes we would like to have guarantees. Approximation algorithms give guarantees. It is worth keeping in mind that sometimes approximation

More information