1.1 First Problem: Stable Matching. Six medical students and four hospitals. Student Preferences. s6 h3 h1 h4 h2. Stable Matching Problem

Size: px
Start display at page:

Download "1.1 First Problem: Stable Matching. Six medical students and four hospitals. Student Preferences. s6 h3 h1 h4 h2. Stable Matching Problem"

Transcription

1 //0 hapter Introduction: Some Representative Problems Slides by Kevin ayne. opyright 00 Pearson-ddison esley. ll rights reserved.. First Problem: Stable Matching Six medical students and four hospitals Student Preferences s h h h h Hospital Preferences s h h h h h s s s s s s s h h h h h s s s s s s s h h h h h s s s s s s s h h h h h s s s s s s s h h h h Matching Residents to Hospitals Goal. Given a set of preferences among hospitals and medical school students, design a self-reinforcing admissions process. Unstable pair: applicant x and hospital y are unstable if: x prefers y to x s assigned hospital. y prefers x to one of its admitted students. Stable assignment: ssignment with no unstable pairs. Natural and desirable condition. Individual self-interest will prevent any applicant/hospital deal from being made. Simplification of the Problem: ach student will find a hospital (create a no-pay hospital) ach student will find a different hospital (duplicate hospitals) It becomes a boy-girl matching problem. Perfect matching: n men and n women, everyone is matched to a unique one: ach man gets exactly one woman. ach woman gets exactly one man. Goal. Given n men and n women, find a "suitable" matching. Participants rate members of opposite sex. ach man lists women in order of preference from best to worst. ach woman lists men in order of preference from best to worst. Q. Is assignment -, -, - stable? Stability: no incentive for some pair of participants to undermine assignment. In matching M, an unmatched pair m-w is unstable if man m and woman w prefer each other to current partners. Unstable pair m-w could each improve by eloping. favorite least favorite st nd rd avier my ertha lare favorite least favorite st nd rd my ancey avier eus st nd rd avier my ertha lare st nd rd my ancey avier eus Stable matching: perfect matching with no unstable pairs. Stable matching problem. Given the preference lists of n men and n women, find a stable matching if one exists. ancey ertha my lare eus my ertha lare ertha avier ancey eus lare avier ancey eus ancey ertha my lare eus my ertha lare ertha avier ancey eus lare avier ancey eus

2 //0 Q. Is assignment -, -, - stable?. No. ertha and avier will hook up. Q. Is assignment -, -, - stable?. No. ertha and avier will hook up. Q. How about switch and? Q. Is assignment -, -, - stable?. No. ertha and avier will hook up. Q. How about switch and?. No. my and avier (or ancey) will hook up. st nd rd st nd rd avier my ertha lare ancey ertha my lare eus my ertha lare my ancey avier eus ertha avier ancey eus lare avier ancey eus st nd rd st nd rd avier my ertha lare ancey ertha my lare eus my ertha lare my ancey avier eus ertha avier ancey eus lare avier ancey eus st nd rd st nd rd avier my ertha lare ancey ertha my lare eus my ertha lare my ancey avier eus ertha avier ancey eus lare avier ancey eus 8 9 Propose-nd-Reject lgorithm Proof of orrectness: Termination Q. Is assignment -, -, - stable?. es. st nd rd st nd rd avier my ertha lare ancey ertha my lare eus my ertha lare my ancey avier eus ertha avier ancey eus lare avier ancey eus 0 Propose-and-reject algorithm. [Gale-Shapley 9] Intuitive method that guarantees to find a stable matching. Initialize each person to be free. while (some man is free and hasn't proposed to every woman) { hoose such a man m w = st woman on m's list to whom m has not yet proposed if (w is free) assign m and w to be engaged else if (w prefers m to her fiancé m') assign m and w to be engaged, and m' to be free else w rejects m st nd rd st nd rd avier my ertha lare ancey ertha my lare eus my ertha lare my ancey avier eus ertha avier ancey eus lare avier ancey eus Observation. Men propose to women in decreasing order of preference. Observation. Once a woman is matched, she never becomes unmatched; she only "trades up." laim. lgorithm terminates after at most n iterations of while loop. Pf. ach time through the while loop a man proposes to a new woman. There are only n possible proposals. ictor yatt avier ancey eus st nd rd th th my ertha lare iane rika st n(n-) + proposals required nd rd th th

3 //0 Proof of orrectness: Perfection Proof of orrectness: Stability Summary laim. ll men and women get matched. Suppose, for sake of contradiction, that eus is not matched upon termination of algorithm. Then some woman, say my, is not matched upon termination. y Observation, my was never proposed to. ut, eus proposes to everyone, since he ends up unmatched. laim. No unstable pairs. Suppose - is an unstable pair: each prefers each other to partner in Gale-Shapley matching S*. men propose in decreasing ase : never proposed to. order of preference prefers his GS partner to. - is stable. ase : proposed to. rejected (right away or later) prefers her GS partner to. - is stable. women only trade up S* my-ancey ertha-eus Stable matching problem. Given n men and n women, and their preferences, find a stable matching if one exists. Gale-Shapley algorithm. Guarantees to find a stable matching for any problem instance. Q. How to implement GS algorithm efficiently? Q. If there are multiple stable matchings, which one does GS find? In either case - is stable, a contradiction. fficient Implementation fficient implementation. e describe O(n ) time implementation. Representing men and women. ssume men are named,, n. ssume women are named ',, n'. ngagements. Maintain a list of free men, e.g., in a queue. Maintain two arrays wife[m], and husband[w]. set entry to 0 if unmatched if m matched to w then wife[m]=w and husband[w]=m Men proposing. For each man, maintain a list of women, ordered by preference. Maintain an array count[m] that counts the number of proposals made by man m. fficient Implementation omen rejecting/accepting. oes woman w prefer man m to man m'? For each woman, create inverse of preference list of men: pref[w][j] = m iff women w s j th preference is m iff inverse[w][m] = j onstant time access for each query after O(n ) preprocessing. my Pref st 8 nd rd th th th th 8 th my 8 th 8 th nd th Inverse rd th th st for w = to n for j = to n inverse[w][pref[w][j]] = j my () prefers man to since inverse[][] < inverse[][] Initialize each person to be free. Propose-nd-Reject lgorithm while (some man is free and hasn't proposed to every woman) { hoose such a man m w = st woman on m's list to whom m has not yet proposed if (w is free) assign m and w to be engaged else if (w prefers m to her fiancé m') assign m and w to be engaged, and m' to be free else w rejects m Initialize Mpref[][], inverse[][], stack, count[]; while (stack!= empty) { m = pop(stack); w = Mpref[m][++count[m]]; if (husband[w] == 0) { wife[m] = w; husband[w] = m; else if (inverse[w][m] < inverse[w][husband[w]]) { push(husband[w], stack); wife[husband[w]] = 0; wife[m] = w; husband[w] = m; else push(m, stack); 8

