Download - CS5234 Combinatorial and Graph Algorithms
![Page 1: CS5234 Combinatorial and Graph Algorithms](https://reader036.vdocuments.us/reader036/viewer/2022081502/5681692e550346895de07462/html5/thumbnails/1.jpg)
CS5234Combinatorial and Graph Algorithms
Welcome!
![Page 2: CS5234 Combinatorial and Graph Algorithms](https://reader036.vdocuments.us/reader036/viewer/2022081502/5681692e550346895de07462/html5/thumbnails/2.jpg)
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](https://reader036.vdocuments.us/reader036/viewer/2022081502/5681692e550346895de07462/html5/thumbnails/3.jpg)
Algorithms for Combinatorial Optimization
![Page 4: CS5234 Combinatorial and Graph Algorithms](https://reader036.vdocuments.us/reader036/viewer/2022081502/5681692e550346895de07462/html5/thumbnails/4.jpg)
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](https://reader036.vdocuments.us/reader036/viewer/2022081502/5681692e550346895de07462/html5/thumbnails/5.jpg)
“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](https://reader036.vdocuments.us/reader036/viewer/2022081502/5681692e550346895de07462/html5/thumbnails/6.jpg)
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](https://reader036.vdocuments.us/reader036/viewer/2022081502/5681692e550346895de07462/html5/thumbnails/7.jpg)
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](https://reader036.vdocuments.us/reader036/viewer/2022081502/5681692e550346895de07462/html5/thumbnails/8.jpg)
Algorithms for Combinatorial Optimization
![Page 9: CS5234 Combinatorial and Graph Algorithms](https://reader036.vdocuments.us/reader036/viewer/2022081502/5681692e550346895de07462/html5/thumbnails/9.jpg)
Optimization:Find the minimum/maximum of…
Combinatorial Optimization
![Page 10: CS5234 Combinatorial and Graph Algorithms](https://reader036.vdocuments.us/reader036/viewer/2022081502/5681692e550346895de07462/html5/thumbnails/10.jpg)
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](https://reader036.vdocuments.us/reader036/viewer/2022081502/5681692e550346895de07462/html5/thumbnails/11.jpg)
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](https://reader036.vdocuments.us/reader036/viewer/2022081502/5681692e550346895de07462/html5/thumbnails/12.jpg)
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](https://reader036.vdocuments.us/reader036/viewer/2022081502/5681692e550346895de07462/html5/thumbnails/13.jpg)
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](https://reader036.vdocuments.us/reader036/viewer/2022081502/5681692e550346895de07462/html5/thumbnails/14.jpg)
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](https://reader036.vdocuments.us/reader036/viewer/2022081502/5681692e550346895de07462/html5/thumbnails/15.jpg)
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](https://reader036.vdocuments.us/reader036/viewer/2022081502/5681692e550346895de07462/html5/thumbnails/16.jpg)
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](https://reader036.vdocuments.us/reader036/viewer/2022081502/5681692e550346895de07462/html5/thumbnails/17.jpg)
Five Representative Problems
Combinatorial Optimization
![Page 18: CS5234 Combinatorial and Graph Algorithms](https://reader036.vdocuments.us/reader036/viewer/2022081502/5681692e550346895de07462/html5/thumbnails/18.jpg)
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](https://reader036.vdocuments.us/reader036/viewer/2022081502/5681692e550346895de07462/html5/thumbnails/19.jpg)
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](https://reader036.vdocuments.us/reader036/viewer/2022081502/5681692e550346895de07462/html5/thumbnails/20.jpg)
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](https://reader036.vdocuments.us/reader036/viewer/2022081502/5681692e550346895de07462/html5/thumbnails/21.jpg)
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](https://reader036.vdocuments.us/reader036/viewer/2022081502/5681692e550346895de07462/html5/thumbnails/22.jpg)
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](https://reader036.vdocuments.us/reader036/viewer/2022081502/5681692e550346895de07462/html5/thumbnails/23.jpg)
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](https://reader036.vdocuments.us/reader036/viewer/2022081502/5681692e550346895de07462/html5/thumbnails/24.jpg)
• 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](https://reader036.vdocuments.us/reader036/viewer/2022081502/5681692e550346895de07462/html5/thumbnails/25.jpg)
• 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](https://reader036.vdocuments.us/reader036/viewer/2022081502/5681692e550346895de07462/html5/thumbnails/26.jpg)
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](https://reader036.vdocuments.us/reader036/viewer/2022081502/5681692e550346895de07462/html5/thumbnails/27.jpg)
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](https://reader036.vdocuments.us/reader036/viewer/2022081502/5681692e550346895de07462/html5/thumbnails/28.jpg)
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](https://reader036.vdocuments.us/reader036/viewer/2022081502/5681692e550346895de07462/html5/thumbnails/29.jpg)
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](https://reader036.vdocuments.us/reader036/viewer/2022081502/5681692e550346895de07462/html5/thumbnails/30.jpg)
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](https://reader036.vdocuments.us/reader036/viewer/2022081502/5681692e550346895de07462/html5/thumbnails/31.jpg)
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](https://reader036.vdocuments.us/reader036/viewer/2022081502/5681692e550346895de07462/html5/thumbnails/32.jpg)
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](https://reader036.vdocuments.us/reader036/viewer/2022081502/5681692e550346895de07462/html5/thumbnails/33.jpg)
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](https://reader036.vdocuments.us/reader036/viewer/2022081502/5681692e550346895de07462/html5/thumbnails/34.jpg)
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](https://reader036.vdocuments.us/reader036/viewer/2022081502/5681692e550346895de07462/html5/thumbnails/35.jpg)
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](https://reader036.vdocuments.us/reader036/viewer/2022081502/5681692e550346895de07462/html5/thumbnails/36.jpg)
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](https://reader036.vdocuments.us/reader036/viewer/2022081502/5681692e550346895de07462/html5/thumbnails/37.jpg)
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](https://reader036.vdocuments.us/reader036/viewer/2022081502/5681692e550346895de07462/html5/thumbnails/38.jpg)
Introduction to Algorithms– Cormen, Leiserson, Rivest, Stein
– Recommended…
Textbooks
![Page 39: CS5234 Combinatorial and Graph Algorithms](https://reader036.vdocuments.us/reader036/viewer/2022081502/5681692e550346895de07462/html5/thumbnails/39.jpg)
Algorithm Design– Kleinberg and Tardos
– Recommended…
Textbooks
![Page 40: CS5234 Combinatorial and Graph Algorithms](https://reader036.vdocuments.us/reader036/viewer/2022081502/5681692e550346895de07462/html5/thumbnails/40.jpg)
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