Top Banner
CS5234 Combinatorial and Graph Algorithms Welcome!
40

CS5234 Combinatorial and Graph Algorithms

Feb 26, 2016

Download

Documents

faris

CS5234 Combinatorial and Graph Algorithms. Welcome!. Combinatorial & Graph Algorithms http:// www.comp.nus.edu.sg/~ cs5234/ 2013/ Instructor: Seth Gilbert Office: COM2-323 Office hours: by appointment. CS5234 Overview. Algorithms for Combinatorial Optimization. Algorithms. - PowerPoint PPT Presentation
Welcome message from author
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
Page 1: CS5234 Combinatorial and Graph Algorithms

CS5234Combinatorial and Graph Algorithms

Welcome!

Page 2: CS5234 Combinatorial and Graph Algorithms

CS5234 OverviewCombinatorial & Graph

Algorithmshttp://www.comp.nus.edu.sg/~cs5234/2013/

Instructor: Seth GilbertOffice: COM2-323Office hours: by appointment

Page 3: CS5234 Combinatorial and Graph Algorithms

Algorithms for Combinatorial Optimization

Page 4: CS5234 Combinatorial and Graph Algorithms

What is an algorithm?– Set of instructions for solving a problem

“First, wash the tomatoes.”“Second, peel and cut the carrots.”“Third, mix the olive oil and vinegar.”“Finally, combine everything in a bowl.”

– Finite sequence of steps– Unambiguous– English, Chinese, pseudocode, Java, etc.

Algorithms

Page 5: CS5234 Combinatorial and Graph Algorithms

“If you need your software to run twice as fast, hire better programmers.

But if you need your software to run more than twice as fast, use a better algorithm.”

-- Software Lead at Microsoft

Page 6: CS5234 Combinatorial and Graph Algorithms

Goals: Algorithmic1. Design (problem solving)

2. Analysis (rigorous, deep understanding)

3. Implementation (able to put it to use)

Page 7: CS5234 Combinatorial and Graph Algorithms

Goals: Algorithmic1. Design (problem solving)

2. Analysis (rigorous, deep understanding)

3. Implementation (able to put it to use)

Page 8: CS5234 Combinatorial and Graph Algorithms

Algorithms for Combinatorial Optimization

Page 9: CS5234 Combinatorial and Graph Algorithms

Optimization:Find the minimum/maximum of…

Combinatorial Optimization

Page 10: CS5234 Combinatorial and Graph Algorithms

Optimization:Find the minimum/maximum of:

Continuous optimization: a function f

Discrete optimization: a collection of items

Combinatorial Optimization

Page 11: CS5234 Combinatorial and Graph Algorithms

Discrete Optimization:Find the “best” item in a large set of items.

Combinatorial Optimization:Find the “best” item in a large set of items generated by a combinatorial process.

Combinatorial: finite discrete structure

Combinatorial process: counting, combining, enumerating

Combinatorial Optimization

Page 12: CS5234 Combinatorial and Graph Algorithms

Discrete Optimization:Find the “best” item in a large set of items.

Combinatorial Optimization:Find the “best” item in a large set of items generated by a combinatorial process.

GraphsMatroidsSimilar structures…

Combinatorial Optimization

Page 13: CS5234 Combinatorial and Graph Algorithms

Find the “best” item in a large set of items:Problem Set of items Size DifficultySearching List of integersLinear EasyShortest paths All paths in a graph Exponential EasyMinimum spanning tree All spanning trees ExponentialEasySteiner tree All steiner trees Exponential HardTravelling salesman All possible tours Exponential HardMatching All possible matchings Exponential EasyBipartite vertex cover All possible covers Exponential EasyVertex cover All possible covers Exponential HardMaximum clique All possible subsets Exponential Very Hard

Combinatorial Optimization

Page 14: CS5234 Combinatorial and Graph Algorithms

Find the “best” item in a large set of items:Problem DifficultyMaintain student records EasyData compression EasyProgram halting problem ImpossibleVLSI chip layout HardExam timetable scheduling HardJob assignment problem EasyComputer deadlock problem EasyFinding patterns in a database Easy

