Determinant Sums (and Labeled Walks) for Undirected Hamiltonicity

Slides:



Advertisements
Similar presentations
Analysis of Algorithms
Advertisements

Weighted Matching-Algorithms, Hamiltonian Cycles and TSP
Great Theoretical Ideas in Computer Science
NP-Hard Nattee Niparnan.
Limitation of Computation Power – P, NP, and NP-complete
Bart Jansen 1.  Problem definition  Instance: Connected graph G, positive integer k  Question: Is there a spanning tree for G with at least k leaves?
JAYASRI JETTI CHINMAYA KRISHNA SURYADEVARA
22C:19 Discrete Math Graphs Fall 2010 Sukumar Ghosh.
Reducibility Class of problems A can be reduced to the class of problems B Take any instance of problem A Show how you can construct an instance of problem.
Complexity 16-1 Complexity Andrei Bulatov Non-Approximability.
Introduction to Approximation Algorithms Lecture 12: Mar 1.
© 2006 Pearson Addison-Wesley. All rights reserved14 A-1 Chapter 14 Graphs.
Techniques for Proving NP-Completeness
1 Optimization problems such as MAXSAT, MIN NODE COVER, MAX INDEPENDENT SET, MAX CLIQUE, MIN SET COVER, TSP, KNAPSACK, BINPACKING do not have a polynomial.
1 NP-Completeness Objectives: At the end of the lesson, students should be able to: 1. Differentiate between class P, NP, and NPC 2. Reduce a known NPC.
Reduction Techniques Restriction Local Replacement Component Design Examples.
CSE 326: Data Structures NP Completeness Ben Lerner Summer 2007.
Analysis of Algorithms CS 477/677
Time Complexity.
CSE 421 Algorithms Richard Anderson Lecture 27 NP Completeness.
Randomness in Computation and Communication Part 1: Randomized algorithms Lap Chi Lau CSE CUHK.
GRAPH Learning Outcomes Students should be able to:
The Theory of NP-Completeness 1. Nondeterministic algorithms A nondeterminstic algorithm consists of phase 1: guessing phase 2: checking If the checking.
Nattee Niparnan. Easy & Hard Problem What is “difficulty” of problem? Difficult for computer scientist to derive algorithm for the problem? Difficult.
1 Introduction to Approximation Algorithms. 2 NP-completeness Do your best then.
Tonga Institute of Higher Education Design and Analysis of Algorithms IT 254 Lecture 8: Complexity Theory.
CSC 172 P, NP, Etc. “Computer Science is a science of abstraction – creating the right model for thinking about a problem and devising the appropriate.
Polynomial-time reductions We have seen several reductions:
Week 10Complexity of Algorithms1 Hard Computational Problems Some computational problems are hard Despite a numerous attempts we do not know any efficient.
More Computational Complexity Shirley Moore CS4390/5390 Fall August 29,
Techniques for Proving NP-Completeness Show that a special case of the problem you are interested in is NP- complete. For example: The problem of finding.
Week 11 - Monday.  What did we talk about last time?  Binomial theorem and Pascal's triangle  Conditional probability  Bayes’ theorem.
1 The Theory of NP-Completeness 2 Cook ’ s Theorem (1971) Prof. Cook Toronto U. Receiving Turing Award (1982) Discussing difficult problems: worst case.
Data Structures & Algorithms Graphs
NP-COMPLETE PROBLEMS. Admin  Two more assignments…  No office hours on tomorrow.
CSE 421 Algorithms Richard Anderson Lecture 27 NP-Completeness and course wrap up.
CS 3343: Analysis of Algorithms Lecture 25: P and NP Some slides courtesy of Carola Wenk.
Fundamentals of Informatics Lecture 14 Intractability and NP-completeness Bas Luttik.
CS6045: Advanced Algorithms NP Completeness. NP-Completeness Some problems are intractable: as they grow large, we are unable to solve them in reasonable.
NP-completeness NP-complete problems. Homework Vertex Cover Instance. A graph G and an integer k. Question. Is there a vertex cover of cardinality k?
NPC.
CSC 413/513: Intro to Algorithms
CSE 421 Algorithms Richard Anderson Lecture 27 NP-Completeness Proofs.
The Theory of NP-Completeness 1. Nondeterministic algorithms A nondeterminstic algorithm consists of phase 1: guessing phase 2: checking If the checking.
COSC 3101A - Design and Analysis of Algorithms 14 NP-Completeness.
1 GRAPH Learning Outcomes Students should be able to: Explain basic terminology of a graph Identify Euler and Hamiltonian cycle Represent graphs using.
34.NP Completeness. Computer Theory Lab. Chapter 34P.2.
CSE 332: NP Completeness, Part II Richard Anderson Spring 2016.
Approximation algorithms
CSC 172 P, NP, Etc.
TU/e Algorithms (2IL15) – Lecture 11 1 Approximation Algorithms.
ICS 353: Design and Analysis of Algorithms NP-Complete Problems King Fahd University of Petroleum & Minerals Information & Computer Science Department.
The Theory of NP-Completeness
More NP-Complete and NP-hard Problems
More NP-complete problems
Shortest Path Problems
Fast Hamiltonicity Checking via Bases of Perfect Matchings
Richard Anderson Lectures NP-Completeness
Richard Anderson Lecture 26 NP-Completeness
Optimization problems such as
Richard Anderson Lecture 26 NP-Completeness
ICS 353: Design and Analysis of Algorithms
Richard Anderson Lecture 25 NP-Completeness
Richard Anderson Lecture 28 NP-Completeness
Approximation Algorithms
Richard Anderson Lecture 30 NP-Completeness
Computation Basics & NP-Completeness
NP-Completeness Reference: Computers and Intractability: A Guide to the Theory of NP-Completeness by Garey and Johnson, W.H. Freeman and Company, 1979.
The Theory of NP-Completeness
CSE 589 Applied Algorithms Spring 1999
Presentation transcript:

Determinant Sums (and Labeled Walks) for Undirected Hamiltonicity Andreas Björklund

Undirected Hamiltonicity Instance: Undirected graph G=(V,E) on n vertices. Question: Is there a vertex permutation v1,v2,…,vn such that vivi+1 in E for all i, including vnv1?

Examples Yes No

History Introduced by Kirkman 1855. Popularized by Hamilton 1857. Special case of traveling salesman problem studied since 1930. Exact algorithm for TSP in O*(2n) time in 1962 by Bellman, Held and Karp, and Gonzalez. Proved NP-complete in Karp’s 1972 paper. Polynomial space O*(2n) time algorithm by Kohn, Gottlieb, and Kohn 1977, Karp 1982, and Bax 1993.

Gerhard Woeginger’s 2003 Survey Open problem: Construct an exact algorithm for the travelling salesman problem with complexity O*(cn) for some c<2. In fact, it even would be interesting to reach such a time complexity O*(cn) for some c<2 for the closely related, but slightly simpler Hamiltonian cycle problem.

Our Results There is a Monte Carlo algorithm that detects if any input n-vertex undirected graph is Hamiltonian or not running in O*(1.657n) time. In bipartite graphs, O*(1.414n) time. Small weight TSP in O*(1.657nw) time, where w is the sum of all weights.

Old Idea 1: Dynamic Programming Across the Vertex Subsets (Bellman, Held and Karp, and Gonzalez.) Grow the path one vertex at a time, remembering which vertices were previously visited (but not the order in which they were traversed).

Old Idea 2: Inclusion-Exclusion Counting Across the Vertex Subsets (Kohn, Gottlieb, and Kohn, Karp, and Bax.) For every vertex subset, count the number of closed walks on n vertices in the induced graph. Sum up the results with alternating signs determined by the parity of the vertex subset.

Too Good? Our algorithm here… Uses exponential space, (but we can get rid of it) Works only in undirected graphs, Is randomized, And cannot even approximately count the solutions. The inclusion-exclusion algorithm… Uses only polynomial space, Works also for directed graphs, Is deterministic, And counts the solutions.

Common Obstacle Both algorithms keep track of the vertices visited by explicitly enumerating all vertex subsets. We have to figure out how to bookkeep visited vertices in a cheaper way. First idea: Restrict the input space.

Previous Restricted Input Results O*(1.251n) time for cubic graphs (Eppstein’07, Iwama and Nakashima’07) O*(1.715n) time for graphs of degree at most four (Gebaur’08) O*((2-e(d))n) time for graphs of bounded degree d (B.,Husfeldt, Kaski, and Koivisto ’08) O*(1.682n) time for claw-free graphs (Broersma, Fomin van’t Hof, and Paulusma ’09)

Bipartite Graphs A Hamiltonian cycle (when it exists) visits vertices from the two color classes in the bipartition alternatively.

Labeled Hamiltonicity? 1 A 2 1 BF B B 3 A B C 3 BD B C C D A F 2 BE D 5 AE CE 4 D E 5 4 E E E F 6 F 6 n’=n/2=6 vertices n=12 vertices |L|=n/2=6 edge labels

Labeled Hamiltonicity We have to keep track of visited vertices and used labels. Seems like O*(2n’2|L|)=O*(2n). Have we really gained anything? Yes, We will describe an O*(2|L|) time randomized algorithm based on counting in characterstic two.

