Analysis of Algorithms Spring semester 2002 Uri Zwick

Slides:



Advertisements
Similar presentations
Problems and Their Classes
Advertisements

Order Statistics Sorted
What is Intractable? Some problems seem too hard to solve efficiently. Question 1: Does an efficient algorithm exist?  An O(a ) algorithm, where a > 1,
“Devo verificare un’equivalenza polinomiale…Che fò? Fò dù conti” (Prof. G. Di Battista)
Presented by Yuval Shimron Course
The Theory of NP-Completeness
WS Algorithmentheorie 03 – Randomized Algorithms (Primality Testing) Prof. Dr. Th. Ottmann.
1 Today’s Material Medians & Order Statistics – Ch. 9.
Randomized Algorithms Kyomin Jung KAIST Applied Algorithm Lab Jan 12, WSAC
Randomized Algorithms Fundamentals of Algorithmics.
WS Algorithmentheorie 03 – Randomized Algorithms (Overview and randomised Quicksort) Prof. Dr. Th. Ottmann.
Complexity 18-1 Complexity Andrei Bulatov Probabilistic Algorithms.
Computational problems, algorithms, runtime, hardness
P ROBABILISTIC T URING M ACHINES Stephany Coffman-Wolph Wednesday, March 28, 2007.
Randomized Algorithms and Randomized Rounding Lecture 21: April 13 G n 2 leaves
1 Finding cycles using rectangular matrix multiplication and dynamic programming Raphael Yuster Haifa Univ. - Oranim Uri Zwick Tel Aviv University Uri.
Improved dynamic reachability algorithms for directed graphs Liam Roditty and Uri Zwick Tel Aviv University.
Randomized Process of Unknowns and Implicitly Enforced Bounds on Parameters Jianer Chen Department of Computer Science & Engineering Texas A&M University.
Analysis of Algorithms CS 477/677
Algorithms Andrej Bogdanov The Chinese University of Hong Kong and randomness ITCSC Winter School 2010.
Study Group Randomized Algorithms Jun 7, 2003 Jun 14, 2003.
1 Randomness in Computation Example 1: Breaking symmetry. Example 2: Finding witnesses. Example 3: Monte Carlo integration. Example 4: Approximation algorithms.
Theory I Algorithm Design and Analysis (9 – Randomized algorithms) Prof. Dr. Th. Ottmann.
Randomness in Computation and Communication Part 1: Randomized algorithms Lap Chi Lau CSE CUHK.
Lecture 20: April 12 Introduction to Randomized Algorithms and the Probabilistic Method.
Randomized Algorithms Morteza ZadiMoghaddam Amin Sayedi.
Complexity Classes Kang Yu 1. NP NP : nondeterministic polynomial time NP-complete : 1.In NP (can be verified in polynomial time) 2.Every problem in NP.
Fixed Parameter Complexity Algorithms and Networks.
Scott Perryman Jordan Williams.  NP-completeness is a class of unsolved decision problems in Computer Science.  A decision problem is a YES or NO answer.
1 The Theory of NP-Completeness 2012/11/6 P: the class of problems which can be solved by a deterministic polynomial algorithm. NP : the class of decision.
Stochastic Algorithms Some of the fastest known algorithms for certain tasks rely on chance Stochastic/Randomized Algorithms Two common variations – Monte.
Distributed Coloring Discrete Mathematics and Algorithms Seminar Melih Onus November
Randomized Turing Machines
1 Introduction to Approximation Algorithms. 2 NP-completeness Do your best then.
Chapter 14 Randomized algorithms Introduction Las Vegas and Monte Carlo algorithms Randomized Quicksort Randomized selection Testing String Equality Pattern.
Approximation Algorithms Pages ADVANCED TOPICS IN COMPLEXITY THEORY.
CPSC 335 Randomized Algorithms Dr. Marina Gavrilova Computer Science University of Calgary Canada.
Computation Model and Complexity Class. 2 An algorithmic process that uses the result of a random draw to make an approximated decision has the ability.
Week 10Complexity of Algorithms1 Hard Computational Problems Some computational problems are hard Despite a numerous attempts we do not know any efficient.
CSE 3813 Introduction to Formal Languages and Automata Chapter 14 An Introduction to Computational Complexity These class notes are based on material from.
. CLASSES RP AND ZPP By: SARIKA PAMMI. CONTENTS:  INTRODUCTION  RP  FACTS ABOUT RP  MONTE CARLO ALGORITHM  CO-RP  ZPP  FACTS ABOUT ZPP  RELATION.
1 Approximate Algorithms (chap. 35) Motivation: –Many problems are NP-complete, so unlikely find efficient algorithms –Three ways to get around: If input.
PROBABILISTIC COMPUTATION By Remanth Dabbati. INDEX  Probabilistic Turing Machine  Probabilistic Complexity Classes  Probabilistic Algorithms.
CSCI 3160 Design and Analysis of Algorithms Tutorial 10 Chengyu Lin.
Umans Complexity Theory Lectures Lecture 1a: Problems and Languages.
Lecture 38 CSE 331 Dec 2, Review Sessions etc. Atri: (at least ½ of) class next Friday Jiun-Jie: Extra office hour next Friday Jesse: Review Session.
NP-COMPLETE PROBLEMS. Admin  Two more assignments…  No office hours on tomorrow.
Limits to Computation How do you analyze a new algorithm? –Put it in the form of existing algorithms that you know the analysis. –For example, given 2.
CPS Computational problems, algorithms, runtime, hardness (a ridiculously brief introduction to theoretical computer science) Vincent Conitzer.
ICS 353: Design and Analysis of Algorithms
NP-Completness Turing Machine. Hard problems There are many many important problems for which no polynomial algorithms is known. We show that a polynomial-time.
Algorithms for hard problems Introduction Juris Viksna, 2015.
The Theory of NP-Completeness 1. Nondeterministic algorithms A nondeterminstic algorithm consists of phase 1: guessing phase 2: checking If the checking.
Kernel Bounds for Path and Cycle Problems Bart M. P. Jansen Joint work with Hans L. Bodlaender & Stefan Kratsch September 8 th 2011, Saarbrucken.
COSC 3101A - Design and Analysis of Algorithms 14 NP-Completeness.
P, NP, and NP-Complete Problems Section 10.3 The class P consists of all problems that can be solved in polynomial time, O(N k ), by deterministic computers.
CSE 589 Applied Algorithms Spring 1999 Prim’s Algorithm for MST Load Balance Spanning Tree Hamiltonian Path.
Complexity Classes.
NP-Complete Problems.
A simple parallel algorithm for the MIS problem
Introduction to Randomized Algorithms and the Probabilistic Method
Approximate Algorithms (chap. 35)
Algorithms for hard problems
Randomized Algorithms
Randomized Algorithms CS648
Improved dynamic reachability algorithms for directed graphs
Approximation Algorithms
Raphael Yuster Haifa University Uri Zwick Tel Aviv University
Algorithms CSCI 235, Spring 2019 Lecture 36 P vs
Presentation transcript:

Analysis of Algorithms Spring semester 2002 Uri Zwick

A Gentle introduction to Randomized Algorithms Randomized, or probabilistic, algorithms are algorithms that make random choices. They come in several flavors, according to the type of errors allowed. For many problems randomized algorithms are faster, or simpler, than the corresponding deterministic algorithms, or both. They serve as a very powerful tool even in the design of deterministic algorithms.

Some famous examples Quicksort Primality testing (No deterministic poly. time algorithm is known) Perfect Matchings in parallel (No deterministic polylog time algorithm is known)

Finding simple paths and cycles (A not so famous example [Alon,Yuster,Zwick]) Given a (directed) graph G=(V,E), and a number k, find a simple path (cycle) of length k in G, if there is one. A simple path (cycle) is a path (cycle) that does not intersect itself. The problem is NP-hard. What can we do for a fixed k?

Some thoughts/attempts How do we prevent the path from intersecting itself? BFS/DFS do not seem to work. We can easily solve the problem using dynamic programming in O(n k+1 ) time. How much better than this can we do? Can we do it in O(m) time, for every fixed k? v0v0 v1v1 v2v2 v k-1 vkvk …

An easy special case If the graph is acyclic, then all paths are simple! The longest path in a DAG (Directed Acyclic Graph) can be found in O(m) time using dynamic programming. v0v0 v1v1 v2v2 v k-1 vkvk …

A randomized algorithm Choose a random permutation on the vertices and hope that the vertices of the simple path appear in this permutation in order Delete the edges going backward, and find the longest path in the resulting DAG.

Analysis The running time of the algorithm given in O(m) The probability of success is If we repeat the algorithm c(k+1)! times, then the probability of missing a simple path of length k, if one exists is at most 1/(k+1)!

Algorithms for finding simple paths The running time O((k+1)! m) is polynomial for k=O(logn / loglog n). An improved algorithm with an expected running time of 2 O(k) m will appear in the homework. This is polynomial for k=O(logn).

Algorithms for finding simple paths (Continued) There is a deterministic algorithm with a running time of O((k+1)!*m) but it is more complicated. [Monien ’85] The 2 O(k) m time algorithm can be derandomized into a deterministic algorithm with a running time of 2 O(k) m log n

Fixed Parameter Tractability A parametrized problem is a problem that involves an integer parameter k. A parametrized problem is fixed parameter tractable if there is an algorithm for it that runs in O(f(k)n c ) time, where n is the size of the input, f(k) is an arbitrary function, and c does not depend on k.

Types of Randomized Algorithms A Las Vegas algorithm always returns the correct answer. The complexity if the expected running time. A Monte Carlo algorithm always returns `no’ when the answer is `no’. If the answer is `yes’, then it returns `yes’ with a probability of at least ½. An Atlantic City algorithm returns the correct answer (‘yes’ or `no’) with a probability of at least 2/3.

Complexity Classes of Randomized Algorithms P – Deterministic polynomial time. ZPP – Las Vegas algorithm with expexted polynomial time. RP – A Monte Carlo algorithm with worst case polynomial running time. BPP – An Atlantic City algorithm with worst case polynomial running time. P  ZPP  RP  BPP