Hamiltonian Graphs Graphs
|
|
- Neal Patrick
- 6 years ago
- Views:
Transcription
1 COMP2121 Discrete Mathematics Hamiltonian Graphs Graphs Hubert Chan (Chapter 9.5) [O1 Abstract Concepts] [O2 Proof Techniques] [O3 Basic Analysis Techniques] 1
2 Hamiltonian Paths and Circuits [O1] A Hamiltonian path is a path containing every vertex once and only once. ( Visit all vertices exactly once) A Hamiltonian cycle/circuit is a circuit containing every vertex once and only once.( Visit all vertices exactly once with a cycle) Example: (round-the-world puzzle) 2
3 Comparing Euler and Hamiltonian Circuit/Path A connected graph has an Euler circuit iff all vertices have even degrees. A connected graph has an Euler path (but not an Euler circuit) iff exactly two vertices have odd degrees. A Hamiltonian path/circuit is a path/circuit containing every vertex once and only once. Unlike Euler paths/circuits, there is NO simple condition to check whether a graph has a Hamiltonian path/circuit. 3
4 Existence of Hamiltonian Paths Unlike Euler paths/circuits, there is no simple condition to check whether a graph has a Hamiltonian path/circuit.? K 6 Q 3 The problem checking whether a given graph has a Hamiltonian path/circuit is NP-hard. That is, the best method known required at least exponential time w.r.t. the size of the graph (number of vertices/edges), and it is unlikely that there exists a polynomial time algorithm for this problem. 4
5 Special Case: Tournament Graph A tournament graph on n vertices is a directed graph such that for all x y, exactly one of the edges (x, y), (y, x) is in the graph. Interpretation: In a round-robin tournament, each player plays with every other player exactly once. Each vertex stands for a player and each edge for a match. A directed edge (x,y) means that player x beats player y. There is no draw. 5
6 Hamiltonian Path for Tournament Graph Theorem. Every tournament graph has a Hamiltonian path. For example, n = 5 6
7 Proof of the Existence of HP [O2] Theorem: Every tournament graph has a Hamiltonian path. Proof: By induction on the number of vertices, n. Basis: n = 2, it is true trivially Inductive Step: Assume it is true for n 1 v v2 3 There exists a HP (v 1, v 2,, v n 1 ) v 5 for the directed complete graph v 4 of n 1 vertices. v 1 v n-1 There are directed edges joining v n to {v 1, v 2,, v n 1 } v Want to prove that it is true for n. n-2 v 1 v 2 v 6 v n-3 v n v 7 7
8 Induction Step on the Existence Proof Inductive Step: Assume it is true for n 1 There exists a HP (v 1, v 2,, v n 1 ) for the directed complete graph of n 1 vertices. v 1 v n There are directed edges joining v n to {v 1, v 2,, v n 1 } v 4 v 3 If v n v 1, then v n v 1, v 2,, v n 1 (done) v k 1 If v 1 v n and v n v 2, then v 1 v n v 2 v n 1 (done) If v 1 v n, v 2 v n and v n v 3, then v 1 v 2 v n v 3 v n 1 (done) If {v 1, v 2, v 3 } v n and v n v 4, then v 1 v 2 v 3 v n v 4 v n 1 (done) If {v 1, v 2,, v k 1 } v n and v n v k, then v 1 v k 1 v n v k v n 1 (done) If {v 1, v 2,, v n 2 } v n and v n v n-1, then v 1 v n 2 v n v n-1 (done) If {v 1, v 2,, v n 1 } v n v 2 then v 1 v n 1 v n (done) v k v n 1 8
9 Proof of non-existence of HC [O3] Does there exist a Hamiltonian Circuit or Path for the graph on the right? Observations: There is no 3-cycles (cycle of 3 vertices) in G. G is a bipartite graph. If G is to have a HC/HP, it must be an alternating sequence of V 0 and V 1 vertices. The numbers of V 0 and V 1 vertices in HC/HP should not differ more than 1. Since the difference of V 0 and V 1 is 2, G cannot have a HC/HP. j i a e g i b e a d h c g b c d f j h V 0 V 1 f 9
10 Extension of the non-existence proof A subset S of vertices in a graph is an independent set if for any u,v in S, there is no edge between u and v. Theorem: Suppose G has n vertices and an independent set S of size greater than n/2. Then, G does not have a HC. Proof: Any path in G must have the circled vertex (in S) followed by an un-circled vertex (not in S). Since more than 1/2 of the vertices are circled, any HC must contain an edge containing two circled vertices. Conclusion: HC cannot exist. 10
11 Hamiltonian Graphs: Some simple criteria Unlike the simple criterion for Eulerian graphs, no simple test is known that says a graph is or isn't Hamiltonian. Some necessary conditions for a Hamiltonian cycle: No degree-1 vertices No cut vertices (a vertex whose removal will disconnect a graph) No bridges (an edge whose removal will disconnect a graph) If a vertex has degree 2, both edges are on any hamiltonian cycle If a vertex has degree >2, and you find 2 incident edges that must be on any hamiltonian cycle, then the other incident edges can't! For a Hamiltonian path: at most two degree-1 vertices; if so, they're at ends of the path. 11
12 Example Use ideas from last slide to show graph below has a unique Hamiltonian cycle: X 3 X X
13 A sufficiency theorem for Hamiltonian graphs General theme of various theorems is that if G has enough edges, then it is Hamiltonian. Dirac's Theorem: Let G be a simple graph with n vertices, where n 3. If deg(v) n/2 for each v, then G is Hamiltonian 13
14 Proving Dirac's Theorem Proof by contradiction: A proof of Louis Posa, a child prodigy from Hungary Assume deg(v) n /2, for all v, but G is not Hamiltonian Add as many edges to G as possible, keeping it non- Hamiltonian. Resulting graph (still call it G) is called maximal non-hamiltonian. G still satisfies deg(v) n/2, for all v There must exist a pair of non-adjacent vertices v and w. Why? If we add the edge v-w to G, then G υ {v,w} must be Hamiltonian There must be Hamiltonian path P from v to w -- why? 14
15 Finishing proof of Dirac's Theorem Number the vertices of G as they appear on P: v = v 1, v 2,, v n-1, v n = w Consider N = {v 2, v 3,, v n-2 }, observe N = n-3. Consider 2 subsets of N: A = {u N: u is w s neighbor} B = {u N: u comes before a neighbor of v} If A and B are not disjoint, G has a Hamiltonian cycle, v=v 1,v 2,... w i,w=v n,v n-1... v i,v contradiction!! v v = v1 v2 vr w =vn A n/2-1: w has at least n/2 neighbors, but one of them is v n-1 (not in N) B n/2-1: v has at least n/2 neighbors, and hence at least so many nodes come before a neighbor of v. But, v 1 is not in N. If A and B are disjoint, then A B n -2. wi vj w 15
16 Sufficient Conditions for Hamiltonian Circuit/Path Observation: HC exists if the graph has many edges, (Dirac s Theorem) If G is a simple graph with n 3 vertices and deg(v) n/2 for all v, then G has a Hamiltonian circuit. (Ore s Theorem) If G is a simple graph with n 3 vertices such that deg(u) + deg(v) n for every pair of nonadjacent vertices u and v in G, then G has a Hamiltonian circuit. Dirac s Theorem can be proved as a corollary of Ore s If deg(v) n/2 for all v, then obviously deg(u) + deg(v) n for any pair of vertices u and v in G. 16
17 Knight s Tour Knight's Tour - A knight is placed on the empty chessboard and, moving according to the rules of chess, must visit each square exactly once (open or closed). Construct an access graph: each position as a vertex and each possible move as an edge. Does an n x n board has a knight s tour? A 5x5 board? An open tour exists 17
18 All 4 x n Chessboard (from Posa) All 4 x n chessboards do not have any closed Knight s tour. Proof: Consider the board colored with black and white. All moves have to be alternate between black and white. Consider another board coloring, top and bottom rows red and middle two rows blue. When a knight is on a red square, its next square must be blue. The move after a blue square has to be red too. Otherwise there will be unvisited red squares, as the number of red and blue square are the same. This is impossible as the knight have to follow two colorings. 18
19 Traveling Salesman Problem A Traveling salesman wants to visit each of n cities exactly once and return to his starting point. Traveling Salesman Problem (TSP): Given a weighted, complete, undirected graph, find a circuit of minimum total weight, which visits each vertex exactly once. weight (a b c d e) = 24 weight (c d a e b) = 23 weight (a c b d e) = 21 e 4 d a c b We can find the optimal TSP circuit by exhaustion, i.e., to find the weights of all the (n-1)! Hamiltonian circuits 19
20 Which is more difficult: TSP or HC? HC problem can be reduced to TSP The graph G(V, E) for the HC problem will be transformed to a weighted graph G (V, E ) for the TSP. We try to solve the HC problem by solving the TSP problem. HC: Input = G(V, E); Output = yes / no TSP: Input = weighted graph G (V, E ) Output = minimum-weighted circuit Input for HC, G(V,E) Output for HC, Yes/no Transform to weighted graph Transform to Output for HC Weighted graph Min-weighed circuit Algorithm to solve TSP 20
21 Traveling Salesman Problem and Hamiltonian Circuit Problem HC problem can be reduced to TSP The graph G(V, E) for the HC problem will be transformed to a weighted graph G (V, E ) for the TSP. G is a complete graph with V = V and G w(e) = 1 if e is in E w(e) = M if e is not in E, where M is a constant > n G has a TSP circuit of weight V iff HC G 1 exists in G 1 As we can solve the HC problem by solving 1 M the TSP problem. So TSP is at least as difficult as the HC problem, i.e., NP-hard. 1 1 M M M 1 21
22 Summary on Hamiltonian Circuit A Hamiltonian circuit (or path) is a circuit (or path) containing every vertex once and only once. The problem checking whether a given graph has a Hamiltonian path/circuit is NP-hard, i.e, in exponential time by exhaustion. Traveling Salesman Problem (TSP): Given a weighted, complete, undirected graph, find a circuit of minimum total weight, which visits each vertex exactly once. HC problem can be reduced to TSP. So TSP is at least as difficult as the HC problem, i.e., NP-hard. 22
Polynomial-time Reductions
Polynomial-time Reductions Disclaimer: Many denitions in these slides should be taken as the intuitive meaning, as the precise meaning of some of the terms are hard to pin down without introducing the
More information6 Euler Circuits and Hamiltonian Cycles
November 14, 2017 6 Euler Circuits and Hamiltonian Cycles William T. Trotter trotter@math.gatech.edu EulerTrails and Circuits Definition A trail (x 1, x 2, x 3,, x t) in a graph G is called an Euler trail
More information1 Hamiltonian properties
1 Hamiltonian properties 1.1 Hamiltonian Cycles Last time we saw this generalization of Dirac s result, which we shall prove now. Proposition 1 (Ore 60). For a graph G with nonadjacent vertices u and v
More informationNP-Complete Problems. More reductions
NP-Complete Problems More reductions Definitions P: problems that can be solved in polynomial time (typically in n, size of input) on a deterministic Turing machine Any normal computer simulates a DTM
More informationThe P versus NP Problem. Ker-I Ko. Stony Brook, New York
The P versus NP Problem Ker-I Ko Stony Brook, New York ? P = NP One of the seven Millenium Problems The youngest one A folklore question? Has hundreds of equivalent forms Informal Definitions P : Computational
More informationLecture 4: NP and computational intractability
Chapter 4 Lecture 4: NP and computational intractability Listen to: Find the longest path, Daniel Barret What do we do today: polynomial time reduction NP, co-np and NP complete problems some examples
More informationCS 301: Complexity of Algorithms (Term I 2008) Alex Tiskin Harald Räcke. Hamiltonian Cycle. 8.5 Sequencing Problems. Directed Hamiltonian Cycle
8.5 Sequencing Problems Basic genres. Packing problems: SET-PACKING, INDEPENDENT SET. Covering problems: SET-COVER, VERTEX-COVER. Constraint satisfaction problems: SAT, 3-SAT. Sequencing problems: HAMILTONIAN-CYCLE,
More informationAlgorithms Design & Analysis. Approximation Algorithm
Algorithms Design & Analysis Approximation Algorithm Recap External memory model Merge sort Distribution sort 2 Today s Topics Hard problem Approximation algorithms Metric traveling salesman problem A
More informationNP-Completeness. CptS 223 Advanced Data Structures. Larry Holder School of Electrical Engineering and Computer Science Washington State University
NP-Completeness CptS 223 Advanced Data Structures Larry Holder School of Electrical Engineering and Computer Science Washington State University 1 Hard Graph Problems Hard means no known solutions with
More information8.3 Hamiltonian Paths and Circuits
8.3 Hamiltonian Paths and Circuits 8.3 Hamiltonian Paths and Circuits A Hamiltonian path is a path that contains each vertex exactly once A Hamiltonian circuit is a Hamiltonian path that is also a circuit
More informationConnection MATH Connection. Benjamin V.C. Collins, James A. Swenson MATH 2730
MATH 2730 Benjamin V.C. Collins James A. Swenson Traveling Salesman Problem Image: Padberg-Rinaldi, 1987: 532 cities http://www.tsp.gatech.edu/data/usa/tours.html Walks in a graph Let G = (V, E) be a graph.
More informationBasic definitions. Remarks
Basic definitions In a graph G(V, E) a Hamiltonian tour sometimes also called a Hamiltonian cycle is a closed trail that includes each of the graph s vertices exactly once. A graph that contains such a
More informationData Structures in Java
Data Structures in Java Lecture 21: Introduction to NP-Completeness 12/9/2015 Daniel Bauer Algorithms and Problem Solving Purpose of algorithms: find solutions to problems. Data Structures provide ways
More informationPolynomial-Time Reductions
Reductions 1 Polynomial-Time Reductions Classify Problems According to Computational Requirements Q. Which problems will we be able to solve in practice? A working definition. [von Neumann 1953, Godel
More informationSAT, Coloring, Hamiltonian Cycle, TSP
1 SAT, Coloring, Hamiltonian Cycle, TSP Slides by Carl Kingsford Apr. 28, 2014 Sects. 8.2, 8.7, 8.5 2 Boolean Formulas Boolean Formulas: Variables: x 1, x 2, x 3 (can be either true or false) Terms: t
More informationABHELSINKI UNIVERSITY OF TECHNOLOGY
Approximation Algorithms Seminar 1 Set Cover, Steiner Tree and TSP Siert Wieringa siert.wieringa@tkk.fi Approximation Algorithms Seminar 1 1/27 Contents Approximation algorithms for: Set Cover Steiner
More informationClasses of Problems. CS 461, Lecture 23. NP-Hard. Today s Outline. We can characterize many problems into three classes:
Classes of Problems We can characterize many problems into three classes: CS 461, Lecture 23 Jared Saia University of New Mexico P is the set of yes/no problems that can be solved in polynomial time. Intuitively
More informationCS 320, Fall Dr. Geri Georg, Instructor 320 NP 1
NP CS 320, Fall 2017 Dr. Geri Georg, Instructor georg@colostate.edu 320 NP 1 NP Complete A class of problems where: No polynomial time algorithm has been discovered No proof that one doesn t exist 320
More informationAlgorithms and Theory of Computation. Lecture 22: NP-Completeness (2)
Algorithms and Theory of Computation Lecture 22: NP-Completeness (2) Xiaohui Bei MAS 714 November 8, 2018 Nanyang Technological University MAS 714 November 8, 2018 1 / 20 Set Cover Set Cover Input: a set
More informationCS 583: Algorithms. NP Completeness Ch 34. Intractability
CS 583: Algorithms NP Completeness Ch 34 Intractability Some problems are intractable: as they grow large, we are unable to solve them in reasonable time What constitutes reasonable time? Standard working
More information8.5 Sequencing Problems
8.5 Sequencing Problems Basic genres. Packing problems: SET-PACKING, INDEPENDENT SET. Covering problems: SET-COVER, VERTEX-COVER. Constraint satisfaction problems: SAT, 3-SAT. Sequencing problems: HAMILTONIAN-CYCLE,
More informationDesign and Analysis of Algorithms
Design and Analysis of Algorithms CSE 5311 Lecture 25 NP Completeness Junzhou Huang, Ph.D. Department of Computer Science and Engineering CSE5311 Design and Analysis of Algorithms 1 NP-Completeness Some
More information4/12/2011. Chapter 8. NP and Computational Intractability. Directed Hamiltonian Cycle. Traveling Salesman Problem. Directed Hamiltonian Cycle
Directed Hamiltonian Cycle Chapter 8 NP and Computational Intractability Claim. G has a Hamiltonian cycle iff G' does. Pf. Suppose G has a directed Hamiltonian cycle Γ. Then G' has an undirected Hamiltonian
More informationNP Complete Problems. COMP 215 Lecture 20
NP Complete Problems COMP 215 Lecture 20 Complexity Theory Complexity theory is a research area unto itself. The central project is classifying problems as either tractable or intractable. Tractable Worst
More informationData Structures and Algorithms
Data Structures and Algorithms CS245-2015S-23 NP-Completeness and Undecidablity David Galles Department of Computer Science University of San Francisco 23-0: Hard Problems Some algorithms take exponential
More informationAlgorithms, Lecture 3 on NP : Nondeterminis7c Polynomial Time
Algorithms, Lecture 3 on NP : Nondeterminis7c Polynomial Time Last week: Defined Polynomial Time Reduc7ons: Problem X is poly 7me reducible to Y X P Y if can solve X using poly computa7on and a poly number
More informationTraveling Salesman Problem (TSP) - Visit every city and then go home.
Traveling Salesman Problem (TSP) - Visit every city and then go home. Seattle Detroit Boston Toledo Cleveland L. A. Columbus New Orleans Atlanta Orlando A Hamiltonian Path is a path that goes through each
More informationPolynomial-time reductions. We have seen several reductions:
Polynomial-time reductions We have seen several reductions: Polynomial-time reductions Informal explanation of reductions: We have two problems, X and Y. Suppose we have a black-box solving problem X in
More informationData Structures and Algorithms
Data Structures and Algorithms Session 21. April 13, 2009 Instructor: Bert Huang http://www.cs.columbia.edu/~bert/courses/3137 Announcements Homework 5 due next Monday I m out of town Wed to Sun for conference
More informationEasy Problems vs. Hard Problems. CSE 421 Introduction to Algorithms Winter Is P a good definition of efficient? The class P
Easy Problems vs. Hard Problems CSE 421 Introduction to Algorithms Winter 2000 NP-Completeness (Chapter 11) Easy - problems whose worst case running time is bounded by some polynomial in the size of the
More informationACO Comprehensive Exam October 14 and 15, 2013
1. Computability, Complexity and Algorithms (a) Let G be the complete graph on n vertices, and let c : V (G) V (G) [0, ) be a symmetric cost function. Consider the following closest point heuristic for
More informationNP and Computational Intractability
NP and Computational Intractability 1 Polynomial-Time Reduction Desiderata'. Suppose we could solve X in polynomial-time. What else could we solve in polynomial time? don't confuse with reduces from Reduction.
More informationNP-Completeness. Andreas Klappenecker. [based on slides by Prof. Welch]
NP-Completeness Andreas Klappenecker [based on slides by Prof. Welch] 1 Prelude: Informal Discussion (Incidentally, we will never get very formal in this course) 2 Polynomial Time Algorithms Most of the
More informationNP-Complete Problems and Approximation Algorithms
NP-Complete Problems and Approximation Algorithms Efficiency of Algorithms Algorithms that have time efficiency of O(n k ), that is polynomial of the input size, are considered to be tractable or easy
More informationList 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
More informationWarm-up Find the shortest trip (total distance) starting and ending in Chicago and visiting each other city once.
Warm-up Find the shortest trip (total distance) starting and ending in Chicago and visiting each other city once. Minimum-cost Hamiltonian Circuits Practice Homework time Minneapolis Cleveland 779 354
More informationPlanar Graphs (1) Planar Graphs (3) Planar Graphs (2) Planar Graphs (4)
S-72.2420/T-79.5203 Planarity; Edges and Cycles 1 Planar Graphs (1) Topological graph theory, broadly conceived, is the study of graph layouts. Contemporary applications include circuit layouts on silicon
More informationCSCI3390-Lecture 17: A sampler of NP-complete problems
CSCI3390-Lecture 17: A sampler of NP-complete problems 1 List of Problems We now know that if L is any problem in NP, that L P SAT, and thus SAT is NP-hard. Since SAT is also in NP we find that SAT is
More informationLimitations of Algorithm Power
Limitations of Algorithm Power Objectives We now move into the third and final major theme for this course. 1. Tools for analyzing algorithms. 2. Design strategies for designing algorithms. 3. Identifying
More informationVIII. NP-completeness
VIII. NP-completeness 1 / 15 NP-Completeness Overview 1. Introduction 2. P and NP 3. NP-complete (NPC): formal definition 4. How to prove a problem is NPC 5. How to solve a NPC problem: approximate algorithms
More informationNP-complete Problems
NP-complete Problems HP, TSP, 3COL, 0/1IP Dimitris Diamantis µπλ November 6, 2014 Dimitris Diamantis (µπλ ) NP-complete Problems November 6, 2014 1 / 34 HAMILTON PATH is NP-Complete Definition Given an
More informationChapter 3: Proving NP-completeness Results
Chapter 3: Proving NP-completeness Results Six Basic NP-Complete Problems Some Techniques for Proving NP-Completeness Some Suggested Exercises 1.1 Six Basic NP-Complete Problems 3-SATISFIABILITY (3SAT)
More informationComputational Intractability 2010/4/15. Lecture 2
Computational Intractability 2010/4/15 Professor: David Avis Lecture 2 Scribe:Naoki Hatta 1 P and NP 1.1 Definition of P and NP Decision problem it requires yes/no answer. Example: X is a set of strings.
More informationACO Comprehensive Exam March 17 and 18, Computability, Complexity and Algorithms
1. Computability, Complexity and Algorithms (a) Let G(V, E) be an undirected unweighted graph. Let C V be a vertex cover of G. Argue that V \ C is an independent set of G. (b) Minimum cardinality vertex
More informationHamiltonian Cycle. Zero Knowledge Proof
Hamiltonian Cycle Zero Knowledge Proof Hamiltonian cycle Hamiltonian cycle - A path that visits each vertex exactly once, and ends at the same point it started Example Hamiltonian cycle - A path that visits
More informationP and NP. Inge Li Gørtz. Thank you to Kevin Wayne, Philip Bille and Paul Fischer for inspiration to slides
P and NP Inge Li Gørtz Thank you to Kevin Wayne, Philip Bille and Paul Fischer for inspiration to slides 1 Overview Problem classification Tractable Intractable Reductions Tools for classifying problems
More informationNP-Complete Problems
NP-Complete Problems Max Bisection Is NP-Complete max cut becomes max bisection if we require that S = V S. We shall reduce the more general max cut to max bisection. Add V isolated nodes to G to yield
More informationObservation 4.1 G has a proper separation of order 0 if and only if G is disconnected.
4 Connectivity 2-connectivity Separation: A separation of G of order k is a pair of subgraphs (H, K) with H K = G and E(H K) = and V (H) V (K) = k. Such a separation is proper if V (H) \ V (K) and V (K)
More informationCS 350 Algorithms and Complexity
1 CS 350 Algorithms and Complexity Fall 2015 Lecture 15: Limitations of Algorithmic Power Introduction to complexity theory Andrew P. Black Department of Computer Science Portland State University Lower
More informationP P P NP-Hard: L is NP-hard if for all L NP, L L. Thus, if we could solve L in polynomial. Cook's Theorem and Reductions
Summary of the previous lecture Recall that we mentioned the following topics: P: is the set of decision problems (or languages) that are solvable in polynomial time. NP: is the set of decision problems
More informationObservation 4.1 G has a proper separation of order 0 if and only if G is disconnected.
4 Connectivity 2-connectivity Separation: A separation of G of order k is a pair of subgraphs (H 1, H 2 ) so that H 1 H 2 = G E(H 1 ) E(H 2 ) = V (H 1 ) V (H 2 ) = k Such a separation is proper if V (H
More informationCographs; chordal graphs and tree decompositions
Cographs; chordal graphs and tree decompositions Zdeněk Dvořák September 14, 2015 Let us now proceed with some more interesting graph classes closed on induced subgraphs. 1 Cographs The class of cographs
More informationData Structures and Algorithms (CSCI 340)
University of Wisconsin Parkside Fall Semester 2008 Department of Computer Science Prof. Dr. F. Seutter Data Structures and Algorithms (CSCI 340) Homework Assignments The numbering of the problems refers
More informationDynamic Programming on Trees. Example: Independent Set on T = (V, E) rooted at r V.
Dynamic Programming on Trees Example: Independent Set on T = (V, E) rooted at r V. For v V let T v denote the subtree rooted at v. Let f + (v) be the size of a maximum independent set for T v that contains
More informationAlgorithm Design Strategies V
Algorithm Design Strategies V Joaquim Madeira Version 0.0 October 2016 U. Aveiro, October 2016 1 Overview The 0-1 Knapsack Problem Revisited The Fractional Knapsack Problem Greedy Algorithms Example Coin
More informationData Structures in Java. Session 22 Instructor: Bert Huang
Data Structures in Java Session 22 Instructor: Bert Huang http://www.cs.columbia.edu/~bert/courses/33 Announcements Homework 5 solutions posted Homework 6 to be posted this weekend Final exam Thursday,
More informationGraduate Algorithms CS F-21 NP & Approximation Algorithms
Graduate Algorithms CS673-2016F-21 NP & Approximation Algorithms David Galles Department of Computer Science University of San Francisco 21-0: Classes of Problems Consider three problem classes: Polynomial
More informationUnit 7 Day 4 Section 4.5 & Practice Hamiltonian Circuits and Paths
Unit 7 Day 4 Section 4.5 & Practice 4.1-4.5 Hamiltonian Circuits and Paths Warm Up ~ Day 4 D B Is the following graph E 1) Connected? 2) Complete? F G 3) An Euler Circuit? If so, write the circuit. If
More informationAutomata Theory CS Complexity Theory I: Polynomial Time
Automata Theory CS411-2015-17 Complexity Theory I: Polynomial Time David Galles Department of Computer Science University of San Francisco 17-0: Tractable vs. Intractable If a problem is recursive, then
More informationGraph Theory and Optimization Computational Complexity (in brief)
Graph Theory and Optimization Computational Complexity (in brief) Nicolas Nisse Inria, France Univ. Nice Sophia Antipolis, CNRS, I3S, UMR 7271, Sophia Antipolis, France September 2015 N. Nisse Graph Theory
More information10.4 The Kruskal Katona theorem
104 The Krusal Katona theorem 141 Example 1013 (Maximum weight traveling salesman problem We are given a complete directed graph with non-negative weights on edges, and we must find a maximum weight Hamiltonian
More informationCS 350 Algorithms and Complexity
CS 350 Algorithms and Complexity Winter 2019 Lecture 15: Limitations of Algorithmic Power Introduction to complexity theory Andrew P. Black Department of Computer Science Portland State University Lower
More informationTopics in Graph Theory
Topics in Graph Theory September 4, 2018 1 Preliminaries A graph is a system G = (V, E) consisting of a set V of vertices and a set E (disjoint from V ) of edges, together with an incidence function End
More informationExact Algorithms for Dominating Induced Matching Based on Graph Partition
Exact Algorithms for Dominating Induced Matching Based on Graph Partition Mingyu Xiao School of Computer Science and Engineering University of Electronic Science and Technology of China Chengdu 611731,
More informationNP-COMPLETE PROBLEMS. 1. Characterizing NP. Proof
T-79.5103 / Autumn 2006 NP-complete problems 1 NP-COMPLETE PROBLEMS Characterizing NP Variants of satisfiability Graph-theoretic problems Coloring problems Sets and numbers Pseudopolynomial algorithms
More informationUndecidable Problems. Z. Sawa (TU Ostrava) Introd. to Theoretical Computer Science May 12, / 65
Undecidable Problems Z. Sawa (TU Ostrava) Introd. to Theoretical Computer Science May 12, 2018 1/ 65 Algorithmically Solvable Problems Let us assume we have a problem P. If there is an algorithm solving
More informationFINAL EXAM PRACTICE PROBLEMS CMSC 451 (Spring 2016)
FINAL EXAM PRACTICE PROBLEMS CMSC 451 (Spring 2016) The final exam will be on Thursday, May 12, from 8:00 10:00 am, at our regular class location (CSI 2117). It will be closed-book and closed-notes, except
More informationNP-Completeness. Until now we have been designing algorithms for specific problems
NP-Completeness 1 Introduction Until now we have been designing algorithms for specific problems We have seen running times O(log n), O(n), O(n log n), O(n 2 ), O(n 3 )... We have also discussed lower
More informationNP-Completeness. ch34 Hewett. Problem. Tractable Intractable Non-computable computationally infeasible super poly-time alg. sol. E.g.
NP-Completeness ch34 Hewett Problem Tractable Intractable Non-computable computationally infeasible super poly-time alg. sol. E.g., O(2 n ) computationally feasible poly-time alg. sol. E.g., O(n k ) No
More informationRing Sums, Bridges and Fundamental Sets
1 Ring Sums Definition 1 Given two graphs G 1 = (V 1, E 1 ) and G 2 = (V 2, E 2 ) we define the ring sum G 1 G 2 = (V 1 V 2, (E 1 E 2 ) (E 1 E 2 )) with isolated points dropped. So an edge is in G 1 G
More informationPreliminaries and Complexity Theory
Preliminaries and Complexity Theory Oleksandr Romanko CAS 746 - Advanced Topics in Combinatorial Optimization McMaster University, January 16, 2006 Introduction Book structure: 2 Part I Linear Algebra
More information1. Introduction Recap
1. Introduction Recap 1. Tractable and intractable problems polynomial-boundness: O(n k ) 2. NP-complete problems informal definition 3. Examples of P vs. NP difference may appear only slightly 4. Optimization
More informationSome Algebra Problems (Algorithmic) CSE 417 Introduction to Algorithms Winter Some Problems. A Brief History of Ideas
Some Algebra Problems (Algorithmic) CSE 417 Introduction to Algorithms Winter 2006 NP-Completeness (Chapter 8) Given positive integers a, b, c Question 1: does there exist a positive integer x such that
More informationNP-completeness. Chapter 34. Sergey Bereg
NP-completeness Chapter 34 Sergey Bereg Oct 2017 Examples Some problems admit polynomial time algorithms, i.e. O(n k ) running time where n is the input size. We will study a class of NP-complete problems
More informationChapter 8. NP and Computational Intractability. Slides by Kevin Wayne. Copyright 2005 Pearson-Addison Wesley. All rights reserved.
Chapter 8 NP and Computational Intractability Slides by Kevin Wayne. Copyright 2005 Pearson-Addison Wesley. All rights reserved. 1 8.5 Sequencing Problems Basic genres.! Packing problems: SET-PACKING,
More informationVery few Moore Graphs
Very few Moore Graphs Anurag Bishnoi June 7, 0 Abstract We prove here a well known result in graph theory, originally proved by Hoffman and Singleton, that any non-trivial Moore graph of diameter is regular
More informationApproximation Algorithms for Asymmetric TSP by Decomposing Directed Regular Multigraphs
Approximation Algorithms for Asymmetric TSP by Decomposing Directed Regular Multigraphs Haim Kaplan Tel-Aviv University, Israel haimk@post.tau.ac.il Nira Shafrir Tel-Aviv University, Israel shafrirn@post.tau.ac.il
More informationBounds on the Traveling Salesman Problem
Bounds on the Traveling Salesman Problem Sean Zachary Roberson Texas A&M University MATH 613, Graph Theory A common routing problem is as follows: given a collection of stops (for example, towns, stations,
More informationGraphs with large maximum degree containing no odd cycles of a given length
Graphs with large maximum degree containing no odd cycles of a given length Paul Balister Béla Bollobás Oliver Riordan Richard H. Schelp October 7, 2002 Abstract Let us write f(n, ; C 2k+1 ) for the maximal
More informationP and NP. Warm Up: Super Hard Problems. Overview. Problem Classification. Tools for classifying problems according to relative hardness.
Overview Problem classification Tractable Intractable P and NP Reductions Tools for classifying problems according to relative hardness Inge Li Gørtz Thank you to Kevin Wayne, Philip Bille and Paul Fischer
More informationHamiltonian problem on claw-free and almost distance-hereditary graphs
Discrete Mathematics 308 (2008) 6558 6563 www.elsevier.com/locate/disc Note Hamiltonian problem on claw-free and almost distance-hereditary graphs Jinfeng Feng, Yubao Guo Lehrstuhl C für Mathematik, RWTH
More informationLECTURE 1: INTRODUCTION
LECTURE 1: INTRODUCTION What is a Network? What is a Network? What is the meaning of Network Flows? In our course, a network G=(N,A) consists of a finite number of nodes (in N) which are connected by arcs
More informationPreliminaries. Graphs. E : set of edges (arcs) (Undirected) Graph : (i, j) = (j, i) (edges) V = {1, 2, 3, 4, 5}, E = {(1, 3), (3, 2), (2, 4)}
Preliminaries Graphs G = (V, E), V : set of vertices E : set of edges (arcs) (Undirected) Graph : (i, j) = (j, i) (edges) 1 2 3 5 4 V = {1, 2, 3, 4, 5}, E = {(1, 3), (3, 2), (2, 4)} 1 Directed Graph (Digraph)
More information4/20/11. NP-complete problems. A variety of NP-complete problems. Hamiltonian Cycle. Hamiltonian Cycle. Directed Hamiltonian Cycle
A variety of NP-complete problems NP-complete problems asic genres. Packing problems: SE-PACKING, INDEPENDEN SE. Covering problems: SE-COVER, VEREX-COVER. Constraint satisfaction problems: SA, 3-SA. Sequencing
More information8.5 Sequencing Problems. Chapter 8. NP and Computational Intractability. Hamiltonian Cycle. Hamiltonian Cycle
Chapter 8 NP and Computational Intractability 8.5 Sequencing Problems Basic genres. Packing problems: SET-PACKING, INDEPENDENT SET. Covering problems: SET-COVER, VERTEX-COVER. Constraint satisfaction problems:
More information8. INTRACTABILITY I. Lecture slides by Kevin Wayne Copyright 2005 Pearson-Addison Wesley. Last updated on 2/6/18 2:16 AM
8. INTRACTABILITY I poly-time reductions packing and covering problems constraint satisfaction problems sequencing problems partitioning problems graph coloring numerical problems Lecture slides by Kevin
More informationP, NP, NP-Complete. Ruth Anderson
P, NP, NP-Complete Ruth Anderson A Few Problems: Euler Circuits Hamiltonian Circuits Intractability: P and NP NP-Complete What now? Today s Agenda 2 Try it! Which of these can you draw (trace all edges)
More informationCSCE 750 Final Exam Answer Key Wednesday December 7, 2005
CSCE 750 Final Exam Answer Key Wednesday December 7, 2005 Do all problems. Put your answers on blank paper or in a test booklet. There are 00 points total in the exam. You have 80 minutes. Please note
More informationON COST MATRICES WITH TWO AND THREE DISTINCT VALUES OF HAMILTONIAN PATHS AND CYCLES
ON COST MATRICES WITH TWO AND THREE DISTINCT VALUES OF HAMILTONIAN PATHS AND CYCLES SANTOSH N. KABADI AND ABRAHAM P. PUNNEN Abstract. Polynomially testable characterization of cost matrices associated
More informationCOP 4531 Complexity & Analysis of Data Structures & Algorithms
COP 4531 Complexity & Analysis of Data Structures & Algorithms Lecture 18 Reductions and NP-completeness Thanks to Kevin Wayne and the text authors who contributed to these slides Classify Problems According
More informationChapter 8. NP and Computational Intractability
Chapter 8 NP and Computational Intractability Slides by Kevin Wayne. Copyright 2005 Pearson-Addison Wesley. All rights reserved. Acknowledgement: This lecture slide is revised and authorized from Prof.
More informationTraveling Salesman Problem
Traveling Salesman Problem Zdeněk Hanzálek hanzalek@fel.cvut.cz CTU in Prague April 17, 2017 Z. Hanzálek (CTU) Traveling Salesman Problem April 17, 2017 1 / 33 1 Content 2 Solved TSP instances in pictures
More informationUniversity of Washington March 21, 2013 Department of Computer Science and Engineering CSEP 521, Winter Exam Solution, Monday, March 18, 2013
University of Washington March 21, 2013 Department of Computer Science and Engineering CSEP 521, Winter 2013 Exam Solution, Monday, March 18, 2013 Instructions: NAME: Closed book, closed notes, no calculators
More informationCircuits. CSE 373 Data Structures
Circuits CSE 373 Data Structures Readings Reading Alas not in your book. So it won t be on the final! Circuits 2 Euler Euler (1707-1783): might be the most prolific mathematician of all times (analysis,
More informationOutline. 1 NP-Completeness Theory. 2 Limitation of Computation. 3 Examples. 4 Decision Problems. 5 Verification Algorithm
Outline 1 NP-Completeness Theory 2 Limitation of Computation 3 Examples 4 Decision Problems 5 Verification Algorithm 6 Non-Deterministic Algorithm 7 NP-Complete Problems c Hu Ding (Michigan State University)
More informationAnalysis of Algorithms. Unit 5 - Intractable Problems
Analysis of Algorithms Unit 5 - Intractable Problems 1 Intractable Problems Tractable Problems vs. Intractable Problems Polynomial Problems NP Problems NP Complete and NP Hard Problems 2 In this unit we
More informationNP-Completeness. NP-Completeness 1
NP-Completeness Reference: Computers and Intractability: A Guide to the Theory of NP-Completeness by Garey and Johnson, W.H. Freeman and Company, 1979. NP-Completeness 1 General Problems, Input Size and
More informationInformatique Fondamentale IMA S8
Informatique Fondamentale IMA S8 Cours 4 : graphs, problems and algorithms on graphs, (notions of) NP completeness Laure Gonnord http://laure.gonnord.org/pro/teaching/ Laure.Gonnord@polytech-lille.fr Université
More informationFast exact algorithms for hamiltonicity in claw-free graphs
Fast exact algorithms for hamiltonicity in claw-free graphs Hajo Broersma 1, Fedor V. Fomin 2, Pim van t Hof 1, and Daniël Paulusma 1 1 Department of Computer Science, University of Durham, Science Laboratories,
More informationNP and Computational Intractability
NP and Computational Intractability 1 Review Basic reduction strategies. Simple equivalence: INDEPENDENT-SET P VERTEX-COVER. Special case to general case: VERTEX-COVER P SET-COVER. Encoding with gadgets:
More information