# 1. Suppose you are given a magic black box that somehow answers the following decision problem in polynomial time:

Save this PDF as:

Size: px
Start display at page:

Download "1. Suppose you are given a magic black box that somehow answers the following decision problem in polynomial time:"

## Transcription

1 1. Suppose you are given a magic black box that somehow answers the following decision problem in polynomial time: Input: A CNF formula ϕ with n variables x 1, x 2,..., x n. Output: True if there is an assignment of True or False to each variable that satisfies ϕ. Using this black box as a subroutine, describe an algorithm that solves the following related search problem in polynomial time: Input: A CNF formula ϕ with n variables x 1,..., x n. Output: A truth assignment to the variables that satisfies ϕ, or None if there is no satisfying assignment. [Hint: You can use the magic box more than once.] Solution: For any CNF formula ϕ with variables x 1,..., x n, let ϕ xi =1 be the CNF formula obtained from ϕ by setting x i to True and simplifying the formula; if x i is a literal in a clause C we remove the clause C from the formula, and if x i is a literal in a clause C we remove the x i from the clause (note that if C contains only x i then we obtain an empty clause which we interpret as not being satisfiable by any assignment). Similarly, let ϕ xi =0 be the CNF formula obtained from ϕ by setting x i to False and simplifying. Suppose Sat(ϕ) returns True if ϕ is satisfiable and False otherwise. Then the following algorithm constructs a satisfying assignment for ϕ or correctly reports that no such assignment exists. SatAssignment(ϕ): if SAT(ϕ) = False return None for i 1 to n if SAT(ϕ xi =1) ϕ ϕ xi =1 A[i] True else ϕ ϕ xi =0 A[i] False return A[1.. n] The correctness of this algorithm follows by induction from the following observation: Claim 1. The CNF formula ϕ xi =1 is satisfiable if and only if ϕ has a satisfying assignment where x i = True. Proof: First, if ϕ xi =1 has a satisfying assignment, then we can augment that satisfying assignment by setting x i = True and this will satisfy ϕ (note that the only clauses we removed from ϕ to obtain ϕ xi =1 have x i in them, and hence setting x i = True will satisfy all those clauses). On the other hand, if ϕ has a satisfying assignment where x i = True, then that assignment restricted to the variables other than x i will satisfy ϕ xi =1; the reasoning is tedious. 1

2 The algorithm runs in polynomial time. Specifically, suppose Sat(ϕ) runs in O(N c ) time, where N the total size of ϕ (sum of the clause sizes). Then SatAssignment(ϕ) runs in time O(nN c ) since the formula size is only decreasing in each iteration and there are at most n iterations. 2

3 2. An independent set in a graph G is a subset S of the vertices of G, such that no two vertices in S are connected by an edge in G. Suppose you are given a magic black box that somehow answers the following decision problem in polynomial time: Input: An undirected graph G and an integer k. Output: True if G has an independent set of size k, and False otherwise. (a) Using this black box as a subroutine, describe algorithms that solves the following optimization problem in polynomial time: Input: An undirected graph G. Output: The size of the largest independent set in G. [Hint: You ve seen this problem before.] Solution: Suppose IndSet(V, E, k) returns True if the graph (V, E) has an independent set of size k, and False otherwise. Then the following algorithm returns the size of the largest independent set in G: MaxIndSetSize(V, E): for k 1 to V if IndSet(V, E, k + 1) = False return k A graph with n vertices cannot have an independent set of size larger than n, so this algorithm must return a value. If G has an independent set of size k, then it also has an independent set of size k 1, so the algorithm is correct. The algorithm clearly runs in polynomial time. Specifically, if IndSet(V, E, k) runs in O((V + E) c ) time, then MaxIndSetSize(V, E) runs in O((V + E) c+1 ) time. Yes, we could have used binary search instead of linear search. Whatever. 3

