On the Hardness of Optimal Vertex Relabeling and Restricted Vertex Relabeling Amihood Amir Benny Porat.

Slides:



Advertisements
Similar presentations
Lower Bounds for Additive Spanners, Emulators, and More David P. Woodruff MIT and Tsinghua University To appear in FOCS, 2006.
Advertisements

Great Theoretical Ideas in Computer Science
NP-Hard Nattee Niparnan.
Lecture 24 MAS 714 Hartmut Klauck
1 NP-completeness Lecture 2: Jan P The class of problems that can be solved in polynomial time. e.g. gcd, shortest path, prime, etc. There are many.
Asynchronous Pattern Matching - Metrics Amihood Amir CPM 2006.
1 NP-Complete Problems. 2 We discuss some hard problems:  how hard? (computational complexity)  what makes them hard?  any solutions? Definitions 
Playing Fair at Sudoku Joshua Cooper USC Department of Mathematics.
More Graph Algorithms Minimum Spanning Trees, Shortest Path Algorithms.
GOLOMB RULERS AND GRACEFUL GRAPHS
Combinatorial Algorithms
CSC5160 Topics in Algorithms Tutorial 2 Introduction to NP-Complete Problems Feb Jerry Le
Function Matching Amihood Amir Yonatan Aumann Moshe Lewenstein Ely Porat Bar Ilan University.
Chapter 9 Graph algorithms. Sample Graph Problems Path problems. Connectedness problems. Spanning tree problems.
CPSC 689: Discrete Algorithms for Mobile and Wireless Systems Spring 2009 Prof. Jennifer Welch.
Vertex Cover, Dominating set, Clique, Independent set
NP-Complete Problems Reading Material: Chapter 10 Sections 1, 2, 3, and 4 only.
The Theory of NP-Completeness
Chapter 9 Graph algorithms Lec 21 Dec 1, Sample Graph Problems Path problems. Connectedness problems. Spanning tree problems.
Job Scheduling Lecture 19: March 19. Job Scheduling: Unrelated Multiple Machines There are n jobs, each job has: a processing time p(i,j) (the time to.
Clique Width of Monogenic Bipartite Graphs Jordan Volz DIMACS REU 2006 Mentor: Dr. Vadim Lozin, RUTCOR.
Chapter 11 Limitations of Algorithm Power Copyright © 2007 Pearson Addison-Wesley. All rights reserved.
Phylogenetic Networks of SNPs with Constrained Recombination D. Gusfield, S. Eddhu, C. Langley.
S C A L E D Pattern Matching Amihood Amir Ayelet Butman Bar-Ilan University Moshe Lewenstein and Johns Hopkins University Bar-Ilan University.
The Maximum Independent Set Problem Sarah Bleiler DIMACS REU 2005 Advisor: Dr. Vadim Lozin, RUTCOR.
Outline Introduction The hardness result The approximation algorithm.
Graphs – Shortest Path (Weighted Graph) ORD DFW SFO LAX
The Theory of NP-Completeness 1. Nondeterministic algorithms A nondeterminstic algorithm consists of phase 1: guessing phase 2: checking If the checking.
Nirmalya Roy School of Electrical Engineering and Computer Science Washington State University Cpt S 223 – Advanced Data Structures Graph Algorithms Shortest-Path.
Chapter 9 – Graphs A graph G=(V,E) – vertices and edges
MCS312: NP-completeness and Approximation Algorithms
Chapter 11 Limitations of Algorithm Power. Lower Bounds Lower bound: an estimate on a minimum amount of work needed to solve a given problem Examples:
Nattee Niparnan. Easy & Hard Problem What is “difficulty” of problem? Difficult for computer scientist to derive algorithm for the problem? Difficult.
Complexity Classes (Ch. 34) The class P: class of problems that can be solved in time that is polynomial in the size of the input, n. if input size is.
1 Introduction to Approximation Algorithms. 2 NP-completeness Do your best then.
On The Connections Between Sorting Permutations By Interchanges and Generalized Swap Matching Joint work of: Amihood Amir, Gary Benson, Avivit Levy, Ely.
TECH Computer Science NP-Complete Problems Problems  Abstract Problems  Decision Problem, Optimal value, Optimal solution  Encodings  //Data Structure.
1 Lower Bounds Lower bound: an estimate on a minimum amount of work needed to solve a given problem Examples: b number of comparisons needed to find the.
1 Approximate Algorithms (chap. 35) Motivation: –Many problems are NP-complete, so unlikely find efficient algorithms –Three ways to get around: If input.
Data Structures & Algorithms Graphs
Unit 9: Coping with NP-Completeness
NP-COMPLETE PROBLEMS. Admin  Two more assignments…  No office hours on tomorrow.
Lecture 6 NP Class. P = ? NP = ? PSPACE They are central problems in computational complexity.
NP-Complete problems.
CSCI 115 Chapter 8 Topics in Graph Theory. CSCI 115 §8.1 Graphs.
CS 3343: Analysis of Algorithms Lecture 25: P and NP Some slides courtesy of Carola Wenk.
Lecture 25 NP Class. P = ? NP = ? PSPACE They are central problems in computational complexity.
Interchange and Weighted-Interchange Rearrangement Distances in Strings Joint work of: Amihood Amir, Tzvika Hartman, Oren Kapah and Avivit Levy.
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?
Comp. Genomics Recitation 7 Clustering and analysis of microarrays.
CSC 413/513: Intro to Algorithms
The Theory of NP-Completeness 1. Nondeterministic algorithms A nondeterminstic algorithm consists of phase 1: guessing phase 2: checking If the checking.
TU/e Algorithms (2IL15) – Lecture 12 1 Linear Programming.
Introduction to NP Instructor: Neelima Gupta 1.
Kernel Bounds for Path and Cycle Problems Bart M. P. Jansen Joint work with Hans L. Bodlaender & Stefan Kratsch September 8 th 2011, Saarbrucken.
Approximation Algorithms by bounding the OPT Instructor Neelima Gupta
Approximation Algorithms Greedy Strategies. I hear, I forget. I learn, I remember. I do, I understand! 2 Max and Min  min f is equivalent to max –f.
The NP class. NP-completeness Lecture2. The NP-class The NP class is a class that contains all the problems that can be decided by a Non-Deterministic.
Amihood Amir, Gary Benson, Avivit Levy, Ely Porat, Uzi Vishne
The Theory of NP-Completeness
The NP class. NP-completeness
More NP-Complete and NP-hard Problems
Mathematical Foundations of AI
Lecture 2-2 NP Class.
Approximate Algorithms (chap. 35)
ICS 353: Design and Analysis of Algorithms
Bart Jansen Polynomial Kernels for Hard Problems on Disk Graphs
Approximation Algorithms
Chapter 11 Limitations of Algorithm Power
Richard Anderson Lecture 5 Graph Theory
Presentation transcript:

On the Hardness of Optimal Vertex Relabeling and Restricted Vertex Relabeling Amihood Amir Benny Porat

Historical Connection We will go for the oldest references we can…

Motivation

No Wonder…

15-Puzzle

We would like… T= P= HCE ABC BBD DRWX AB_XY B_

Problem!!! Subgraph isomorphism is

Historical solutions: Manber and Wu (1992): model for matching strings in graphs (hypertext). Akutsu (1993): matching strings in trees. Park and Kim (1995): matching strings in acyclic graphs. A., Lewenstein and Lewenstein (2000): matching strings in general graphs – exact and approximate. Navarro (2000): appx matching of strings in graphs, improved time bounds. A. and Navarro (2009): parameterized matching in hypertext.

What about graphs in graphs? A B C A B B V1 V2 V3 V4 V5 V6 V1 V2 V3 V4 V5 V6 A B B B C Are they equal? Trivial

What about approximations? B B C A B B V1 V2 V3 V4 V5 V6 V1 V2 V3 V4 V5 V6 A B B B C Hamming distance: Trivial A

Vertex Relabeling Transform one graph to another via swaps of adjacent labels.

Vertex Relabeling A B C A B B V1 V2 V3 V4 V5 V6 V3 B B A A B C V1 V2 V3 V4 V5 V6 What is the distance?

Vertex Relabeling A B C A B B V1 V2 V3 V4 V5 V6 B B C A B A V1 V2 V3 V4 V5 V6 B B A A B C V1 V2 V3 V4 V5 V6

Vertex Relabeling A B C A B B V1 V2 V3 V4 V5 V6 B B C A B A V1 V2 V3 V4 V5 V6 B B A A B C V1 V2 V3 V4 V5 V6 distance = 2

Connection to 15-puzzle * Only the can be swapped *

History Kantabutra (2007): polynomial time algorithms for path graphs and trees. Agransson, Greenlaw, Kantrabutra (2010): connection between vertex relabeling and edge relabeling, upper and lower bounds on possible distances.

Our Contributions: 1.Vertex relabeling on a path graph is really the swap matching problem for which we have a rich history. 2.Compare the graph problem and the string problem. 3.Show that vertex relabeling on a graph is NP-hard. 4.Define the concept of restricted swaps. 5.Show that if we restrict every vertex to a single swap, the problem is polynomial time computable.

History (last time this talk): Muthu (1995): defined swap matching problem. AALLL (1997), ALLL(1998), ACHLP (2003): culminates in O(n polylog m) time swap matching algorithm. A., Lewenstein and Porat (2002): approximate swap matching. A., Eisenberg and Porat (2006): swap and mismatch edit distance.

The Decision Problem Input: A graph with two vertex labelings L and L’. Decide: Can the graph be relabeled from L to L’? i.e., can one achieve labeling L’ from L by swapping the labels of adjacent vertices? We show:

The Decision Problem Theorem: A graph can be relabeled from L to L’ iff L and L’ have the same histogram. i.e. If the set of labels in both labelings is the same, and every label appears the same number of times in both labelings. Proof: On any path, the labels on its ends can be exchanged via a series of swaps without changing any other labels.

Example: The Decision Problem A B C D E F G Exchange these two

Example: The Decision Problem A B C D E F G

Example: The Decision Problem B A C D E F G

Example: The Decision Problem B A C D E F G

Example: The Decision Problem B C A D E F G

Example: The Decision Problem B C D A E F G

Example: The Decision Problem B C D E A F G

Example: The Decision Problem B C D E F A G

Example: The Decision Problem B C D E F G A

Example: The Decision Problem B C D E G F A

Example: The Decision Problem B C D G E F A

Example: The Decision Problem B C G D E F A

Example: The Decision Problem B G C D E F A

Example: The Decision Problem G B C D E F A

Example: The Decision Problem G B C D E F A These two were exchanged. All others back in place.

Input: Graph G with labels L and L’. Output: The minimum number of swaps t, necessary for relabeling G from L to L’. Claim: The Relabeling Optimization problem is NP-hard. The Relabeling Optimization Problem

The Reduction From the Interchange Distance Problem: A A A Interchange Rearrangement Problem: Use interchanges to rearrange elements, from input to output string. The problem: find distance (=minimum cost).

Example: A B B A C D Input: A C B D A B A B B A C D

Example: A B B A C D Input: A C B D A B A B B A C D A C B A B D

Example: A B B A C D Input: A C B D A B A B B A C D A C B A B D A C B D B A

Example: A B B A C D Input: A C B D A B A B B A C D A C B A B D A C B D B A A C B D A B

Interchange Distance Finding the interchange distance was an open problem of Cayley in Theorem [A., Hartman, Kapah, Levy, Porat (2009)] : Computing the interchange distance of two general strings is NP-hard A A A

The Reduction (Proof by Example) A B B A C D Input: A C B D A B V1 V2 V3 V4 V5 V6 V1 V2 V3 V4 V5 V6 A A A A B C B B B C D D The interchange distance is t iff There is a relabeling distance t

Pattern Matching helped Vertex Relabeling … What can Pattern Matching learn from Vertex Relabeling?

The Swap Matching Restriction Swap matching was defined such that every element participates in at most one swap. What happens if we relax this restriction? The Question: Given two strings with the same histogram (every symbol appears the same number of times in each) what is the minimum number of swaps needed to transform one to the other?

The Unique Version of a String We would like every symbol to be unique. For string: A B B A C A B C C A B The unique version is: A 1 B 1 B 2 A 2 C 1 A 3 B 3 C 2 C 3 A 4 B 4 We can now assume that each symbol appears in every string only once.

Inversion Given two strings S and T An inversion is a pair of indices (i,j), where i>j and S[i] appears before S[j] in T. Example: S= A B C F E D T = A B C D E F There are 3 inversions (F,E), (E,D), and (F,D).

Muir’s Theorem (1882) Given strings S and T of length n, the minimum number of swaps necessary to transform S to T is the number of inversions. In the Example: S= A B C F E D T = A B C D E F 3 inversions = 3 swaps

Algorithm for Finding Number of Inversions S = k T = n 1 n 2 … n j … n i … n m … n k i-1 inversions add j-1 inversions

Algorithm for Finding Number of Inversions S = k T = n 1 n 2 … n j … n i … n m … n k i-1 inversions add m-1 inversions minus 1 Keep track of this via some dynamic structure, e.g. AVL tree. Thus Algorithm time: O(k log k)

Back to Vertex Relabeling What happens if we restrict a label swap to 1? (linear time in strings…) Theorem: Vertex relabeling restricted by 1 is equivalent to perfect matching in bipartite graphs.

Vertex Relabeling to Perfect Matching Reduction construction: For every edge uv where L(u)=L’(v)=a and L(v)=L’(u)=b Put u in X and v in Y and an edge between them. ‾

Vertex Relabeling to Perfect Matching V1 V2 V3 V4 V5 V6 V1 V2 V3 V4 V5 V6 A A B B C A B A A A B C A V5 A V1 V2 C V6 B V4 A V3 B

Perfect Matching to Vertex Relabeling Reduction construction: The graph is the same as the input bipartite graph. The labels: L is 0’s in X and 1’s in Y L’ is 1’s in X and 0’s in Y

Perfect Matching to Vertex Relabeling LL’

Time Because the reductions are linear and the best known times for perfect matching in bipartite graph, the time for graph relabeling is: O(E√V) or O(V ) Because of the two-way linear reduction, this is a conditional lower bound.

Open Problems 1. k-swap matching in a pattern matching sense – can it be done o(nm)? 2. k-distance vertex relabeling? 3. Approximations for the NP-hard vertex relabeling problem. 4. Vertex relabeling as online problems – where graphs are input one vertex at a time.

Grazie