CSE 421 Richard Anderson Winter 2019, Lecture 3

Slides:



Advertisements
Similar presentations
Introduction to Algorithms NP-Complete
Advertisements

Greedy Algorithms.
1 EE5900 Advanced Embedded System For Smart Infrastructure Static Scheduling.
Vertex Cover Dominating Set These slides are based on the Lecture Notes by David Mount for the course CMSC 451 at the University of Maryland. The Copyright.
Five Problems CSE 421 Richard Anderson Winter 2009, Lecture 3.
CSE 421 Algorithms Richard Anderson Lecture 23 Network Flow Applications.
Lectures on Network Flows
CSC5160 Topics in Algorithms Tutorial 2 Introduction to NP-Complete Problems Feb Jerry Le
CSE 421 Algorithms Richard Anderson Lecture 27 NP Completeness.
CSE 421 Algorithms Richard Anderson Lecture 24 Network Flow Applications.
CSEP 521 Applied Algorithms Richard Anderson Lecture 10 NP Completeness.
Lecture 16 Maximum Matching. Incremental Method Transform from a feasible solution to another feasible solution to increase (or decrease) the value of.
Approximation Algorithms
Network Flow. Network flow formulation A network G = (V, E). Capacity c(u, v)  0 for edge (u, v). Assume c(u, v) = 0 if (u, v)  E. Source s and sink.
Data Structures & Algorithms Graphs
CSE 589 Part VI. Reading Skiena, Sections 5.5 and 6.8 CLR, chapter 37.
CSEP 521 Applied Algorithms Richard Anderson Winter 2013 Lecture 1.
CSE 421 Algorithms Richard Anderson Lecture 27 NP-Completeness and course wrap up.
CS223 Advanced Data Structures and Algorithms 1 Maximum Flow Neil Tang 3/30/2010.
Instructor Neelima Gupta Table of Contents Five representative problems.
CSCI-256 Data Structures & Algorithm Analysis Lecture Note: Some slides by Kevin Wayne. Copyright © 2005 Pearson-Addison Wesley. All rights reserved. 25.
CSEP 521 Applied Algorithms Richard Anderson Winter 2013 Lecture 3.
CSCI 256 Data Structures and Algorithm Analysis Lecture 2 Some slides by Kevin Wayne copyright 2005, Pearson Addison Wesley all rights reserved, and some.
CSEP 521 Applied Algorithms Richard Anderson Lecture 8 Network Flow.
CSE 421 Algorithms Richard Anderson Lecture 27 NP-Completeness Proofs.
CSCI-256 Data Structures & Algorithm Analysis Lecture Note: Some slides by Kevin Wayne. Copyright © 2005 Pearson-Addison Wesley. All rights reserved. 3.
EECS 203 Lecture 19 Graphs.
Richard Anderson Lectures NP-Completeness
Richard Anderson Lecture 26 NP-Completeness
Richard Anderson Lecture 29 NP-Completeness and course wrap-up
Piyush Kumar (Lecture 1: Introduction)
Richard Anderson Lecture 26 NP-Completeness
Piyush Kumar (Lecture 1: Introduction)
EECS 203 Lecture 20 More Graphs.
Graph Theory and Algorithm 02
Algorithms and Networks
Algorithm Design and Analysis
Lectures on Network Flows
Richard Anderson Lecture 23 Network Flow
Lecture 22 Network Flow, Part 2
The Taxi Scheduling Problem
Richard Anderson Lecture 25 NP-Completeness
Richard Anderson Lecture 28 NP-Completeness
Richard Anderson Lecture 28 Coping with NP-Completeness
Lecture 19-Problem Solving 4 Incremental Method
Richard Anderson Lecture 29 Complexity Theory
CSE 421 Richard Anderson Autumn 2016, Lecture 3
Vertex Covers, Matchings, and Independent Sets
Linear Programming Duality, Reductions, and Bipartite Matching
Richard Anderson Lecture 30 NP-Completeness
Richard Anderson Lecture 6 Greedy Algorithms
Richard Anderson Lecture 25 Network Flow Applications
CSE 421 Richard Anderson Autumn 2015, Lecture 3
Richard Anderson Autumn 2016 Lecture 7
Lecture 18 CSE 331 Oct 9, 2017.
Richard Anderson Lecture 7 Greedy Algorithms
Richard Anderson Lecture 26 NP-Completeness
Piyush Kumar (Lecture 1: Introduction)
The Theory of NP-Completeness
Richard Anderson Winter 2019 Lecture 1
Richard Anderson Lecture 27 Survey of NP Complete Problems
Richard Anderson Winter 2019 Lecture 7
CSE 421, University of Washington, Autumn 2006
Winter 2019 Lecture 11 Minimum Spanning Trees (Part II)
Piyush Kumar (Lecture 1: Introduction)
Richard Anderson Autumn 2015 Lecture 7
Lecture 22 Network Flow, Part 2
Vertex Covers and Matchings
Richard Anderson Autumn 2019 Lecture 7
CSE 421 Richard Anderson Autumn 2019, Lecture 3
Presentation transcript:

CSE 421 Richard Anderson Winter 2019, Lecture 3 Five Problems CSE 421 Richard Anderson Winter 2019, Lecture 3

Announcements Course website: Office hours Richard Anderson Monday, 2:40 pm - 3:30 pm, CSE 582 Wednesday, 2:40 pm - 3:30 pm, CSE 582 Leiyi Zhang, Monday, 10:30 am-11:20 am, CSE 4th floor breakout Aditya Saraf, Monday, 11:30 am – 12:20 pm, Gates 151 Sean Jaffe, Monday, 3:00 pm – 3:50 pm, Gates 152 Mathew Luo, Tuesday, 10:30 am – 11:20 am, Gates 151 Faye Yu, Tuesday, 2:00 pm – 2:50 pm, CSE 007 Anny Kong, Thursday, 1:00 pm – 1:50 pm, CSE 021 Phillip Quinn, Friday, 2:30 pm – 3:20 pm, Gates 153 Xin Yang, Friday, 4:00 pm – 4:50 pm, CSE 220 //courses.cs.washington.edu/courses/cse421/19wi/

Theory of Algorithms What is expertise? How do experts differ from novices? Point of slide – experts have a Structure of knowledge

Introduction of five problems Show the types of problems we will be considering in the class Examples of important types of problems Similar looking problems with very different characteristics Problems Scheduling Weighted Scheduling Bipartite Matching Maximum Independent Set Competitive Facility Location

What is a problem? Instance Solution Constraints on solution Example: Minimum Spanning Tree What is a problem? Instance Solution Constraints on solution Measure of value Graph Set of edges Tree constraints Edge costs

Problem: Scheduling Suppose that you own a banquet hall You have a series of requests for use of the hall: (s1, f1), (s2, f2), . . . Find a set of requests as large as possible with no overlap

What is the largest solution?

Greedy Algorithm Test elements one at a time if they can be members of the solution If an element is not ruled out by earlier choices, add it to the solution Many possible choices for ordering (length, start time, end time) For this problem, considering the jobs by increasing end time works

Suppose we add values? (si, fi, vi), start time, finish time, payment Maximize value of elements in the solution 2 1 5 1 2 4 1 3 1 6

Greedy Algorithms Earliest finish time Maximum value 1 Earliest finish time Maximum value Give counter examples to show these algorithms don’t find the maximum value solution 2 2 2 3

Dynamic Programming Requests R1, R2, R3, . . . Assume requests are in increasing order of finish time (f1 < f2 < f3 . . .) Opti is the maximum value solution of {R1, R2, . . ., Ri} containing Ri Opti = Max{ j | fj < si }[Optj + vi]

Matching Given a bipartite graph G=(U,V,E), find a subset of the edges M of maximum size with no common endpoints. Application: U: Professors V: Courses (u,v) in E if Prof. u can teach course v

Find a maximum matching

Augmenting Path Algorithm s t Trace path from s to t to show augmenting path

Reduction to network flow More general problem Send flow from source to sink Flow subject to capacities at edges Flow conserved at vertices Can solve matching as a flow problem

Maximum Independent Set Given an undirected graph G=(V,E), find a set I of vertices such that there are no edges between vertices of I Find a set I as large as possible

Find a Maximum Independent Set C D B E F G H K J O S L I N T R M U Q P

Verification: Prove the graph has an independent set of size 8

Key characteristic Hard to find a solution Easy to verify a solution once you have one Other problems like this Hamiltonian circuit Clique Subset sum Graph coloring

NP-Completeness Theory of Hard Problems A large number of problems are known to be equivalent Very elegant theory

Are there even harder problems? Simple game: Players alternating selecting nodes in a graph Score points associated with node Remove nodes neighbors When neither can move, player with most points wins 4 3 2 6 5 2 3 4 1 6

5 6 4 6 5 5 6 4 1 6 2 1 4 2 5 8 7 8 5 4 4 5 4 3 4

Competitive Facility Location Choose location for a facility Value associated with placement Restriction on placing facilities too close together Competitive Different companies place facilities E.g., KFC and McDonald’s

Complexity theory These problems are P-Space complete instead of NP-Complete Appear to be much harder No obvious certificate G has a Maximum Independent Set of size 10 Player 1 wins by at least 10 points

Summary Scheduling Weighted Scheduling Bipartite Matching Maximum Independent Set Competitive Scheduling