4 (b) Using this black box as a subroutine, describe algorithms that solves the following search problem in polynomial time: Input: An undirected graph G. Output: An independent set in G of maximum size. Solution (delete vertices): I ll use the algorithm MaxIndSetSize(V, E) from part (a) as a black box instead. Let G v denote the graph obtained from G by deleting vertex v, and let G N(v) denote the graph obtained from G by deleting v and all neighbors of v. MaxIndSet(G): S k MaxIndSetSize(G) for all vertices v of G if MaxIndSetSize(G v) = k G G v else G G N(v) add v to S return S Correctness of this algorithm follows inductively from the following claims: Claim 2. MaxIndSetSize(G v) = k if and only if G has an independent set of size k that excludes v. Proof: Every independent set in G v is also an independent set in G; it follows that MaxIndSetSize(G v) k. Suppose G has an independent set S of size k that does excludes v. Then S is also an independent set of size k in G v, so MaxIndSetSize(G v) is at least k, and therefore equal to k. On the other hand, suppose G v has an independent set S of size k. Then S is also a maximum independent set of G (because S = k) that excludes v. The algorithm clearly runs in polynomial time. Solution (add edges): I ll use the algorithm MaxIndSetSize(V, E) from part (a) as a black box instead. Let G + uv denote the graph obtained from G by adding edge uv. MaxIndSet(G): k MaxIndSetSize(G) if k = 1 return any vertex for all vertices u for all vertices v if u v and uv is not an edge if MaxIndSetSize(G + uv) = k G G + uv S for all vertices v if deg(v) < V 1 add v to S return S 4

5 The algorithms adds every edge it can without changing the maximum independent set size. Let G denote the final graph. Any independent set in G is also an independent set in the original input graph G. Moreover, the largest independent set in G is also a largest independent set in G. Thus, to prove the algorithm correct, we need to prove the following claims about the final graph G : Claim 3. The maximum independent set in G is unique. Proof: Suppose the final graph G has more than two maximum independent sets A and B. Pick any vertex u A \ B and any other vertex v A. The set B is still an independent set in the graph G + uv. Thus, when the algorithm considered edge uv, it would have added uv to the graph, contradicting the assumption that A is an independent set. Claim 4. Suppose k > 1. The unique maximum independent set of G contains vertex v if and only if deg(v) < V 1. Proof: Let S be the unique maximum independent set of G, and let v be any vertex of G. If v S, then v has degree at most V k < V 1, because v is disconnected from every other vertex in S. On the other hand, suppose deg(v) < V 1 but v S. Then there must be at least vertex u such that uv is not an edge in G. Because v S, the set S is still an independent set in G + uv. Thus, when the algorithm considered edge uv, it would have added uv to the graph, and we have a contradiction. The algorithm clearly runs in polynomial time. 5

6 To think about later: 3. Formally, a proper coloring of a graph G = (V, E) is a function c : V {1, 2,..., k}, for some integer k, such that c(u) c(v) for all uv E. Less formally, a valid coloring assigns each vertex of G a color, such that every edge in G has endpoints with different colors. The chromatic number of a graph is the minimum number of colors in a proper coloring of G. Suppose you are given a magic black box that somehow answers the following decision problem in polynomial time: Input: An undirected graph G and an integer k. Output: True if G has a proper coloring with k colors, and False otherwise. Using this black box as a subroutine, describe an algorithm that solves the following coloring problem in polynomial time: Input: An undirected graph G. Output: A valid coloring of G using the minimum possible number of colors. [Hint: You can use the magic box more than once. The input to the magic box is a graph and only a graph, meaning only vertices and edges.] Solution: First we build an algorithm to compute the minimum number of colors in any valid coloring. ChromaticNumber(G): for k V down to 1 if Colorable(G, k 1) = False return k Given a graph G = (V, E) with n vertices v 1, v 2,..., v n, the following algorithm computes an array color[1.. n] describing a valid coloring of G with the minimum number of colors. Coloring(G): k ChromaticNumber(G) add a disjoint clique of size k H G for c 1 to k add vertex z c to G for i 1 to c 1 add edge z i z c to H for each vertex, try each color for i 1 to n for c 1 to k add edge v i z c to H for c 1 to k remove edge v i z c from H if Colorable(H, k) = True color[i] c break inner loop add edge v i z c from H return color[1.. n] 6

7 In any k-coloring of H, the new vertices z 1,..., z k must have k distinct colors, because every pair of those vertices is connected. We assign color[i] c to indicate that there is a k-coloring of H in which v i has the same color as z c. When the algorithm terminates, color[1.. n] describes a valid k-coloring of G. To prove that the algorithm is correct, we must prove that for all i, when the ith iteration of the outer loop ends, G has a valid k-coloring that is consistent with the partial coloring color[1.. i]. Fix an integer i. The inductive hypothesis implies that when the ith iteration of the outer loop begins, G has a k-coloring consistent with the first i 1 assigned colors. (The base case i = 0 is trivial.) If we connect v i to every new vertices except z c, then v i must have the same color as z c in any valid k-coloring. Thus, the call to Colorable inside the inner loop returns True if and only if H has a k-coloring in which v i has the same color as z c (and the previous i 1 vertices are also colored). So Colorable must return True during the second inner loop, which completes the inductive proof. This algorithm makes O(kn) = O(n 2 ) calls to Colorable, and therefore runs in polynomial time. 7

