Chapter 7
Linear programming and
reductions
Many of the problems for which we want algorithms are optimization tasks: the shortest path,
the cheapest spanning tree, the longest increasing subsequence, and so on. In such cases, we
seek a solution that (1)
Basics of Algorithm Analysis
Computational Tractability/Eciency
Asymptotic Order of Growth
Some Elementary Data Structures
The Stable Matching Problem Revisited
A Survey of Common Running Times
c 2015 D. S. Hirschberg
2-1
Computational Tractability/E
CompSci 260: Fundamentals of the Design and Analysis of
Algorithms
Class Meetings (Fall 2015)
Lecture: Tu Th 9:30-10:50am in ICS 180
There will not be a lecture on Tu Oct 6
Instructor
Professor Dan Hirschberg dan (at) ics.uci.edu
office hours by appointme
Dynamic Programming
Dynamic Programming
can be thought of as being the reverse of recursion
similar to D&C is based on a recurrence,
obtains problem solution by using subproblem solutions
opposite of D&C works from small problems to large problems
avoi
3SAT is NP-complete
3SAT is the same as SAT, except that every clause must have exactly
three literals. Note that 2SAT is in P.
Theorem 3SAT is NP-complete
Proof. 3SAT is in NP: can guess truth assignment for variables and
check that every clause is satis
NP Completeness
Introduction/orientation/motivation
Polynomial reduction
The classes P and NP
NP-complete problems
Examples
c 2014 D. S. Hirschberg
8-1
Introduction
Ecient means a solution whose time scales polynomially with
the size of the input
Some p
Linear Programming
Linear Programming Problem
Optimize a linear function subject to linear inequalities
Input:
a set of n variables
a set of m linear constraints (equations and/or inequalities)
a linear objective function to be maximized (or minimized)
Divide and Conquer Algorithms
Basic idea: Algorithms that use recursion
Three steps:
decompose problem into subproblems
solve each subproblem (recursively)
combine solutions of smaller problems into solution of original
problem
Analysis is often very s
Greedy Algorithms
An approach to solving optimization problems
No crisp denition, a greedy algorithm . . .
builds up a solution in small steps
at each step, makes a decision on some local criterion,
unaware of any possible global side-eects
Making a
Network Flow
Originally motivated by issues of trac in a network
Leads to polynomial-time algorithms for many apparently unrelated
problems
maximum matching in a bipartite graph
minimum cut in a weighted graph
Informally: How much trac (or ow) can we
Basics of Algorithm Analysis
Computational Tractability/Eciency
Asymptotic Order of Growth
Some Elementary Data Structures
The Stable Matching Problem Revisited
A Survey of Common Running Times
c 2014 D. S. Hirschberg
2-1
Computational Tractability/E
CompSci 260 Notes: NP-complete problems
Notes originally developed by Sandy Irani; modied by Michael Dillencourt and Dan Hirschberg.
We start with the fact that SAT is NP-complete and prove a series of reductions, showing that a
variety of other problems
CompSci 260
Fundamentals of the Design and Analysis of Algorithms
Fall 2015
Lecture: Tu Th 9:30-10:50am in ICS 180
Course Web Page
http:/www.ics.uci.edu/dan/class/260/
Course Notes: ( password protected )
http:/www.ics.uci.edu/dan/class/260/notes/
user