CSE 417 Practical Algorithms. (a.k.a. Algorithms & Computational Complexity)

Similar documents
CSE 332: Data Abstractions. Ruth Anderson Spring 2014 Lecture 1

CS 4349 Lecture August 21st, 2017

CS583 Lecture 01. Jana Kosecka. some materials here are based on Profs. E. Demaine, D. Luebke A.Shehu, J-M. Lien and Prof. Wang s past lecture notes

Overview. CSE 101: Design and Analysis of Algorithms Lecture 1

CS 380 ALGORITHM DESIGN AND ANALYSIS

CSC 325 Algorithms & Advanced Data Structures

Design and Analysis of Algorithms. Comp 271. Mordecai Golin. Department of Computer Science, HKUST

CSC 325 Algorithms & Advanced Data Structures.

CS 483. Jana Kosecka CS Dept Eng. Building

Announcements. 1. Forms to return today after class:

COMP251: Algorithms and Data Structures. Jérôme Waldispühl School of Computer Science McGill University

COMP Analysis of Algorithms & Data Structures

CS/ENGRD 2110 Object-Oriented Programming and Data Structures Spring 2012 Thorsten Joachims

Introduction to Computer Science

Lecture Notes CPSC 321 (Fall 2018) Today... Survey. Course Overview. Homework. HW1 (out) S. Bowers 1 of 8

Introduction to Computer Science

CS 240 Fall 2015 Section 004. Alvin Chao, Professor

COMP 117: Internet-scale Distributed Systems Lessons from the World Wide Web

CSE 240 Introduction to Computer Architecture

CS/COE 1501 cs.pitt.edu/~bill/1501/ Introduction

Algorithms and Data Structures, or

CS 374: Algorithms & Models of Computation

ECE250: Algorithms and Data Structures Final Review Course

CSC 1052 Algorithms & Data Structures II: Introduction

CSE331 Introduction to Algorithms Lecture 15 Minimum Spanning Trees

CSE373: Data Structures & Algorithms Lecture 28: Final review and class wrap-up. Nicki Dell Spring 2014

VE281 Data Structures and Algorithms. Introduction and Asymptotic Algorithm Analysis

CS 240 Fall Mike Lam, Professor. Just-for-fun survey:

Design and Analysis of Algorithms

Algorithms and Data Structures

Partha Sarathi Mandal

CSE 417 Branch & Bound (pt 4) Branch & Bound

CS/ENGRD 2110 Object-Oriented Programming and Data Structures Spring 2012 Thorsten Joachims. Lecture 25: Review and Open Problems

Virtual University of Pakistan

CS 241 Data Organization. August 21, 2018

Table of Contents. Course Minutiae. Course Overview Algorithm Design Strategies Algorithm Correctness Asymptotic Analysis 2 / 32

Bulldozers/Sites A B C D

Design and Analysis of Algorithms

CSE 544 Principles of Database Management Systems

Combinatorial Optimization

Introduction to Data Management (Database Systems) CSE 414

EECS 3101: Introduction to the Design and Analysis of Algorithms Instructor: Suprakash Datta (datta[at]cse.yorku.ca) ext 77875

CSE 100 Minimum Spanning Trees Prim s and Kruskal

CS2013 Course Syllabus Spring 2018 Lecture: Mon/Wed 2:00 P.M. 2:50 P.M. SH C259 Lab: Mon/Wed 2:50 P.M. 4:00 P.M. SH C259

Introduction to Data Mining

Caches II. CSE 351 Spring Instructor: Ruth Anderson

Introduction to Parallel Computing

CSC 172 Data Structures and Algorithms. Fall 2017 TuTh 3:25 pm 4:40 pm Aug 30- Dec 22 Hoyt Auditorium

Data Structures and Algorithms

CSE 141: Computer Architecture. Professor: Michael Taylor. UCSD Department of Computer Science & Engineering

CSE 373: Data Structures and Algorithms

CS/COE 1501

E40M. An Introduction to Making: What is EE?

Lecture 1 (Part 1) Introduction/Overview

CSC 261/461 Database Systems. Fall 2017 MW 12:30 pm 1:45 pm CSB 601

Math 381 Discrete Mathematical Modeling

Introduction to Computer Systems

