CSL 356: Analysis and Design of
Algorithms
Ragesh Jaiswal
CSE, IIT Delhi
Linear Programming
Randomized approximation algorithms
Linear Programming: rand. approx.
Recall the 2-SAT problem. Given a 2-S
CSL 356: Analysis and Design of
Algorithms
Ragesh Jaiswal
CSE, IIT Delhi
Network Flow: Applications
Survey Design
Network Flow: Applications
Problem: There are customers and products. Each
customer i
CSL 356: Analysis and Design of
Algorithms
Ragesh Jaiswal
CSE, IIT Delhi
Network Flow: Applications
Circulation with demands
Network Flow: Applications
Given a weighted directed graph representing a
CSL 356: Analysis and Design of
Algorithms
Ragesh Jaiswal
CSE, IIT Delhi
Network Flow: Applications
Image Segmentation
Network Flow: Applications
You are given an image as a 2-D matrix of pixels.
We
CSL 356: Analysis and Design of
Algorithms
Ragesh Jaiswal
CSE, IIT Delhi
Computational Intractability: Defining NP
Efficient certification:
We say an algorithm is an efficient certifier for a proble
CSL 356: Analysis and Design of
Algorithms
Ragesh Jaiswal
CSE, IIT Delhi
Computational Intractability: NP-complete problems
Problem(3-D matching): Given disjoint sets , , and each of
size , and given
CSL 356: Analysis and Design of
Algorithms
Ragesh Jaiswal
CSE, IIT Delhi
Linear Programming: Solving LP
Recap.
Linear Programming: Solving LP
Standard form: A Linear Program is said to be standard
fo
CSL 356: Analysis and Design of
Algorithms
Ragesh Jaiswal
CSE, IIT Delhi
Linear Programming
Solving LP
Linear Programming: Solving LP
Simplex algorithm:
Repeat:
Pivot: Rewrite the LP in slack form
CSL 356: Analysis and Design of
Algorithms
Ragesh Jaiswal
CSE, IIT Delhi
Homework-5
Claim: If P=NP, then RSA breaks.
Proof idea:
If we can quickly factor (= ), then we can quickly
figure out the sec
CSL 356: Analysis and Design of
Algorithms
Ragesh Jaiswal
CSE, IIT Delhi
Linear Programming
Recap
Linear Programming: Recap.
Problem (LP): Given a linear objective function and a set of
linear constr
CSL 356: Analysis and Design of
Algorithms
Ragesh Jaiswal
CSE, IIT Delhi
Computational Intractability
NP and NP-completeness
Computational Intractability: NP & NP-complete
NP: A problem is in NP if a
CSL 356: Analysis and Design of
Algorithms
Ragesh Jaiswal
CSE, IIT Delhi
Network Flow: Recap.
Ford-Fulkerson algorithm:
Given network with integer capacities, find a source-to-sink
path and push as
CSL 356: Analysis and Design of
Algorithms
Ragesh Jaiswal
CSE, IIT Delhi
Greedy Algorithms: Example
Theorem (Cut Property): Given a weighted graph = ( , )
where all the edge weights are distinct. Con
CSL 356: Analysis and Design of
Algorithms
Ragesh Jaiswal
CSE, IIT Delhi
Greedy Algorithms
For some problems, even though the greedy strategy does not give
an optimal solution but it might give a solu
CSL 356: Analysis and Design of
Algorithms
Ragesh Jaiswal
CSE, IIT Delhi
Greedy Algorithms: Example
Job Scheduling:You are given jobs and you are supposed to
schedule these jobs on a machine. Each jo
CSL 356: Analysis and Design of
Algorithms
Ragesh Jaiswal
CSE, IIT Delhi
Greedy Algorithms: Example
Fractional Knapsack:You are a thief and you have a sack of
size . There are divisible items. Each i
CSL 356: Analysis and Design of
Algorithms
Ragesh Jaiswal
CSE, IIT Delhi
Greedy Algorithms
Greedy Algorithms: Introduction
A local (greedy) decision rule leads to a globally optimal solution.
Two wa
CSL 356: Analysis and Design of
Algorithms
Ragesh Jaiswal
CSE, IIT Delhi
Graphs
Graphs: Introduction
A way to represent a set of objects with pair-wise
relationships among them.
The objects are repr