4 //0 Understanding the Solution Understanding the Solution Man Optimality Q. For a given problem instance, there may be several stable matchings. o all executions of Gale-Shapley yield the same stable matching? If so, which one? n instance with two stable matchings. -, -, -. -, -, -. avier ancey eus st nd rd my ertha lare st nd rd Q. For a given problem instance, there may be several stable matchings. o all executions of Gale-Shapley yield the same stable matching? If so, which one? ef. Man m is a valid partner of woman w if there exists some stable matching in which they are matched. Man-optimal assignment. ach man receives best valid partner. laim. ll executions of GS yield man-optimal assignment, which is a stable matching! No reason a priori to believe that man-optimal assignment is perfect, let alone stable. Simultaneously best for each and every man. laim. GS matching S* is man-optimal. Suppose some man is paired with someone other than best partner. Men propose in decreasing order of preference some man is rejected by valid partner. S Let be first such man, and let be first valid my-ancey woman that rejects him. Let S be a stable matching where and are matched. ertha-eus hen is rejected, forms (or reaffirms) engagement with a man, say, whom she prefers to. Let be 's partner in S. not rejected by any valid partner at the point when is rejected by. Thus, prefers to. since this is first rejection ut prefers to. by a valid partner Thus - is unstable in S. 9 0 Stable Matching Summary oman Pessimality xtensions: Matching Residents to Hospitals Stable matching problem. Given preference profiles of n men and n women, find a stable matching. no man and woman prefer to be with each other than assigned partner Gale-Shapley algorithm. Finds a stable matching in O(n ) time. Man-optimality. In the version of GS where men propose, each man receives best valid partner. w is a valid partner of m if there exist some stable matching where m and w are paired Q. oes man-optimality come at the expense of the women? oman-pessimal assignment. ach woman receives worst valid partner. laim. GS finds woman-pessimal stable matching S*. Pf. Suppose - matched in S*, but is not worst valid partner for. There exists stable matching S in which is paired with a man, say, whom she likes less than. Let be 's partner in S. S prefers to. man-optimality my-ancey Thus, - is an unstable in S. ertha-eus x: Men hospitals, omen med school residents. ariant. Some participants declare others as unacceptable. resident unwilling to ariant. Unequal number of men and women. work in leveland ariant. Limited polygamy. hospital wants to hire residents ef. Matching S unstable if there is a hospital h and resident r such that: h and r are acceptable to each other; and either r is unmatched, or r prefers h to her assigned hospital; and either h does not have all its places filled, or h prefers r to at least one of its assigned residents.

5 //0 xtension: Stable Roommate Problem Independent Set Q. o stable matchings always exist?. Not obvious a priori.. Five Representative Problems Input. Graph. Goal. Find maximum cardinality independent set. Stable roommate problem. n people; each person ranks others from to n-. ssign roommate pairs so that no unstable pairs. subset of nodes such that no two joined by an edge dam ob hris st nd rd -, - - unstable -, - - unstable -, - - unstable oofus Observation. Stable matchings do not always exist for stable roommate problem. One of NP-complete problems Independent Set xponential (ch. 8) Polynomial : O(n k ) Input. Graph. Goal. Find maximum cardinality independent set. subset of nodes such that no two joined by an edge Independent set. Given a graph, what is maximum size of an independent set? O(n n ) solution. numerate all subsets. Independent set of size k. Given a graph, are there k nodes such that no two are joined by an edge? k is a constant O(n k ) solution. numerate all subsets of k nodes. One of NP-complete problems xhaustive Search: G = (, ), n = for k = n downto lookforindependentset(g, k) lookforindependentset(g, k) for all subset S of, S = k, checkindepedent(g, S) omplexity of lookforindependentset: O((n, k)*k ), where (n, k) = n!/((n-k)!k!) = O(n k ) S* foreach subset S of nodes { check whether S in an independent set if (S is largest independent set seen so far) update S* S foreach subset S of k nodes { check whether S in an independent set if (S is an independent set) report S is an independent set heck whether S is an independent set = O(k ). Number of k element subsets = O(k n k / k!) = O(n k ). poly-time for k=, but not practical 8 9 0

6 //0 Interval Scheduling Interval Scheduling: Greedy lgorithm (ch..) Interval Scheduling: nalysis Input. Set of jobs with start times and finish times. Goal. Find maximum cardinality subset of mutually compatible jobs. b a c d e f jobs don't overlap Interval Scheduling can be reduced to Independent Set: reate G = (, ), where is the set of jobs and = { (j, j ) j and j overlap. Greedy algorithm. onsider jobs in increasing order of finish time. Take each job provided it's compatible with the ones already taken. Sort jobs by finish times so that f f... f n. set of jobs selected for j = to n { if (job j compatible with ) {j return Theorem. Greedy algorithm is optimal. ssume greedy is not optimal, and let's see what happens. Let i, i,... i k denote set of jobs selected by greedy. Let j, j,... j m denote set of jobs in the optimal solution with i = j, i = j,..., i r = j r for the largest possible value of r. Greedy: i i i r i r+ job i r+ finishes before j r+ g h Implementation. O(n log n). Remember job j* that was added last to. Job j is compatible with if s j f j*. OPT: j j j r j r+ why not replace job j r+ with job i r+? Interval Scheduling: nalysis eighted Interval Scheduling. eighted Interval Scheduling Theorem. Greedy algorithm is optimal. ssume greedy is not optimal, and let's see what happens. Let i, i,... i k denote set of jobs selected by greedy. Let j, j,... j m denote set of jobs in the optimal solution with i = j, i = j,..., i r = j r for the largest possible value of r. Greedy: OPT: i i i r i r+ j j j r job i r+ finishes before j r+ i r+ solution still feasible and optimal, but contradicts maximality of r. Input. Set of jobs with start times, finish times, and weights. Goal. Find maximum weight subset of mutually compatible jobs an be reduced to Independent Set of Maximum eight. 0 eighted interval scheduling problem. Job j starts at s j, finishes at f j, and has weight or value v j. Two jobs compatible if they don't overlap. Goal: find maximum weight subset of mutually compatible jobs. a b c d e f g h