COMP 322 / ELEC 323: Fundamentals of Parallel Programming

TOTAL CREDIT UNITS L T P/ S SW/F W. Course Title: Analysis & Design of Algorithm. Course Level: UG Course Code: CSE303 Credit Units: 5

Minimum Spanning Trees

COLLEGE OF DUPAGE CIS 2542 Advanced C++ with Data Structure Applications Course Syllabus

Union Find and Greedy Algorithms. CSE 101: Design and Analysis of Algorithms Lecture 8

CSE 167: Introduction to Computer Graphics. Jürgen P. Schulze, Ph.D. University of California, San Diego Fall Quarter 2016

We ve done. Introduction to the greedy method Activity selection problem How to prove that a greedy algorithm works Fractional Knapsack Huffman coding

Advanced Compiler Design. CSE 231 Instructor: Sorin Lerner

CS 4349 Lecture October 18th, 2017

School of Computing and Information Sciences. Course Title: Data Structures Date: 3/30/2010 Course Number: COP 3530 Number of Credits: 3

MAE 384 Numerical Methods for Engineers

The minimum spanning tree and duality in graphs

Kathryn Chan, Kevin Bi, Ryan Wong, Waylon Huang, Xinyu Sui

Advanced Programming CMPS 109

CS 378 (Spring 2003) Linux Kernel Programming. Yongguang Zhang. Copyright 2003, Yongguang Zhang

Problem set 2. Problem 1. Problem 2. Problem 3. CS261, Winter Instructor: Ashish Goel.

CPSC 2380 Data Structures and Algorithms

Notes slides from before lecture. CSE 21, Winter 2017, Section A00. Lecture 4 Notes. Class URL:

CS61C Machine Structures. Lecture 1 Introduction. 8/27/2006 John Wawrzynek (Warzneck)

Introduction to Optimization

Programming for Engineers in Python

CS 200, Section 1, Programming I, Fall 2017 College of Arts & Sciences Syllabus

San José State University Department of Computer Science CS-144, Advanced C++ Programming, Section 1, Spring 2018

Algorithms and Data Structures. Algorithms and Data Structures. Algorithms and Data Structures. Algorithms and Data Structures

CS 170 Second Midterm ANSWERS 7 April NAME (1 pt): SID (1 pt): TA (1 pt): Name of Neighbor to your left (1 pt):

Inf2C - Computer Systems Lecture 1 Course overview & the big picture

ISM 324: Information Systems Security Spring 2014

Introduction to Optimization

CSE 417 Network Flows (pt 3) Modeling with Min Cuts

CSE 373: Introduction, ADTs, Design Decisions, Generics. Michael Lee Wednesday Jan 3, 2017

Introduction To Algorithms 3rd Edition Solutions Download

Instructors. ECE 152 Introduction to Computer Architecture. Undergrad Teaching Assistants. Course Website. Textbook.

CSE 142. Lecture 1 Course Introduction; Basic Java. Portions Copyright 2008 by Pearson Education

CSci 4211: Introduction to Computer Networks. Time: Monday and Wednesday 2:30 to 3:45 pm Location: Smith Hall 231 Fall 2018, 3 Credits

You must pass the final exam to pass the course.

CS 106B, Lecture 1 Introduction to C++

Review: Performance Latency vs. Throughput. Time (seconds/program) is performance measure Instructions Clock cycles Seconds.

CSE 240 Introduction to Computer Architecture

Introduction to Optimization

Name: Lirong TAN 1. (15 pts) (a) Define what is a shortest s-t path in a weighted, connected graph G.

Syllabus COSC-051-x - Computer Science I Fall Office Hours: Daily hours will be entered on Course calendar (or by appointment)

Class Note #02. [Overall Information] [During the Lecture]

Design and Analysis of Algorithms

Transcription:

CSE 417 Practical Algorithms (a.k.a. Algorithms & Computational Complexity)

Outline for Today > Course Goals & Overview > Administrivia > Greedy Algorithms

Why study algorithms? > Learn the history of important algorithms

Why study algorithms? > Learn the history of important algorithms

Why study algorithms? > Learn the history of important algorithms > Appreciate their beauty

Why study algorithms? > Learn the history of important algorithms > Appreciate their beauty