### NP Completeness. Andreas Klappenecker [partially based on slides by Jennifer Welch]

NP Completeness Andreas Klappenecker [partially based on slides by Jennifer Welch] Overview We already know the following examples of NPC problems: SAT 3SAT We are going to show that the following are

### Problem Set 2 Solutions

Problem Set 2 Solutions Graph Theory 2016 EPFL Frank de Zeeuw & Claudiu Valculescu 1. Prove that the following statements about a graph G are equivalent. - G is a tree; - G is minimally connected (it is

### 9.1 Cook-Levin Theorem

CS787: Advanced Algorithms Scribe: Shijin Kong and David Malec Lecturer: Shuchi Chawla Topic: NP-Completeness, Approximation Algorithms Date: 10/1/2007 As we ve already seen in the preceding lecture, two

### NP-Hardness. We start by defining types of problem, and then move on to defining the polynomial-time reductions.

CS 787: Advanced Algorithms NP-Hardness Instructor: Dieter van Melkebeek We review the concept of polynomial-time reductions, define various classes of problems including NP-complete, and show that 3-SAT

### Solution for Homework set 3

TTIC 300 and CMSC 37000 Algorithms Winter 07 Solution for Homework set 3 Question (0 points) We are given a directed graph G = (V, E), with two special vertices s and t, and non-negative integral capacities

### Paths, Flowers and Vertex Cover

Paths, Flowers and Vertex Cover Venkatesh Raman M. S. Ramanujan Saket Saurabh Abstract It is well known that in a bipartite (and more generally in a König) graph, the size of the minimum vertex cover is

### CPSC 536N: Randomized Algorithms Term 2. Lecture 10

CPSC 536N: Randomized Algorithms 011-1 Term Prof. Nick Harvey Lecture 10 University of British Columbia In the first lecture we discussed the Max Cut problem, which is NP-complete, and we presented a very

### Answer Key #1 Phil 414 JL Shaheen Fall 2010

Answer Key #1 Phil 414 JL Shaheen Fall 2010 1. 1.42(a) B is equivalent to B, and so also to C, where C is a DNF formula equivalent to B. (By Prop 1.5, there is such a C.) Negated DNF meets de Morgan s

### 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

### These are not polished as solutions, but ought to give a correct idea of solutions that work. Note that most problems have multiple good solutions.

CSE 591 HW Sketch Sample Solutions These are not polished as solutions, but ought to give a correct idea of solutions that work. Note that most problems have multiple good solutions. Problem 1 (a) Any

### 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

### Lecture 20: Satisfiability Steven Skiena. Department of Computer Science State University of New York Stony Brook, NY

Lecture 20: Satisfiability Steven Skiena Department of Computer Science State University of New York Stony Brook, NY 11794 4400 http://www.cs.sunysb.edu/ skiena Problem of the Day Suppose we are given

### v V Question: How many edges are there in a graph with 10 vertices each of degree 6?

ECS20 Handout Graphs and Trees March 4, 2015 (updated 3/9) Notion of a graph 1. A graph G = (V,E) consists of V, a nonempty set of vertices (or nodes) and E, a set of pairs of elements of V called edges.

### These notes present some properties of chordal graphs, a set of undirected graphs that are important for undirected graphical models.

Undirected Graphical Models: Chordal Graphs, Decomposable Graphs, Junction Trees, and Factorizations Peter Bartlett. October 2003. These notes present some properties of chordal graphs, a set of undirected

### List Coloring Graphs

List Coloring Graphs January 29, 2004 CHROMATIC NUMBER Defn 1 A k coloring of a graph G is a function c : V (G) {1, 2,... k}. A proper k coloring of a graph G is a coloring of G with k colors so that no

### 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:

### P and NP (Millenium problem)

CMPS 2200 Fall 2017 P and NP (Millenium problem) Carola Wenk Slides courtesy of Piotr Indyk with additions by Carola Wenk CMPS 2200 Introduction to Algorithms 1 We have seen so far Algorithms for various

### Complexity of clique coloring and related problems

Complexity of clique coloring and related problems Dániel Marx Institut für Informatik Humboldt-Universität zu Berlin, Germany dmarx@cs.bme.hu 23rd February 2011 Abstract A k-clique-coloring of a graph

### Basic Graph Theory with Applications to Economics

Basic Graph Theory with Applications to Economics Debasis Mishra February, 0 What is a Graph? Let N = {,..., n} be a finite set. Let E be a collection of ordered or unordered pairs of distinct elements

### Definition For vertices u, v V (G), the distance from u to v, denoted d(u, v), in G is the length of a shortest u, v-path. 1

Graph fundamentals Bipartite graph characterization Lemma. If a graph contains an odd closed walk, then it contains an odd cycle. Proof strategy: Consider a shortest closed odd walk W. If W is not a cycle,

### 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

### Theorem 3.1 (Berge) A matching M in G is maximum if and only if there is no M- augmenting path.

3 Matchings Hall s Theorem Matching: A matching in G is a subset M E(G) so that no edge in M is a loop, and no two edges in M are incident with a common vertex. A matching M is maximal if there is no matching

### Solving problems on graph algorithms

Solving problems on graph algorithms Workshop Organized by: ACM Unit, Indian Statistical Institute, Kolkata. Tutorial-3 Date: 06.07.2017 Let G = (V, E) be an undirected graph. For a vertex v V, G {v} is

### Advanced Algorithms Class Notes for Monday, October 23, 2012 Min Ye, Mingfu Shao, and Bernard Moret

Advanced Algorithms Class Notes for Monday, October 23, 2012 Min Ye, Mingfu Shao, and Bernard Moret Greedy Algorithms (continued) The best known application where the greedy algorithm is optimal is surely

### 1 Undirected Vertex Geography UVG

Geography Start with a chip sitting on a vertex v of a graph or digraph G. A move consists of moving the chip to a neighbouring vertex. In edge geography, moving the chip from x to y deletes the edge (x,

### The NP-Completeness of Some Edge-Partition Problems

The NP-Completeness of Some Edge-Partition Problems Ian Holyer y SIAM J. COMPUT, Vol. 10, No. 4, November 1981 (pp. 713-717) c1981 Society for Industrial and Applied Mathematics 0097-5397/81/1004-0006

### DO NOT RE-DISTRIBUTE THIS SOLUTION FILE

Professor Kindred Math 104, Graph Theory Homework 2 Solutions February 7, 2013 Introduction to Graph Theory, West Section 1.2: 26, 38, 42 Section 1.3: 14, 18 Section 2.1: 26, 29, 30 DO NOT RE-DISTRIBUTE

### 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

### Solving Linear Recurrence Relations (8.2)

EECS 203 Spring 2016 Lecture 18 Page 1 of 10 Review: Recurrence relations (Chapter 8) Last time we started in on recurrence relations. In computer science, one of the primary reasons we look at solving

### Discrete Mathematics and Probability Theory Fall 2009 Satish Rao,David Tse Note 8

CS 70 Discrete Mathematics and Probability Theory Fall 2009 Satish Rao,David Tse Note 8 An Introduction to Graphs Formulating a simple, precise specification of a computational problem is often a prerequisite

### P Is Not Equal to NP. ScholarlyCommons. University of Pennsylvania. Jon Freeman University of Pennsylvania. October 1989

University of Pennsylvania ScholarlyCommons Technical Reports (CIS) Department of Computer & Information Science October 1989 P Is Not Equal to NP Jon Freeman University of Pennsylvania Follow this and

### Problem Set 2 Solutions

Design and Analysis of Algorithms February, 01 Massachusetts Institute of Technology 6.046J/18.410J Profs. Dana Moshkovitz and Bruce Tidor Handout 8 Problem Set Solutions This problem set is due at 9:00pm

### Polynomial-Time Approximation Algorithms

6.854 Advanced Algorithms Lecture 20: 10/27/2006 Lecturer: David Karger Scribes: Matt Doherty, John Nham, Sergiy Sidenko, David Schultz Polynomial-Time Approximation Algorithms NP-hard problems are a vast

### Undirected Graphs. DSA - lecture 6 - T.U.Cluj-Napoca - M. Joldos 1

Undirected Graphs Terminology. Free Trees. Representations. Minimum Spanning Trees (algorithms: Prim, Kruskal). Graph Traversals (dfs, bfs). Articulation points & Biconnected Components. Graph Matching

### CS 125 Section #4 RAMs and TMs 9/27/16

CS 125 Section #4 RAMs and TMs 9/27/16 1 RAM A word-ram consists of: A fixed set of instructions P 1,..., P q. Allowed instructions are: Modular arithmetic and integer division on registers; the standard

### Algorithm Design, Anal. & Imp., Homework 4 Solution

Algorithm Design, Anal. & Imp., Homework 4 Solution Note: The solution is for your personal use for this course. You are not allowed to post the solution in public place. There could be mistakes in the

### Minimum sum multicoloring on the edges of trees

Minimum sum multicoloring on the edges of trees Dániel Marx a,1 a Department of Computer Science and Information Theory, Budapest University of Technology and Economics, H-1521 Budapest, Hungary. Abstract

### 2. Lecture notes on non-bipartite matching

Massachusetts Institute of Technology 18.433: Combinatorial Optimization Michel X. Goemans February 15th, 013. Lecture notes on non-bipartite matching Given a graph G = (V, E), we are interested in finding

### Steiner Trees and Forests

Massachusetts Institute of Technology Lecturer: Adriana Lopez 18.434: Seminar in Theoretical Computer Science March 7, 2006 Steiner Trees and Forests 1 Steiner Tree Problem Given an undirected graph G

### Propositional Logic Formal Syntax and Semantics. Computability and Logic

Propositional Logic Formal Syntax and Semantics Computability and Logic Syntax and Semantics Syntax: The study of how expressions are structured (think: grammar) Semantics: The study of the relationship

### Drawing Planar Graphs

Drawing Planar Graphs Lucie Martinet November 9, 00 Introduction The field of planar graph drawing has become more and more important since the late 960 s. Although its first uses were mainly industrial,

### A graph is finite if its vertex set and edge set are finite. We call a graph with just one vertex trivial and all other graphs nontrivial.

2301-670 Graph theory 1.1 What is a graph? 1 st semester 2550 1 1.1. What is a graph? 1.1.2. Definition. A graph G is a triple (V(G), E(G), ψ G ) consisting of V(G) of vertices, a set E(G), disjoint from

### 2. CONNECTIVITY Connectivity

2. CONNECTIVITY 70 2. Connectivity 2.1. Connectivity. Definition 2.1.1. (1) A path in a graph G = (V, E) is a sequence of vertices v 0, v 1, v 2,..., v n such that {v i 1, v i } is an edge of G for i =

### Basic Graph Theory with Applications to Economics

Basic Graph Theory with Applications to Economics Debasis Mishra February 6, What is a Graph? Let N = {,..., n} be a finite set. Let E be a collection of ordered or unordered pairs of distinct elements

### 1 Variations of the Traveling Salesman Problem

Stanford University CS26: Optimization Handout 3 Luca Trevisan January, 20 Lecture 3 In which we prove the equivalence of three versions of the Traveling Salesman Problem, we provide a 2-approximate algorithm,

### Math 454 Final Exam, Fall 2005

c IIT Dept. Applied Mathematics, December 12, 2005 1 PRINT Last name: Signature: First name: Student ID: Math 454 Final Exam, Fall 2005 I. Examples, Counterexamples and short answer. (6 2 ea.) Do not give

### Maximal Monochromatic Geodesics in an Antipodal Coloring of Hypercube

Maximal Monochromatic Geodesics in an Antipodal Coloring of Hypercube Kavish Gandhi April 4, 2015 Abstract A geodesic in the hypercube is the shortest possible path between two vertices. Leader and Long

### The External Network Problem

The External Network Problem Jan van den Heuvel and Matthew Johnson CDAM Research Report LSE-CDAM-2004-15 December 2004 Abstract The connectivity of a communications network can often be enhanced if the

### The Matrix-Tree Theorem and Its Applications to Complete and Complete Bipartite Graphs

The Matrix-Tree Theorem and Its Applications to Complete and Complete Bipartite Graphs Frankie Smith Nebraska Wesleyan University fsmith@nebrwesleyan.edu May 11, 2015 Abstract We will look at how to represent

### 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

### The Shortest Path Problem. The Shortest Path Problem. Mathematical Model. Integer Programming Formulation

The Shortest Path Problem jla,jc@imm.dtu.dk Department of Management Engineering Technical University of Denmark The Shortest Path Problem Given a directed network G = (V,E,w) for which the underlying

### Module 6 P, NP, NP-Complete Problems and Approximation Algorithms

Module 6 P, NP, NP-Complete Problems and Approximation Algorithms Dr. Natarajan Meghanathan Associate Professor of Computer Science Jackson State University Jackson, MS 39217 E-mail: natarajan.meghanathan@jsums.edu

### Recursive Definitions Structural Induction Recursive Algorithms

Chapter 4 1 4.3-4.4 Recursive Definitions Structural Induction Recursive Algorithms 2 Section 4.1 3 Principle of Mathematical Induction Principle of Mathematical Induction: To prove that P(n) is true for

### Scribes: Romil Verma, Juliana Cook (2015), Virginia Williams, Date: May 1, 2017 and Seth Hildick-Smith (2016), G. Valiant (2017), M.

Lecture 9 Graphs Scribes: Romil Verma, Juliana Cook (2015), Virginia Williams, Date: May 1, 2017 and Seth Hildick-Smith (2016), G. Valiant (2017), M. Wootters (2017) 1 Graphs A graph is a set of vertices

### 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

### Recursion defining an object (or function, algorithm, etc.) in terms of itself. Recursion can be used to define sequences

Section 5.3 1 Recursion 2 Recursion Recursion defining an object (or function, algorithm, etc.) in terms of itself. Recursion can be used to define sequences Previously sequences were defined using a specific

### Reasoning and writing about algorithms: some tips

Reasoning and writing about algorithms: some tips Theory of Algorithms Winter 2016, U. Chicago Notes by A. Drucker The suggestions below address common issues arising in student homework submissions. Absorbing

### List of Theorems. Mat 416, Introduction to Graph Theory. Theorem 1 The numbers R(p, q) exist and for p, q 2,

List of Theorems Mat 416, Introduction to Graph Theory 1. Ramsey s Theorem for graphs 8.3.11. Theorem 1 The numbers R(p, q) exist and for p, q 2, R(p, q) R(p 1, q) + R(p, q 1). If both summands on the

### Lecture 4: Primal Dual Matching Algorithm and Non-Bipartite Matching. 1 Primal/Dual Algorithm for weighted matchings in Bipartite Graphs

CMPUT 675: Topics in Algorithms and Combinatorial Optimization (Fall 009) Lecture 4: Primal Dual Matching Algorithm and Non-Bipartite Matching Lecturer: Mohammad R. Salavatipour Date: Sept 15 and 17, 009

### On Rainbow Cycles in Edge Colored Complete Graphs. S. Akbari, O. Etesami, H. Mahini, M. Mahmoody. Abstract

On Rainbow Cycles in Edge Colored Complete Graphs S. Akbari, O. Etesami, H. Mahini, M. Mahmoody Abstract In this paper we consider optimal edge colored complete graphs. We show that in any optimal edge

### 1 Some Solution of Homework

Math 3116 Dr. Franz Rothe May 30, 2012 08SUM\3116_2012h1.tex Name: Use the back pages for extra space 1 Some Solution of Homework Proposition 1 (Counting labeled trees). There are n n 2 different labeled

### On the Max Coloring Problem

On the Max Coloring Problem Leah Epstein Asaf Levin May 22, 2010 Abstract We consider max coloring on hereditary graph classes. The problem is defined as follows. Given a graph G = (V, E) and positive

### Topology Homework 3. Section Section 3.3. Samuel Otten

Topology Homework 3 Section 3.1 - Section 3.3 Samuel Otten 3.1 (1) Proposition. The intersection of finitely many open sets is open and the union of finitely many closed sets is closed. Proof. Note that

### Ramsey s Theorem on Graphs

Ramsey s Theorem on Graphs 1 Introduction Exposition by William Gasarch Imagine that you have 6 people at a party. We assume that, for every pair of them, either THEY KNOW EACH OTHER or NEITHER OF THEM

### Searching Algorithms/Time Analysis

Searching Algorithms/Time Analysis CSE21 Fall 2017, Day 8 Oct 16, 2017 https://sites.google.com/a/eng.ucsd.edu/cse21-fall-2017-miles-jones/ (MinSort) loop invariant induction Loop invariant: After the

### Shortest Path Routing Communications networks as graphs Graph terminology Breadth-first search in a graph Properties of breadth-first search

Shortest Path Routing Communications networks as graphs Graph terminology Breadth-first search in a graph Properties of breadth-first search 6.082 Fall 2006 Shortest Path Routing, Slide 1 Routing in an

### Solutions to relevant spring 2000 exam problems

Problem 2, exam Here s Prim s algorithm, modified slightly to use C syntax. MSTPrim (G, w, r): Q = V[G]; for (each u Q) { key[u] = ; key[r] = 0; π[r] = 0; while (Q not empty) { u = ExtractMin (Q); for

### MergeSort, Recurrences, Asymptotic Analysis Scribe: Michael P. Kim Date: September 28, 2016 Edited by Ofir Geri

CS161, Lecture 2 MergeSort, Recurrences, Asymptotic Analysis Scribe: Michael P. Kim Date: September 28, 2016 Edited by Ofir Geri 1 Introduction Today, we will introduce a fundamental algorithm design paradigm,

### Color-blind index in graphs of very low degree

Color-blind index in graphs of very low degree Jennifer Diemunsch Nathan Graber Lucas Kramer Victor Larsen Lauren M. Nelsen 4 Luke L. Nelsen Devon Sigler Derrick Stolee 5 Charlie Suer 6 June 7, 05 Abstract

### 1 Connected components in undirected graphs

Lecture 10 Connected components of undirected and directed graphs Scribe: Luke Johnston (2016) and Mary Wootters (2017) Date: October 25, 2017 Much of the following notes were taken from Tim Roughgarden

### Minimum Spanning Trees

Minimum Spanning Trees Overview Problem A town has a set of houses and a set of roads. A road connects and only houses. A road connecting houses u and v has a repair cost w(u, v). Goal: Repair enough (and

### The clique number of a random graph in (,1 2) Let ( ) # -subgraphs in = 2 =: ( ) We will be interested in s.t. ( )~1. To gain some intuition note ( )

The clique number of a random graph in (,1 2) Let () # -subgraphs in = 2 =:() We will be interested in s.t. ()~1. To gain some intuition note ()~ 2 =2 and so ~2log. Now let us work rigorously. () (+1)

### Rigidity, connectivity and graph decompositions

First Prev Next Last Rigidity, connectivity and graph decompositions Brigitte Servatius Herman Servatius Worcester Polytechnic Institute Page 1 of 100 First Prev Next Last Page 2 of 100 We say that a framework

### Minimum-Spanning-Tree problem. Minimum Spanning Trees (Forests) Minimum-Spanning-Tree problem

Minimum Spanning Trees (Forests) Given an undirected graph G=(V,E) with each edge e having a weight w(e) : Find a subgraph T of G of minimum total weight s.t. every pair of vertices connected in G are

### The Structure of Bull-Free Perfect Graphs

The Structure of Bull-Free Perfect Graphs Maria Chudnovsky and Irena Penev Columbia University, New York, NY 10027 USA May 18, 2012 Abstract The bull is a graph consisting of a triangle and two vertex-disjoint

### Chapter 6 GRAPH COLORING

Chapter 6 GRAPH COLORING A k-coloring of (the vertex set of) a graph G is a function c : V (G) {1, 2,..., k} such that c (u) 6= c (v) whenever u is adjacent to v. Ifak-coloring of G exists, then G is called

### 35 Approximation Algorithms

35 Approximation Algorithms Many problems of practical significance are NP-complete, yet they are too important to abandon merely because we don t know how to find an optimal solution in polynomial time.

### CSCE750 Analysis of Algorithms Fall 2017 NP-Complete Problems

CSCE750 Analysis of Algorithms Fall 2017 NP-Complete Problems This document contains slides from the lecture, formatted to be suitable for printing or individual reading, and with some supplemental explanations

### EULER TOUR. Example: Consider the following graph, which has an Euler tour. c d

Sathish Kumar Reddy Yenna EULER TOUR PROBLEM An Euler Tour of a connected 1 directed graph G(V, E) is a cycle that traverses each edge of G exactly once although it may visit a vertex more than once. I

### The clique number of a random graph in (,1 2) Let ( ) # -subgraphs in = 2 =: ( ) 2 ( ) ( )

1 The clique number of a random graph in (,1 2) Let () # -subgraphs in = 2 =:() We will be interested in s.t. ()~1. To gain some intuition note ()~ 2 =2 and so ~2log. Now let us work rigorously. () (+1)

### Fast algorithms for max independent set

Fast algorithms for max independent set N. Bourgeois 1 B. Escoffier 1 V. Th. Paschos 1 J.M.M. van Rooij 2 1 LAMSADE, CNRS and Université Paris-Dauphine, France {bourgeois,escoffier,paschos}@lamsade.dauphine.fr

### Line Graphs and Circulants

Line Graphs and Circulants Jason Brown and Richard Hoshino Department of Mathematics and Statistics Dalhousie University Halifax, Nova Scotia, Canada B3H 3J5 Abstract The line graph of G, denoted L(G),

### MergeSort, Recurrences, Asymptotic Analysis Scribe: Michael P. Kim Date: April 1, 2015

CS161, Lecture 2 MergeSort, Recurrences, Asymptotic Analysis Scribe: Michael P. Kim Date: April 1, 2015 1 Introduction Today, we will introduce a fundamental algorithm design paradigm, Divide-And-Conquer,

### CS 161 Lecture 11 BFS, Dijkstra s algorithm Jessica Su (some parts copied from CLRS) 1 Review

1 Review 1 Something I did not emphasize enough last time is that during the execution of depth-firstsearch, we construct depth-first-search trees. One graph may have multiple depth-firstsearch trees,

### Solutions to Quiz 1. (a) (3 points) Vertices x and y are in the same connected component. Solution. P (x, y)

Massachusetts Institute of Technology 6.042J/18.062J, Fall 05: Mathematics for Computer Science October 17 Prof. Albert R. Meyer and Prof. Ronitt Rubinfeld revised October 18, 2005, 125 minutes Solutions

### Chordal deletion is fixed-parameter tractable

Chordal deletion is fixed-parameter tractable Dániel Marx Department of Computer Science and Information Theory Budapest University of Technology and Economics Budapest H-1521 Hungary dmarx@cs.bme.hu Abstract.

### CME 305: Discrete Mathematics and Algorithms Instructor: Reza Zadeh HW#3 Due at the beginning of class Thursday 03/02/17

CME 305: Discrete Mathematics and Algorithms Instructor: Reza Zadeh (rezab@stanford.edu) HW#3 Due at the beginning of class Thursday 03/02/17 1. Consider a model of a nonbipartite undirected graph in which

### Graph Connectivity G G G

Graph Connectivity 1 Introduction We have seen that trees are minimally connected graphs, i.e., deleting any edge of the tree gives us a disconnected graph. What makes trees so susceptible to edge deletions?

### Elements of Graph Theory

Elements of Graph Theory Quick review of Chapters 9.1 9.5, 9.7 (studied in Mt1348/2008) = all basic concepts must be known New topics we will mostly skip shortest paths (Chapter 9.6), as that was covered

### Decreasing a key FIB-HEAP-DECREASE-KEY(,, ) 3.. NIL. 2. error new key is greater than current key 6. CASCADING-CUT(, )

Decreasing a key FIB-HEAP-DECREASE-KEY(,, ) 1. if >. 2. error new key is greater than current key 3.. 4.. 5. if NIL and.

### Coloring edges and vertices of graphs without short or long cycles

Coloring edges and vertices of graphs without short or long cycles Marcin Kamiński and Vadim Lozin Abstract Vertex and edge colorability are two graph problems that are NPhard in general. We show that

### Part II. Graph Theory. Year

Part II Year 2017 2016 2015 2014 2013 2012 2011 2010 2009 2008 2007 2006 2005 2017 53 Paper 3, Section II 15H Define the Ramsey numbers R(s, t) for integers s, t 2. Show that R(s, t) exists for all s,

### CSC 505, Fall 2000: Week 12

CSC 505, Fall 000: Week Proving the N P-completeness of a decision problem A:. Prove that A is in N P give a simple guess and check algorithm (the certificate being guessed should be something requiring

### Batch Coloring of Graphs

Batch Coloring of Graphs Joan Boyar 1, Leah Epstein 2, Lene M. Favrholdt 1, Kim S. Larsen 1, and Asaf Levin 3 1 Dept. of Mathematics and Computer Science, University of Southern Denmark, Odense, Denmark,

### Modules. 6 Hamilton Graphs (4-8 lectures) Introduction Necessary conditions and sufficient conditions Exercises...

Modules 6 Hamilton Graphs (4-8 lectures) 135 6.1 Introduction................................ 136 6.2 Necessary conditions and sufficient conditions............. 137 Exercises..................................

### 1 Dijkstra s Algorithm

Lecture 11 Dijkstra s Algorithm Scribes: Himanshu Bhandoh (2015), Virginia Williams, and Date: November 1, 2017 Anthony Kim (2016), G. Valiant (2017), M. Wootters (2017) (Adapted from Virginia Williams

### Vertex Cover is Fixed-Parameter Tractable

Vertex Cover is Fixed-Parameter Tractable CS 511 Iowa State University November 28, 2010 CS 511 (Iowa State University) Vertex Cover is Fixed-Parameter Tractable November 28, 2010 1 / 18 The Vertex Cover

### ifn >-- 2 is even, ifn is odd, ifn =0,

SIAM J. ALG. DISC. METH. Voi. 7, No. 1, January 1986 1986 Society for Industrial and Applied Mathematics 015 THE NUMBER OF MAXIMAL INDEPENDENT SETS IN A TREE* HERBERT S. WILFf Abstract. can have. We find