7 //0 Unweighted Interval Scheduling Review eighted Interval Scheduling (ch.) ynamic Programming: inary hoice Recall. Greedy algorithm works if all weights are. onsider jobs in ascending order of finish time. dd job to subset if it is compatible with previously chosen jobs. Notation. Label jobs by finishing time: f f f n. ef. p(j) = largest index i < j such that job i is compatible with j. x: p(8) =, p() =, p() = 0. Notation. OPT(j) = value of optimal solution to the problem consisting of job requests,,..., j. ase : OPT selects job j. collect profit v j can't use incompatible jobs { p(j) +, p(j) +,..., j - Observation. Greedy algorithm can fail spectacularly if arbitrary weights are allowed. must include optimal solution to problem consisting of remaining compatible jobs,,..., p(j) optimal substructure ase : OPT does not select job j. must include optimal solution to problem consisting of remaining compatible jobs,,..., j- weight = 999 b weight = a eighted Interval Scheduling: rute Force rute force algorithm. Input: n, s,,s n, f,,f n, v,,v n Sort jobs by finish times so that f f... f n. ompute p(), p(),, p(n) ompute-opt(j) { if (j = 0) return 0 else return max(v j + ompute-opt(p(j)), ompute-opt(j-)) eighted Interval Scheduling: rute Force Observation. Recursive algorithm fails spectacularly because of redundant sub-problems exponential algorithms. x. Number of recursive calls for family of "layered" instances grows like Fibonacci sequence. p() = 0, p(j) = j eighted Interval Scheduling: Memoization Memoization. Store results of each sub-problem in a cache; lookup as needed. Input: n, s,,s n, f,,f n, v,,v n Sort jobs by finish times so that f f... f n. ompute p(), p(),, p(n) for j = to n M[j] = empty M[0] = 0 M-ompute-Opt(j) { if (M[j] is empty) M[j] = max(v j + M-ompute-Opt(p(j)), M-ompute-Opt(j-)) return M[j] 0

8 //0 eighted Interval Scheduling: Running eighted Interval Scheduling: Finding a Solution eighted Interval Scheduling: ottom-up laim. Memorized version of algorithm takes O(n log n) time. Sort by finish time: O(n log n). omputing p( ) : O(n log n) via sorting by start time. M-ompute-Opt(j): each invocation takes O() time and either (i) returns an existing value M[j] (ii) fills in one new entry M[j] and makes two recursive calls Progress measure = # nonempty entries of M[]. initially = 0, throughout n. (ii) increases by at most n recursive calls. Overall running time of M-ompute-Opt(n) is O(n). Remark. O(n) if jobs are pre-sorted by finish times. Q. ynamic programming algorithms computes optimal value. hat if we want the solution itself?. o some post-processing. Run M-ompute-Opt(n) Run Find-Solution(n) Find-Solution(j) { if (j = 0) output nothing else if (v j + M[p(j)] > M[j-]) print j Find-Solution(p(j)) else Find-Solution(j-) # of recursive calls n O(n). ottom-up dynamic programming. Unwind recursion. Input: n, s,,s n, f,,f n, v,,v n Sort jobs by finish times so that f f... f n. ompute p(), p(),, p(n) Iterative-ompute-Opt { M[0] = 0 for j = to n M[j] = max(v j + M[p(j)], M[j-]) ipartite Matching ipartite Matching. ompetitive Facility Location Input. ipartite graph. Goal. Find maximum cardinality matching. Input. ipartite graph. Goal. Find maximum cardinality matching. Input. Graph with weight on each each node. Game. Two competing players alternate in selecting nodes. Not allowed to select a node if any of its neighbors have been selected. Matching can be reduced to Independent Set: Given a graph G(, ), create another graph G (, ), where = { (e, e ) e and e share one endpoint in G, then M is maximum matching of G iff M is a maximum independent set of G. onventional Method: Use the Max-Flow lgorithm (ch..) O(mn) Research Problem: an we use the Stable Matching lgorithm? O(n ) Goal. Select a maximum weight subset of nodes. (ch. 9) 0 0 Second player can guarantee 0, but not. 8 8

9 //0 Five Representative Problems ariations on a theme: independent set. Interval scheduling: n log n greedy algorithm. eighted interval scheduling: n log n dynamic programming algorithm. ipartite matching: mn max-flow based algorithm. Independent set: NP-complete. ompetitive facility location: PSP-complete. 9 9

1. REPRESENTATIVE PROBLEMS

1. REPRESENTATIVE PROBLEMS 1. REPRESENTATIVE PROBLEMS stable matching five representative problems Lecture slides by Kevin Wayne Copyright 2005 Pearson-Addison Wesley Copyright 2013 Kevin Wayne http://www.cs.princeton.edu/~wayne/kleinberg-tardos

More information

1. REPRESENTATIVE PROBLEMS

1. REPRESENTATIVE PROBLEMS 1. REPRESENTATIVE PROBLEMS stable matching five representative problems Special thanks to Kevin Wayne for sharing the slides Copyright 2005 Pearson-Addison Wesley Last updated on 15/9/12 下午 10:33 1. REPRESENTATIVE

More information

Algorithm Design and Analysis

Algorithm Design and Analysis Algorithm Design and Analysis LECTURE 2 Analysis of Stable Matching Asymptotic Notation Adam Smith Stable Matching Problem Goal: Given n men and n women, find a "suitable" matching. Participants rate members

More information

Algorithms. [Knuth, TAOCP] An algorithm is a finite, definite, effective procedure, with some input and some output.

Algorithms. [Knuth, TAOCP] An algorithm is a finite, definite, effective procedure, with some input and some output. Algorithms Algorithm. [webster.com] A procedure for solving a mathematical problem (as of finding the greatest common divisor) in a finite number of steps that frequently involves repetition of an operation.

More information

Algorithm Design and Analysis

Algorithm Design and Analysis Algorithm Design and Analysis LECTURE 2 Analysis of Algorithms Stable matching problem Asymptotic growth Adam Smith Stable Matching Problem Unstable pair: man m and woman w are unstable if m prefers w

More information

Approximation and Randomized Algorithms (ARA) Lecture 1, September 3, 2012

Approximation and Randomized Algorithms (ARA) Lecture 1, September 3, 2012 Approximation and Randomized Algorithms (ARA) Lecture 1, September 3, 2012 Practicalities Code: 456314.0 intermediate and optional course Previous knowledge 456305.0 Datastrukturer II (Algoritmer) Period

More information

1. REPRESENTATIVE PROBLEMS

1. REPRESENTATIVE PROBLEMS 1. REPRESENTATIVE PROBLEMS stable matching five representative problems Lecture slides by Kevin Wayne Copyright 2005 Pearson-Addison Wesley http://www.cs.princeton.edu/~wayne/kleinberg-tardos Last updated

More information

Dynamic Programming: Interval Scheduling and Knapsack

Dynamic Programming: Interval Scheduling and Knapsack Dynamic Programming: Interval Scheduling and Knapsack . Weighted Interval Scheduling Weighted Interval Scheduling Weighted interval scheduling problem. Job j starts at s j, finishes at f j, and has weight

More information

CSE 417, Winter Introduc6on, Examples, and Analysis. Ben Birnbaum Widad Machmouchi

CSE 417, Winter Introduc6on, Examples, and Analysis. Ben Birnbaum Widad Machmouchi SE 417, Winter 2012 Introduc6on, Examples, and nalysis en irnbaum Widad Machmouchi Slides adapted from Larry Ruzzo, Steve Tanimoto, and Kevin Wayne 1 Instructors: SE 417: lgorithms and omputa6onal omplexity