Why study algorithms? > Learn the history of important algorithms > Appreciate their beauty > Impress your friends with your knowledge

Why study algorithms? > Learn the history of important algorithms > Appreciate their beauty > Impress your friends with your knowledge

Why study algorithms? > Learn the history of important algorithms > Appreciate their beauty > Impress your friends with your knowledge > Inventing new algorithms is part of the everyday work of computer scientists in practice

Why study algorithms? > Learn the history of important algorithms > Appreciate their beauty > Impress your friends with your knowledge > Inventing new algorithms is part of the everyday work of computer scientists in practice

Why study algorithms? > Learn the history of important algorithms > Appreciate their beauty > Impress your friends with your knowledge > Inventing new algorithms is part of the everyday work of computer scientists in practice > Algorithms are critical to the successful use of computers in every subfield of CS

Applications of Important Algorithms > compilers > databases > networking > cryptography > AI & machine learning > computational biology > signal processing > computer graphics > scientific computing > web search > big data analytics >...

Applications of Important Algorithms Everyone knows Moore s law a prediction made in 1965 by Intel co-founder Gordon Moore that the density of transistors in integrated circuits would continue to double every 1 to 2 years... In many areas, performance gains due to improvements in algorithms have vastly exceeded the dramatic performance gains due to increased processor speed. Excerpt from Report to the President and Congress: Designing a Digital Future, December 2010 (page 71)

Why study algorithms? > Algorithms are critical to the successful use of computers in every subfield of computer science understanding the underlying techniques will make these algorithms easier to follow when you encounter them in other subfields > There will be opportunities to invent new algorithms in practice and when you do so, it often has a huge impact the previous slides are examples of this > (Algorithms also come up in coding interviews.)

Course Goal > Teach you techniques that you can use to create new algorithms in practice when the opportunity arises (or in coding interviews) they will also help you understand existing algorithms

Course Non-Goals > Teach you the most historically important algorithms we will see some important algorithms, but this will not be a survey course on important algorithms > Teach you the fastest known algorithms for problems they are usually not the best demonstrations of the techniques that we want to discuss

Course Topics 1. Shortest Paths (mainly in HW) 2. Binary Search 3. Divide & Conquer 4. Dynamic Programming 5. Network Flows 6. Branch & Bound

Course Topics Design Techniques 1. Divide & Conquer 2. Dynamic Programming 3. Branch & Bound Modeling Techniques 1. Shortest Paths 2. Binary Search 3. Network Flows

Course Topics Design Techniques 1. Divide & Conquer 2. Dynamic Programming 3. Branch & Bound Techniques that you can apply to design new algorithms each of these has a good chance of being useful in practice

Course Topics Modeling Techniques 1. Shortest Paths 2. Binary Search 3. Network Flows Solve new problems by transforming them into familiar ones these three are the most likely to show up in practice learning to recognize them is a useful skill

Course Topics vs Usual 1. Binary Search 2. Divide & Conquer 3. Dynamic Programming 4. Network Flows 5. Branch & Bound 1. Greedy 2. Divide & Conquer 3. Dynamic Programming 4. Network Flows 5. NP-Completeness

Course Topics vs Usual 1. Binary Search 2. Divide & Conquer 3. Dynamic Programming 4. Network Flows 5. Branch & Bound (and NP-completeness) 1. Greedy (today only) 2. Divide & Conquer 3. Dynamic Programming 4. Network Flows 5. NP-Completeness > Topics will be fairly standard, but emphasis will be different

Outline for Today > Course Goals & Overview > Administrivia > Greedy Algorithms

People > Instructor Kevin Zatloukal kevinz at cs > TAs Phillip Dang phdang1 at uw Angli Liu anglil at uw Alon Milchgrub alonmil at uw

About Me > UW graduate > Ph.D. from MIT quantum algorithms > Worked in industry for 15 years Google, Microsoft, BEA Systems, startup

Prerequisites (from CSE 373) > Asymptotic complexity and big-o notation > Familiar with some algorithms for sorting shortest paths minimum spanning trees

Format > Lectures Mon, Wed, Fri slides will be posted but they are just visual aids > No quiz sections > Office hours Tue, Wed, Thu, Fri

