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,
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
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 Hi
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 o
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 assign
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
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 l
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 int
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 criterio
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 w
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
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 o
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 prot