More information

Dynamic Programming. Weighted Interval Scheduling. Algorithmic Paradigms. Dynamic Programming

Dynamic Programming. Weighted Interval Scheduling. Algorithmic Paradigms. Dynamic Programming lgorithmic Paradigms Dynamic Programming reed Build up a solution incrementally, myopically optimizing some local criterion Divide-and-conquer Break up a problem into two sub-problems, solve each sub-problem

More information

cs.washington.edu/417

cs.washington.edu/417 SE 417, Winter 2012 Introduc8on, Examples, and nalysis en irnbaum Widad Machmouchi SE 417: lgorithms and omputa8onal omplexity Instructors: en irnbaum (omputer Science Ph.D.) Widad Machmouchi (omputer

More information

CSE 202 Dynamic Programming II

CSE 202 Dynamic Programming II CSE 202 Dynamic Programming II Chapter 6 Dynamic Programming Slides by Kevin Wayne. Copyright 2005 Pearson-Addison Wesley. All rights reserved. 1 Algorithmic Paradigms Greed. Build up a solution incrementally,

More information

Analysis of Algorithms Fall Some Representative Problems Stable Matching

Analysis of Algorithms Fall Some Representative Problems Stable Matching Analysis of Algorithms Fall 2017 Some Representative Problems Stable Matching Mohammad Ashiqur Rahman Department of Computer Science College of Engineering Tennessee Tech University Matching Med-school

More information

Dynamic Programming. Cormen et. al. IV 15

Dynamic Programming. Cormen et. al. IV 15 Dynamic Programming Cormen et. al. IV 5 Dynamic Programming Applications Areas. Bioinformatics. Control theory. Operations research. Some famous dynamic programming algorithms. Unix diff for comparing

More information

Matching Residents to Hospitals

Matching Residents to Hospitals Midterm Review Matching Residents to Hospitals Goal. Given a set of preferences among hospitals and medical school students, design a self-reinforcing admissions process. Unstable pair: applicant x and

More information

6. DYNAMIC PROGRAMMING I

6. DYNAMIC PROGRAMMING I 6. DYNAMIC PROGRAMMING I weighted interval scheduling segmented least squares knapsack problem RNA secondary structure Lecture slides by Kevin Wayne Copyright 2005 Pearson-Addison Wesley Copyright 2013

More information

Chapter 6. Weighted Interval Scheduling. Dynamic Programming. Algorithmic Paradigms. Dynamic Programming Applications

Chapter 6. Weighted Interval Scheduling. Dynamic Programming. Algorithmic Paradigms. Dynamic Programming Applications lgorithmic Paradigms hapter Dynamic Programming reedy. Build up a solution incrementally, myopically optimizing some local criterion. Divide-and-conquer. Break up a problem into sub-problems, solve each

More information

Dynamic Programming 1

Dynamic Programming 1 Dynamic Programming 1 lgorithmic Paradigms Divide-and-conquer. Break up a problem into two sub-problems, solve each sub-problem independently, and combine solution to sub-problems to form solution to original

More information

Copyright 2000, Kevin Wayne 1

Copyright 2000, Kevin Wayne 1 /9/ lgorithmic Paradigms hapter Dynamic Programming reed. Build up a solution incrementally, myopically optimizing some local criterion. Divide-and-conquer. Break up a problem into two sub-problems, solve

More information

Copyright 2000, Kevin Wayne 1

Copyright 2000, Kevin Wayne 1 //8 Fast Integer Division Too (!) Schönhage Strassen algorithm CS 8: Algorithm Design and Analysis Integer division. Given two n-bit (or less) integers s and t, compute quotient q = s / t and remainder

More information

CS 580: Algorithm Design and Analysis

CS 580: Algorithm Design and Analysis CS 580: Algorithm Design and Analysis Jeremiah Blocki Purdue University Spring 208 Announcement: Homework 3 due February 5 th at :59PM Final Exam (Tentative): Thursday, May 3 @ 8AM (PHYS 203) Recap: Divide

More information

Areas. ! Bioinformatics. ! Control theory. ! Information theory. ! Operations research. ! Computer science: theory, graphics, AI, systems,.

Areas. ! Bioinformatics. ! Control theory. ! Information theory. ! Operations research. ! Computer science: theory, graphics, AI, systems,. lgorithmic Paradigms hapter Dynamic Programming reed Build up a solution incrementally, myopically optimizing some local criterion Divide-and-conquer Break up a problem into two sub-problems, solve each

More information

Dynamic Programming. Data Structures and Algorithms Andrei Bulatov

Dynamic Programming. Data Structures and Algorithms Andrei Bulatov Dynamic Programming Data Structures and Algorithms Andrei Bulatov Algorithms Dynamic Programming 18-2 Weighted Interval Scheduling Weighted interval scheduling problem. Instance A set of n jobs. Job j

More information

6. DYNAMIC PROGRAMMING I

6. DYNAMIC PROGRAMMING I lgorithmic paradigms 6. DYNMI PRORMMIN I weighted interval scheduling segmented least squares knapsack problem RN secondary structure reedy. Build up a solution incrementally, myopically optimizing some

More information

Chapter 6. Dynamic Programming. Slides by Kevin Wayne. Copyright 2005 Pearson-Addison Wesley. All rights reserved.

Chapter 6. Dynamic Programming. Slides by Kevin Wayne. Copyright 2005 Pearson-Addison Wesley. All rights reserved. Chapter 6 Dynamic Programming Slides by Kevin Wayne. Copyright 2005 Pearson-Addison Wesley. All rights reserved. 1 Algorithmic Paradigms Greed. Build up a solution incrementally, myopically optimizing

More information

CSE 421 Dynamic Programming

CSE 421 Dynamic Programming CSE Dynamic Programming Yin Tat Lee Weighted Interval Scheduling Interval Scheduling Job j starts at s(j) and finishes at f j and has weight w j Two jobs compatible if they don t overlap. Goal: find maximum

More information

CS320 Algorithms: Theory and Practice. Course Introduction

CS320 Algorithms: Theory and Practice. Course Introduction Course Objectives CS320 Algorithms: Theory and Practice Algorithms: Design strategies for algorithmic problem solving Course Introduction "For me, great algorithms are the poetry of computation. Just like

More information

1. STABLE MATCHING. stable matching problem Gale Shapley algorithm hospital optimality context

1. STABLE MATCHING. stable matching problem Gale Shapley algorithm hospital optimality context 1. STABLE MATCHING stable matching problem Gale Shapley algorithm hospital optimality context Lecture slides by Kevin Wayne Copyright 2005 Pearson-Addison Wesley http://www.cs.princeton.edu/~wayne/kleinberg-tardos

More information

COMP251: Bipartite graphs

COMP251: Bipartite graphs COMP251: Bipartite graphs Jérôme Waldispühl School of Computer Science McGill University Based on slides fom M. Langer (McGill) & P. Beame (UofW) Recap: Dijkstra s algorithm DIJKSTRA(V, E,w,s) INIT-SINGLE-SOURCE(V,s)

More information

Dynamic Programming( Weighted Interval Scheduling)

Dynamic Programming( Weighted Interval Scheduling) Dynamic Programming( Weighted Interval Scheduling) 17 November, 2016 Dynamic Programming 1 Dynamic programming algorithms are used for optimization (for example, finding the shortest path between two points,

More information

COMP251: Bipartite graphs

COMP251: Bipartite graphs COMP251: Bipartite graphs Jérôme Waldispühl School of Computer Science McGill University Based on slides fom M. Langer (McGill) & P. Beame (UofW) Recap: Dijkstra s algorithm DIJKSTRA(V, E,w,s) INIT-SINGLE-SOURCE(V,s)

More information

Consider a complete bipartite graph with sets A and B, each with n vertices.

Consider a complete bipartite graph with sets A and B, each with n vertices. When DFS discovers a non-tree edge, check if its two vertices have the same color (red or black). If all non-tree edges join vertices of different color then the graph is bipartite. (Note that all tree

More information

CSE 421 Weighted Interval Scheduling, Knapsack, RNA Secondary Structure

CSE 421 Weighted Interval Scheduling, Knapsack, RNA Secondary Structure CSE Weighted Interval Scheduling, Knapsack, RNA Secondary Structure Shayan Oveis haran Weighted Interval Scheduling Interval Scheduling Job j starts at s(j) and finishes at f j and has weight w j Two jobs

More information

Chapter 6. Dynamic Programming. CS 350: Winter 2018

Chapter 6. Dynamic Programming. CS 350: Winter 2018 Chapter 6 Dynamic Programming CS 350: Winter 2018 1 Algorithmic Paradigms Greedy. Build up a solution incrementally, myopically optimizing some local criterion. Divide-and-conquer. Break up a problem into

More information

CSC2556. Lecture 5. Matching - Stable Matching - Kidney Exchange [Slides : Ariel D. Procaccia]

CSC2556. Lecture 5. Matching - Stable Matching - Kidney Exchange [Slides : Ariel D. Procaccia] CSC2556 Lecture 5 Matching - Stable Matching - Kidney Exchange [Slides : Ariel D. Procaccia] CSC2556 - Nisarg Shah 1 Announcements The assignment is up! It is complete, and no more questions will be added.

More information

Lecture 2: Divide and conquer and Dynamic programming

Lecture 2: Divide and conquer and Dynamic programming Chapter 2 Lecture 2: Divide and conquer and Dynamic programming 2.1 Divide and Conquer Idea: - divide the problem into subproblems in linear time - solve subproblems recursively - combine the results in

More information

Ma/CS 6b Class 3: Stable Matchings

Ma/CS 6b Class 3: Stable Matchings Ma/CS 6b Class 3: Stable Matchings α p 5 p 12 p 15 q 1 q 7 q 12 By Adam Sheffer Reminder: Alternating Paths Let G = V 1 V 2, E be a bipartite graph, and let M be a matching of G. A path is alternating

More information

6. DYNAMIC PROGRAMMING I

6. DYNAMIC PROGRAMMING I 6. DYNAMIC PRORAMMIN I weighted interval scheduling segmented least squares knapsack problem RNA secondary structure Lecture slides by Kevin Wayne Copyright 2005 Pearson-Addison Wesley http://www.cs.princeton.edu/~wayne/kleinberg-tardos

More information

Ma/CS 6b Class 3: Stable Matchings

Ma/CS 6b Class 3: Stable Matchings Ma/CS 6b Class 3: Stable Matchings α p 5 p 12 p 15 q 1 q 7 q 12 β By Adam Sheffer Neighbor Sets Let G = V 1 V 2, E be a bipartite graph. For any vertex a V 1, we define the neighbor set of a as N a = u

More information

Bipartite Matchings and Stable Marriage

Bipartite Matchings and Stable Marriage Bipartite Matchings and Stable Marriage Meghana Nasre Department of Computer Science and Engineering Indian Institute of Technology, Madras Faculty Development Program SSN College of Engineering, Chennai

More information

CS 6901 (Applied Algorithms) Lecture 2

CS 6901 (Applied Algorithms) Lecture 2 CS 6901 (Applied Algorithms) Lecture 2 Antonina Kolokolova September 15, 2016 1 Stable Matching Recall the Stable Matching problem from the last class: there are two groups of equal size (e.g. men and

More information

CS Lunch. Dynamic Programming Recipe. 2 Midterm 2! Slides17 - Segmented Least Squares.key - November 16, 2016

CS Lunch. Dynamic Programming Recipe. 2 Midterm 2! Slides17 - Segmented Least Squares.key - November 16, 2016 CS Lunch 1 Michelle Oraa Ali Tien Dao Vladislava Paskova Nan Zhuang Surabhi Sharma Wednesday, 12:15 PM Kendade 307 2 Midterm 2! Monday, November 21 In class Covers Greedy Algorithms Closed book Dynamic

More information

Matching Theory and the Allocation of Kidney Transplantations

Matching Theory and the Allocation of Kidney Transplantations University of Utrecht Bachelor Thesis Matching Theory and the Allocation of Kidney Transplantations Kim de Bakker Supervised by Dr. M. Ruijgrok 14 June 2016 Introduction Matching Theory has been around

More information

Algorithm Design and Analysis

Algorithm Design and Analysis Algorithm Design and Analysis LECTURE 5 Greedy Algorithms Interval Scheduling Interval Partitioning Guest lecturer: Martin Furer Review In a DFS tree of an undirected graph, can there be an edge (u,v)

More information

Chapter 4. Greedy Algorithms. Slides by Kevin Wayne. Copyright 2005 Pearson-Addison Wesley. All rights reserved.

Chapter 4. Greedy Algorithms. Slides by Kevin Wayne. Copyright 2005 Pearson-Addison Wesley. All rights reserved. Chapter 4 Greedy Algorithms Slides by Kevin Wayne. Copyright 2005 Pearson-Addison Wesley. All rights reserved. 1 4.1 Interval Scheduling Interval Scheduling Interval scheduling. Job j starts at s j and

More information

CS 598RM: Algorithmic Game Theory, Spring Practice Exam Solutions

CS 598RM: Algorithmic Game Theory, Spring Practice Exam Solutions CS 598RM: Algorithmic Game Theory, Spring 2017 1. Answer the following. Practice Exam Solutions Agents 1 and 2 are bargaining over how to split a dollar. Each agent simultaneously demands share he would

More information

Matchings in Graphs. Definition 3 A matching N in G is said to be stable if it does not contain a blocking pair.

Matchings in Graphs. Definition 3 A matching N in G is said to be stable if it does not contain a blocking pair. Matchings in Graphs Lecturer: Scribe: Prajakta Jose Mathew Meeting: 6 11th February 2010 We will be considering finite bipartite graphs. Think of one part of the vertex partition as representing men M,

More information

What do you do when you can t use money to solve your problems?

What do you do when you can t use money to solve your problems? Markets without money What do you do when you can t use money to solve your problems? Matching: heterosexual men and women marrying in a small town, students matching to universities, workers to jobs where

More information

Stable Matching Existence, Computation, Convergence Correlated Preferences. Stable Matching. Algorithmic Game Theory.

Stable Matching Existence, Computation, Convergence Correlated Preferences. Stable Matching. Algorithmic Game Theory. Existence, Computation, Convergence Correlated Preferences Existence, Computation, Convergence Correlated Preferences Stable Marriage Set of Women Y Set of Men X Existence, Computation, Convergence Correlated

More information

Game Theory: Lecture #5

Game Theory: Lecture #5 Game Theory: Lecture #5 Outline: Stable Matchings The Gale-Shapley Algorithm Optimality Uniqueness Stable Matchings Example: The Roommate Problem Potential Roommates: {A, B, C, D} Goal: Divide into two

More information

Matching Problems. Roberto Lucchetti. Politecnico di Milano

Matching Problems. Roberto Lucchetti. Politecnico di Milano Politecnico di Milano Background setting Problems introduced in 1962 by Gale and Shapley for the study of two sided markets: 1) workers & employers; 2) interns & hospitals; 3) students & universities;

More information

Math 301: Matchings in Graphs

Math 301: Matchings in Graphs Math 301: Matchings in Graphs Mary Radcliffe 1 Definitions and Basics We begin by first recalling some basic definitions about matchings. A matching in a graph G is a set M = {e 1, e 2,..., e k } of edges

More information

Omega notation. Transitivity etc.

Omega notation. Transitivity etc. Omega notation Big-Omega: Lecture 2, Sept. 25, 2014 f () n (()) g n const cn, s.t. n n : cg() n f () n Small-omega: 0 0 0 f () n (()) g n const c, n s.t. n n : cg() n f () n 0 0 0 Intuition (works most

More information

Creating new worlds inside the computer. COS 116: 2/10/2011 Sanjeev Arora

Creating new worlds inside the computer. COS 116: 2/10/2011 Sanjeev Arora Creating new worlds inside the computer COS 116: 2/10/2011 Sanjeev Arora Pseudocode Simple instructions: involve +, -,, Compound instructions Conditionals Loops No need to sweat over exact wording during

More information

Two-Sided Matching. Terence Johnson. December 1, University of Notre Dame. Terence Johnson (ND) Two-Sided Matching December 1, / 47

Two-Sided Matching. Terence Johnson. December 1, University of Notre Dame. Terence Johnson (ND) Two-Sided Matching December 1, / 47 Two-Sided Matching Terence Johnson University of Notre Dame December 1, 2017 Terence Johnson (ND) Two-Sided Matching December 1, 2017 1 / 47 Markets without money What do you do when you can t use money

More information

Matching. Terence Johnson. April 17, University of Notre Dame. Terence Johnson (ND) Matching April 17, / 41

Matching. Terence Johnson. April 17, University of Notre Dame. Terence Johnson (ND) Matching April 17, / 41 Matching Terence Johnson University of Notre Dame April 17, 2018 Terence Johnson (ND) Matching April 17, 2018 1 / 41 Markets without money What do you do when you can t use money to solve your problems?

More information

Chapter 4. Greedy Algorithms. Slides by Kevin Wayne. Copyright 2005 Pearson-Addison Wesley. All rights reserved.

Chapter 4. Greedy Algorithms. Slides by Kevin Wayne. Copyright 2005 Pearson-Addison Wesley. All rights reserved. Chapter 4 Greedy Algorithms Slides by Kevin Wayne. Copyright Pearson-Addison Wesley. All rights reserved. 4 4.1 Interval Scheduling Interval Scheduling Interval scheduling. Job j starts at s j and finishes

More information

1 Definitions and Things You Know

1 Definitions and Things You Know We will discuss an algorithm for finding stable matchings (not the one you re probably familiar with). The Instability Chaining Algorithm is the most similar algorithm in the literature to the one actually

More information

PROBLEMS OF MARRIAGE Eugene Mukhin

PROBLEMS OF MARRIAGE Eugene Mukhin PROBLEMS OF MARRIAGE Eugene Mukhin 1. The best strategy to find the best spouse. A person A is looking for a spouse, so A starts dating. After A dates the person B, A decides whether s/he wants to marry

More information

The key is that there are two disjoint populations, and everyone in the market is on either one side or the other

The key is that there are two disjoint populations, and everyone in the market is on either one side or the other Econ 805 Advanced Micro Theory I Dan Quint Fall 2009 Lecture 17 So... two-sided matching markets. First off, sources. I ve updated the syllabus for the next few lectures. As always, most of the papers

More information

Lecture 2: Just married

Lecture 2: Just married COMP36111: Advanced Algorithms I Lecture 2: Just married Ian Pratt-Hartmann Room KB2.38: email: ipratt@cs.man.ac.uk 2017 18 Outline Matching Flow networks Third-year projects The stable marriage problem

More information

Chapter 6. Dynamic Programming. Slides by Kevin Wayne. Copyright 2005 Pearson-Addison Wesley. All rights reserved.

Chapter 6. Dynamic Programming. Slides by Kevin Wayne. Copyright 2005 Pearson-Addison Wesley. All rights reserved. Chapter 6 Dynamic Programming Slides by Kevin Wayne. Copyright 2005 Pearson-Addison Wesley. All rights reserved. Algorithmic Paradigms Greed. Build up a solution incrementally, myopically optimizing some

More information

Matching Problems. Roberto Lucchetti. Politecnico di Milano

Matching Problems. Roberto Lucchetti. Politecnico di Milano Politecnico di Milano Background setting Problems introduced in 1962 by Gale and Shapley for the study of two sided markets: 1) workers & employers 2) interns & hospitals 3) students & universities 4)