Combinatorial Optimization

Page 15: CS5234 Combinatorial and Graph Algorithms

Operations Research:How to make better decisions (e.g., maximize profit)

Project planning / critical path analysisFacility location: where to open stores / plantsFloorplanning: layout of factory or computer chipsSupply chain managementBerth assignment problem (BAP): port managementAssignment problems (e.g., weapon target assignment)Routing / transportation problems: buses, subways,

trucking.Airline ticket pricing

Combinatorial Optimization

Page 16: CS5234 Combinatorial and Graph Algorithms

What do we do when problems are NP-hard?

1. Find exponential time solutions

2. Average performance

3. Approximate– Algorithm is efficient– Solution is sub-optimal– Provable guarantee: ratio of output to

optimal

Combinatorial Optimization

Page 17: CS5234 Combinatorial and Graph Algorithms

Five Representative Problems

Combinatorial Optimization

Page 18: CS5234 Combinatorial and Graph Algorithms

Input: Set of jobs with start and finish timesOutput: Maximum cardinality subset of

compatible jobs

1. Interval Scheduling

Time0 1 2 3 4 5 6 7 8 9 10 11

f

g

h

e

a

b

c

d

h

e

b

Jobs don’t overlap

Page 19: CS5234 Combinatorial and Graph Algorithms

Input: Set of weighted jobs with start and finish times

Output: Maximum weight subset of compatible jobs

2. Weighted Interval Scheduling

Time0 1 2 3 4 5 6 7 8 9 10 11

20

11

16

13

23

12

20

26

Page 20: CS5234 Combinatorial and Graph Algorithms

Input: Bipartite graphOutput: Maximum cardinality matching

3. Bipartite Matching

C

1

5

2

A

E

3

B

D 4

Page 21: CS5234 Combinatorial and Graph Algorithms

Input: GraphOutput: Maximum cardinality independent set

4. Independent set

6

2

5

1

7

3

4

6

5

1

4

subset of nodes such that no two joined by an edge

Page 22: CS5234 Combinatorial and Graph Algorithms

Input: Graph with weighted nodesGame: Two players alternate in selecting

nodes. Cannot select a node if any of its neighbors have been selected.

Goal: Select a maximum weight subset of nodes.

5. Competitive facility location

10 1 5 15 5 1 5 1 15 10

Second player can get 20, but not 25.

Page 23: CS5234 Combinatorial and Graph Algorithms

Variations on a theme: Independent Set

Interval scheduling: Greedy O(n log n)Weighted Interval scheduling: Dynamic programming O(n

log n)Bipartite matching: O(nk) max-flow algorithmIndependent set: NP-completeCompetitive facility location: PSPACE-complete

Five problems

Page 24: CS5234 Combinatorial and Graph Algorithms

• General combinatorial problem– Given a finite, discrete set S of objects – Minimize/maximize some function f (S)

• Algorithmic Issues…– Representation of the set S – Efficient manipulation of the set S– Efficient algorithm to compute f (S)

Combinatorial Optimization

Page 25: CS5234 Combinatorial and Graph Algorithms

• Given a problem P,– Can it be solved?

• If “Yes”, give an algorithm A for solving P, – Is algorithm A correct ?– How good is algorithm A ?– Can we find a better algorithm A’ ?

• How do we define good?– How much time it takes. – How much space it uses.

StrategyComputability

Verification

Efficiency

Time Complexity

Space Complexity

Page 26: CS5234 Combinatorial and Graph Algorithms

Goals of this course:– Advanced design and analysis of algorithms:

• Efficiency – Time: How long does it take?– Space: How much memory? How much disk?– Others: Energy, power, heat, parallelism, etc.

• Scalability– Inputs are large : e.g., the internet.– Bigger problems consume more resources.

– Solve important (fun!) problems in combinatorial optimization

Algorithms for Combinatorial Optimization

Page 27: CS5234 Combinatorial and Graph Algorithms

Target students:– Beginning graduate students– Advanced (4th year) undergraduates– Anyone planning to do research in

algorithmic design

Prerequisites: – CS3230 (Analysis of Algorithms), or

equivalent– Strong programming skills