The Tutte Matrix + + … 1 T 1 2 3 4 5 6 x12 x13 x15 x16 x23 x24 x25 x26 x12 x13 x15 x16 x23 x24 x25 x26 x34 x35 x45 x46 x56 3 2 5 4 6 + + …

Special Asymmetric Vertex 1 T 1 2 3 4 5 6 x12 x13 x15 x16 x12’ x23 x24 x25 x26 x13’ x34 x35 x45 x46 x15’ x56 x16’ 3 2 5 4 6 + + …

Labeled Cycle Covers Labels L={A,B,C,D,E,F} 1 Labels L={A,B,C,D,E,F} B B 3 C + C F 2 E F D 5 A D E 4 A We can use inclusion-exclusion counting to compute the labeled cycle covers. 6

Labeled Tutte Matrices 1 TC 1 2 3 4 5 6 x23,c x24,c x34,c BF B 3 A B BD B C C D A F 2 BE 5 CE AE D E 4 E E F 6

Algorithm Input: Bipartite graph G=(U,V,E) on n vertices. Reduce to labeled Hamiltonicity instance G’=(V,E’) and labels L=U. Fix field F of characteristic two of size >>n’. Assign values from F to xij,l for all ij in E’ and labels l in L, uniformly and independently at random. Compute If H nonzero return Yes, else return No.

Analysis Runtime O*(2|L|) = O*(2n/2) since computing a numerical determinant is a polynomial time task. No false positives: if H is nonzero there must be a Hamiltonian cycle. False negatives with exponentially small probability of failure (in n): H is an n-degree multivariate polynomial and is zero in at most n/|F| points by the Schwartz-Zippel Lemma.

General Graphs vs Bipartite Ones We don’t have a natural a priori way of partitioning a graph’s vertices in labels and vertices of a labeled Hamiltonicity instance. First idea: we can use subsets (not just singletons) of a label set to label the edges in a labeled cycle cover. We will use a random equipartitioning of the vertices. Problem: We cannot label edges with the empty set. Second idea: we add a few labels on every direct edge.

Subset Labeled Hamiltonicity 1 A B L’={a,b} {a} {b} {AD} {a} {b} {ADE} {AB} 1 2 3 2 3 C {C} {BADE} 5 {B} {C} D 4 {a} {b} {DE} 4 5 {C} {E} {BADE} E n=10 vertices n’=n/2=5 vertices |L|=n/2+|L’|=7 edge labels

How Many Direct Edge Labels are Needed? Consider a fixed Hamiltonian cycle H. If we choose an equipartition of the input graphs vertices and use half of them as vertices in a subset labeled Hamiltonicity instance, we get n/4 direct edges in expectation along H. We need in total n/2+n/4=3n/4 labels. Can we still find a O*(2|L|) time algorithm for Subset Label Hamiltonicity?

Going Exponential Instead of one matrix per label, we imagine one matrix TX per label subset X. Now gives us what we want.

Computing We can use a recursion like the Bellman-Held-Karp-Gonzalez dynammic programming to compute all matrices TX in O*(2n-n’) time. We can use the fast zeta transform to compute and tabulate the inner sum for all X’s in O*(2|L|) time.

Analysis and Extensions We still have O*(2|L|) time algorithm, and remembering |L|=3n/4 we get O*(1.682n) time. We can trade a few labels for a modest exponential number of runs to get an O*(1.657n) time algorithm. We can use walks instead of paths in the labels’ construction getting a polynomial space algorithm with the same running time. By adjoining a new indeterminate we can embed a min-sum semiring in the polynomial and solve for TSP.

Another Related Technique (Joint work with Husfeldt, Kaski, and Koivisto) Idea: Count labeled walks instead of labeled cycle covers. We don’t need determinants. Previous reductions from Hamiltonicity to Subset Labeled Hamiltonicity still in play.

Labeled Walks 2 B C B C F F A B,D,E 1 5 3 4 A E D D E 6 +

Why Label at All? 2 1 5 3 4 6 Counted only once!

Aha! Just don’t Backtrack 2 1 5 3 4 6 1->6->3->4->6->3->1 1->6->4->3->6->3->1

What about k-Path? Given undirected graph G=(V,E) and positive integer k, determine if there is a simple path of length k in G. Just count labeled walks of length k’ instead of closed labeled walks of length n’. Then we only need a k’/n’ fraction of the labels! Poly(n,k)1.657k time algorithm.

Open Questions Could 1.657 really be the optimal base? Can we find other k-vertex subgraphs faster with labeling techniques? Can we derandomize the bipartite Hamiltonicity algorithm? Is characteristic two essential?

Thank you for listening!