More information

Algoritmiek, bijeenkomst 3

Algoritmiek, bijeenkomst 3 Algoritmiek, bijeenkomst 3 Mathijs de Weerdt Today Introduction Greedy Divide and Conquer (very briefly) Dynamic programming Slides with thanks to Kevin Wayne and Pearson Education (made available together

More information

Dynamic Matching under Preferences

Dynamic Matching under Preferences Dynamic Matching under Preferences Martin Hoefer Max-Planck-Institut für Informatik mhoefer@mpi-inf.mpg.de Kolkata, 11 March 2015 How to find a stable relationship? Stable Marriage Set of Women Set of

More information

Chapter 4. Greedy Algorithms. Slides by Kevin Wayne. Copyright 2005 Pearson-Addison Wesley. All rights reserved.

Chapter 4. Greedy Algorithms. Slides by Kevin Wayne. Copyright 2005 Pearson-Addison Wesley. All rights reserved. Chapter 4 Greedy Algorithms Slides by Kevin Wayne. Copyright 2005 Pearson-Addison Wesley. All rights reserved. 1 4.1 Interval Scheduling Interval Scheduling Interval scheduling. Job j starts at s j and

More information

We set up the basic model of two-sided, one-to-one matching

We set up the basic model of two-sided, one-to-one matching Econ 805 Advanced Micro Theory I Dan Quint Fall 2009 Lecture 18 To recap Tuesday: We set up the basic model of two-sided, one-to-one matching Two finite populations, call them Men and Women, who want to

More information

Matching Theory. Mihai Manea. Based on slides by Fuhito Kojima. MIT

Matching Theory. Mihai Manea. Based on slides by Fuhito Kojima. MIT Matching Theory Mihai Manea MIT Based on slides by Fuhito Kojima. Market Design Traditional economics focuses mostly on decentralized markets. Recently, economists are helping to design economic institutions

More information

CS 580: Algorithm Design and Analysis. Jeremiah Blocki Purdue University Spring 2018

CS 580: Algorithm Design and Analysis. Jeremiah Blocki Purdue University Spring 2018 CS 580: Algorithm Design and Analysis Jeremiah Blocki Purdue University Spring 2018 Chapter 9 PSPACE: A Class of Problems Beyond NP Slides by Kevin Wayne. Copyright @ 2005 Pearson-Addison Wesley. All rights

More information

An Efficient Algorithm for Batch Stability Testing

An Efficient Algorithm for Batch Stability Testing n fficient lgorithm for atch Stability Testing John abney School of omputing lemson University jdabney@cs.clemson.edu rian. ean School of omputing lemson University bcdean@cs.clemson.edu pril 25, 2009

More information

Stable Marriage with Ties and Bounded Length Preference Lists

Stable Marriage with Ties and Bounded Length Preference Lists Stable Marriage with Ties and Bounded Length Preference Lists Robert W. Irving, David F. Manlove, and Gregg O Malley Department of Computing Science, University of Glasgow, Glasgow G12 8QQ, UK. Email:

More information

12. LOCAL SEARCH. gradient descent Metropolis algorithm Hopfield neural networks maximum cut Nash equilibria

12. LOCAL SEARCH. gradient descent Metropolis algorithm Hopfield neural networks maximum cut Nash equilibria 12. LOCAL SEARCH gradient descent Metropolis algorithm Hopfield neural networks maximum cut Nash equilibria Lecture slides by Kevin Wayne Copyright 2005 Pearson-Addison Wesley h ttp://www.cs.princeton.edu/~wayne/kleinberg-tardos

More information

Subramanian s stable matching algorithm

Subramanian s stable matching algorithm Subramanian s stable matching algorithm Yuval Filmus November 2011 Abstract Gale and Shapley introduced the well-known stable matching problem in 1962, giving an algorithm for the problem. Subramanian

More information

Lecture 5: The Principle of Deferred Decisions. Chernoff Bounds

Lecture 5: The Principle of Deferred Decisions. Chernoff Bounds Randomized Algorithms Lecture 5: The Principle of Deferred Decisions. Chernoff Bounds Sotiris Nikoletseas Associate Professor CEID - ETY Course 2013-2014 Sotiris Nikoletseas, Associate Professor Randomized

More information

Greedy Homework Problems

Greedy Homework Problems CS 1510 Greedy Homework Problems 1. Consider the following problem: INPUT: A set S = {(x i, y i ) 1 i n} of intervals over the real line. OUTPUT: A maximum cardinality subset S of S such that no pair of

More information

Algorithm Design and Analysis

Algorithm Design and Analysis Algorithm Design and Analysis LECTURE 6 Greedy Algorithms Interval Scheduling Interval Partitioning Scheduling to Minimize Lateness Sofya Raskhodnikova S. Raskhodnikova; based on slides by E. Demaine,

More information

Design and Analysis of Algorithms

Design and Analysis of Algorithms CSE 0, Winter 08 Design and Analysis of Algorithms Lecture 8: Consolidation # (DP, Greed, NP-C, Flow) Class URL: http://vlsicad.ucsd.edu/courses/cse0-w8/ Followup on IGO, Annealing Iterative Global Optimization

More information

STABLE MARRIAGE PROBLEM WITH TIES AND INCOMPLETE BOUNDED LENGTH PREFERENCE LIST UNDER SOCIAL STABILITY

STABLE MARRIAGE PROBLEM WITH TIES AND INCOMPLETE BOUNDED LENGTH PREFERENCE LIST UNDER SOCIAL STABILITY STABLE MARRIAGE PROBLEM WITH TIES AND INCOMPLETE BOUNDED LENGTH PREFERENCE LIST UNDER SOCIAL STABILITY Ashish Shrivastava and C. Pandu Rangan Department of Computer Science and Engineering, Indian Institute

More information

Chapter 11. Approximation Algorithms. Slides by Kevin Wayne Pearson-Addison Wesley. All rights reserved.

Chapter 11. Approximation Algorithms. Slides by Kevin Wayne Pearson-Addison Wesley. All rights reserved. Chapter 11 Approximation Algorithms Slides by Kevin Wayne. Copyright @ 2005 Pearson-Addison Wesley. All rights reserved. 1 Approximation Algorithms Q. Suppose I need to solve an NP-hard problem. What should

More information

CSEP 521 Applied Algorithms. Richard Anderson Winter 2013 Lecture 1

CSEP 521 Applied Algorithms. Richard Anderson Winter 2013 Lecture 1 CSEP 521 Applied Algorithms Richard Anderson Winter 2013 Lecture 1 CSEP 521 Course Introduction CSEP 521, Applied Algorithms Monday s, 6:30-9:20 pm CSE 305 and Microsoft Building 99 Instructor Richard

More information

An improved approximation algorithm for the stable marriage problem with one-sided ties

An improved approximation algorithm for the stable marriage problem with one-sided ties Noname manuscript No. (will be inserted by the editor) An improved approximation algorithm for the stable marriage problem with one-sided ties Chien-Chung Huang Telikepalli Kavitha Received: date / Accepted:

More information

CS711008Z Algorithm Design and Analysis

CS711008Z Algorithm Design and Analysis CS711008Z Algorithm Design and Analysis Lecture 1 Introduction and some representative problems 1 Dongbo Bu Institute of Computing Technology Chinese Academy of Sciences, Beijing, China 1 The slides are

More information

Advanced Algorithms. Lecture Notes for April 5, 2016 Dynamic programming, continued (HMMs); Iterative improvement Bernard Moret

Advanced Algorithms. Lecture Notes for April 5, 2016 Dynamic programming, continued (HMMs); Iterative improvement Bernard Moret Advanced Algorithms Lecture Notes for April 5, 2016 Dynamic programming, continued (HMMs); Iterative improvement Bernard Moret Dynamic Programming (continued) Finite Markov models A finite Markov model

More information

Cheating to Get Better Roommates in a Random Stable Matching

Cheating to Get Better Roommates in a Random Stable Matching Cheating to Get Better Roommates in a Random Stable Matching Chien-Chung Huang Technical Report 2006-582 Dartmouth College Sudikoff Lab 6211 for Computer Science Hanover, NH 03755, USA villars@cs.dartmouth.edu

More information

Faster Algorithms For Stable Allocation Problems

Faster Algorithms For Stable Allocation Problems Faster lgorithms For Stable llocation Problems rian. ean School of omputing lemson University bcdean@cs.clemson.edu Siddharth Munshi School of omputing lemson University smunshi@cs.clemson.edu May 17,

More information

Data Structures and Algorithms CMPSC 465

Data Structures and Algorithms CMPSC 465 ata Structures and Algorithms MPS LTUR ellman-ford Shortest Paths Algorithm etecting Negative ost ycles Adam Smith // A. Smith; based on slides by K. Wayne,. Leiserson,. emaine L. Negative Weight dges

More information

Two-Sided Matching. Terence Johnson. September 1, University of Notre Dame. Terence Johnson (ND) Two-Sided Matching September 1, / 37

Two-Sided Matching. Terence Johnson. September 1, University of Notre Dame. Terence Johnson (ND) Two-Sided Matching September 1, / 37 Two-Sided Matching Terence Johnson University of Notre Dame September 1, 2011 Terence Johnson (ND) Two-Sided Matching September 1, 2011 1 / 37 One-to-One Matching: Gale-Shapley (1962) There are two finite

More information

CPSC 320 Sample Final Examination December 2013

CPSC 320 Sample Final Examination December 2013 CPSC 320 Sample Final Examination December 2013 [10] 1. Answer each of the following questions with true or false. Give a short justification for each of your answers. [5] a. 6 n O(5 n ) lim n + This is

More information

Stable Matching Problems with Exchange Restrictions

Stable Matching Problems with Exchange Restrictions Stable Matching Problems with Exchange Restrictions Robert W. Irving Department of Computing Science, University of Glasgow, Glasgow G12 8QQ, UK. email: rwi@dcs.gla.ac.uk telephone: 44-141-330-4478 fax:

More information

CS 580: Algorithm Design and Analysis

CS 580: Algorithm Design and Analysis CS 58: Algorithm Design and Analysis Jeremiah Blocki Purdue University Spring 28 Announcement: Homework 3 due February 5 th at :59PM Midterm Exam: Wed, Feb 2 (8PM-PM) @ MTHW 2 Recap: Dynamic Programming

More information

Glasgow eprints Service

Glasgow eprints Service Gent, I. P. and Irving, R. W. and Manlove, D. F. and Prosser, P. and Smith, B. M. (2001) A constraint programming approach to the stable marriage problem. In, Walsh, T., Eds. Proceedings of CP '01: the

More information

CS 580: Algorithm Design and Analysis

CS 580: Algorithm Design and Analysis CS 580: Algorithm Design and Analysis Jeremiah Blocki Purdue University Spring 2018 Announcement: Homework 1 due soon! Due: January 25 th at midnight (Blackboard) Recap: Graphs Bipartite Graphs Definition

More information

Two Algorithms for the Student-Project Allocation Problem

Two Algorithms for the Student-Project Allocation Problem Two Algorithms for the Student-Project Allocation Problem David J. Abraham 1, Robert W. Irving 2, and David F. Manlove 2 1 Computer Science Department, Carnegie-Mellon University, 5000 Forbes Ave, Pittsburgh

More information

Undirected Graphs. V = { 1, 2, 3, 4, 5, 6, 7, 8 } E = { 1-2, 1-3, 2-3, 2-4, 2-5, 3-5, 3-7, 3-8, 4-5, 5-6 } n = 8 m = 11

Undirected Graphs. V = { 1, 2, 3, 4, 5, 6, 7, 8 } E = { 1-2, 1-3, 2-3, 2-4, 2-5, 3-5, 3-7, 3-8, 4-5, 5-6 } n = 8 m = 11 Undirected Graphs Undirected graph. G = (V, E) V = nodes. E = edges between pairs of nodes. Captures pairwise relationship between objects. Graph size parameters: n = V, m = E. V = {, 2, 3,,,, 7, 8 } E

More information

Algorithmics of Two-Sided Matching Problems

Algorithmics of Two-Sided Matching Problems Algorithmics of Two-Sided Matching Problems David J. Abraham Submitted for the degree of Master of Science, Department of Computing Science, University of Glasgow, October, 2003 c 2003 David J. Abraham

More information

Problem Set 6 Solutions

Problem Set 6 Solutions Problem Set 6 Solutions Exercise. Prom Example : (Alex Alice, Bob Betty), College Admission Example: (A (β,γ), B α); (A (α,β), B γ), Prom Example 2: (Alex Alice, Bob Betty); (Alex Betty, Bob Alice). Exercise

More information

Activity selection. Goal: Select the largest possible set of nonoverlapping (mutually compatible) activities.

Activity selection. Goal: Select the largest possible set of nonoverlapping (mutually compatible) activities. Greedy Algorithm 1 Introduction Similar to dynamic programming. Used for optimization problems. Not always yield an optimal solution. Make choice for the one looks best right now. Make a locally optimal

More information

The Man-Exchange Stable Marriage Problem

The Man-Exchange Stable Marriage Problem The Man-Exchange Stable Marriage Problem Robert W. Irving Department of Computing Science, University of Glasgow, Glasgow G12 8QQ, UK. Email: {rwi}@dcs.gla.ac.uk. Abstract. We study a variant of the classical

More information

Chapter 9. PSPACE: A Class of Problems Beyond NP. Slides by Kevin Wayne Pearson-Addison Wesley. All rights reserved.

Chapter 9. PSPACE: A Class of Problems Beyond NP. Slides by Kevin Wayne Pearson-Addison Wesley. All rights reserved. Chapter 9 PSPACE: A Class of Problems Beyond NP Slides by Kevin Wayne. Copyright @ 2005 Pearson-Addison Wesley. All rights reserved. 1 Geography Game Geography. Alice names capital city c of country she

More information

Stable matching. Carlos Hurtado. July 5th, Department of Economics University of Illinois at Urbana-Champaign

Stable matching. Carlos Hurtado. July 5th, Department of Economics University of Illinois at Urbana-Champaign Stable matching Carlos Hurtado Department of Economics University of Illinois at Urbana-Champaign hrtdmrt2@illinois.edu July 5th, 2017 C. Hurtado (UIUC - Economics) Game Theory On the Agenda 1 Introduction

More information