Workload > 9 homework assignments 4 on paper 5 coding > final exam (no midterm)

Grading > 25% written assignments > 50% coding assignments > 25% final exam Coding assignments best test the skills I care about

Late Policy > 10 percent penalty per late day but life happens so... > 3 free late days for the quarter each is a 24 hour extension save for true emergencies

Collaboration > Discussing course content with others is encouraged > Be sure to use the Piazza discussion board > BUT assignments are to be completed individually misrepresenting others work as your own is academic misconduct > See the course web site for detailed policy

Web Site > Main source of info: OO times & locations assignments calendar link to Piazza (discussion board) > https://courses.cs.washington.edu/courses/cse417/18wi

Textbook > Algorithm Design by Kleinberg & Tardos good introduction and useful reference > Many other good books: e.g. Introduction to Algorithms by Cormen, Leiserson, & Rivest > I may also make use of other sources, especially: Combinatorial Optimization by Papadimitriou & Steiglitz Network Flows by Ahuja, Magnanti, & Orlin both are advanced texts but could be useful after the course

Other Materials > Tim Roughgarden (Stanford) has video lectures posted on youtube > They cover many of the topics that we will discuss He also has lectures from follow-on courses on some more advanced topics > Also testing out recording of these lectures...

Warning > Designing this version of the course from scratch all new assignments, some new topics, etc. > Will need your feedback reasonableness of workload choice of due dates topics that do and don t make sense etc.

Outline for Today > Course Goals & Overview > Administrivia > Greedy Algorithms

What is a greedy algorithm? > For problems that involve a series of choices often an optimization problem (e.g., max or min something) > Greedy approach makes each decision in a way that is optimal for that individual choice ignoring implications for future choices > Rarely does this ever produce optimal solutions...

Real-life example > When the alarm goes off in the morning, hitting the snooze button six times in a row seems like a great idea maximizes happiness during that time period > But those decisions affect future options available... > Sleeping through lecture is probably not optimal

What is a greedy algorithm? > The greedy approach rarely produces optimal solutions But sometimes it does! > Those are greedy algorithms they compute the actual solution (otherwise, it is called a greedy heuristic )

Example: minimum spanning tree > Input: connected, weighted graph G with n nodes > let F be an empty graph on the same nodes for i = 1 to n 1: add the lowest weight edge of G that does not create a cycle > This is Kruskal s algorithm returns a spanning tree: a graph with n 1 edges and no cycles > For each of the n 1 decisions of which edge to add, it chooses the edge of lowest weight no regard for implications on future choices

Example: minimum spanning tree > Clear that it returns a spanning tree > Not clear that it returns the minimum weight spanning tree > Choices we make in one iteration affect later iterations by picking the lowest weight edge in one cycle, we could miss out on an edge that we need in a later iteration adding one edge means some others won t be allowed in the future because they now create a cycle > We need an explanation of why this can t happen...

Kruskal: proof of correctness > Suppose that we pick edge e that is not in the MST > Removing e from F would disconnected graph into S & T F S e T

Kruskal: proof of correctness > Suppose that we pick edge e that is not in the MST > Removing e from F would disconnected graph into S & T > In the MST, adding e would create a cycle spanning S & T > Let f be another edge on this cycle that connects S and T: f MST S e T

Kruskal: proof of correctness > At the point in Kruskal s algorithm when e was added: graph F had a subset of the final edges, so S & T were disconnected hence, adding f would not have created a cycle either... so it was eligible to add > Since e had lowest weight amongst those: weight e <= weight f f F when about to add e S e T

Kruskal: proof of correctness > Replacing f with e in the MST cannot increase it s weight > Hence, there is an MST that includes e! > Now, repeat this for every edge until the MST is our tree... f MST* S e T

Why not cover greedy? > Usually have complex proofs of correctness skipped important details in the Kruskal example better for a math course than this one (see MATH 409) en.wikipedia.org/siberian_tiger > Rarely encountered in nature most have names you know: Dijkstra, Kruskal, Prim > Lulls you into thinking the greedy approach is usually correct it isn t! even when you aren t looking for exact solutions, greedy heuristics are rarely the best approach

Reminders > HW1 is posted due next Wednesday > Information on overloading on Friday