Algorithms for Combinatorial Optimization

Page 28: CS5234 Combinatorial and Graph Algorithms

You must already know these:• Data Structures (with analyses)

– Stacks, Queues, Lists, – Binary search trees, balanced trees, – Heaps and priority queues

• Algorithm Design Paradigms (with Analysis)– Standard sorting and searching algorithms– Graph algorithms: DFS, BFS, – Shortest Path Algorithms, MST Algorithms– Greedy Algorithms, Divide-and-Conquer

Algorithms for Combinatorial Optimization

Page 29: CS5234 Combinatorial and Graph Algorithms

You must already know these:• Analysis of Algorithms

– Expertise with Big-O, , notations– Summation of series, Master Theorem– Competent with Algorithmic Analysis:

Quicksort, Heapsort, Divide-and-Conquer algorithms

DFS, BFS, Shortest Path & MST algorithms

Algorithms for Combinatorial Optimization

Page 30: CS5234 Combinatorial and Graph Algorithms

Assumed knowledge:– Data structures and algorithms – Good programming skills– CS3230 (Analysis of Algorithms)

Not a course to learn algorithms: – If not, take CS3230 instead.

Algorithms for Combinatorial Optimization

Page 31: CS5234 Combinatorial and Graph Algorithms

Mid-term examOctober 8 In class

Final exam

November 19 Reading WeekExams will be graded and returned.

CS5234 Overview

Page 32: CS5234 Combinatorial and Graph Algorithms

Grading40% Problem sets 25% Mid-term exam35% Final exam

Problem sets

– 6-7 sets (about every 1-2 weeks)– A few will have programming components

(C++).

CS5234 Overview

Page 33: CS5234 Combinatorial and Graph Algorithms

Problem sets released by tomorrow morning

PS0: Covers background knowledge. Do not submit.

PS1: Routine problems --- easy practice. Do not submit.

Standard problems --- to be submitted.Advanced problems --- for a

challenge/fun. Do not submit.

CS5234 Overview

Page 34: CS5234 Combinatorial and Graph Algorithms

Problem set gradingDistributed grading scheme:

Each of you will be responsible for grading one week during the semester.

Grading supervised (and verified) by the TA.

CS5234 Overview

Page 35: CS5234 Combinatorial and Graph Algorithms

What to submit:Concise and precise answers: Solutions should be rigorous, containing all necessary detail, but no more. Algorithm descriptions consist of:

1. Summary of results/claims.2. Description of algorithm in English.3. Pseudocode, if helpful. 4. Worked example of algorithm. 5. Diagram / picture. 6. Proof of correctness and performance analysis.

CS5234 Overview

Page 36: CS5234 Combinatorial and Graph Algorithms

Policy on plagiarism:Do your work yourself:

Your submission should be unique, unlike anything else submitted, on the web, etc. Discuss with other students:

1. Discuss general approach and techniques.2. Do not take notes.

3. Spend 30 minutes on facebook (or equiv.).4. Write up solution on your own. 5. List all collaborators.Do not search for solutions on the web:

Use web to learn techniques and to review material from class.

CS5234 Overview

Page 37: CS5234 Combinatorial and Graph Algorithms

Policy on plagiarism:Penalized severely:

First offense: minimum of one letter grade lost on final grade for class (or referral to SoC disciplinary committee).

Second offense: F for the class and/or referral to SoC.

Do not copy/compare solutions!

CS5234 Overview

Page 38: CS5234 Combinatorial and Graph Algorithms

Introduction to Algorithms– Cormen, Leiserson, Rivest, Stein

– Recommended…

Textbooks

Page 39: CS5234 Combinatorial and Graph Algorithms

Algorithm Design– Kleinberg and Tardos

– Recommended…

Textbooks

Page 40: CS5234 Combinatorial and Graph Algorithms

Topics (tentative, TBD)Introduction to combinatorial optimization Vertex cover, set cover, Steiner tree, TSP Flows and matching

Maximum flow, bipartite matching Graph partitioning

Heuristics, spectral bisectionLinear programming

LPs, duality, relaxations, rounding

CS5234 Overview