SlideShare a Scribd company logo
© 2014 IBM Corporation
Bipartite Matching and Optical
Clouds - what?
Kostas Katrinis
Guest Lecture – CS2012 Programming Techniques
Trinity College Dublin
April 14, 2014
© 2014 IBM Corporation2
Outline
• Scope & Background
• Motivation & Challenges
• Hybrid Network Architecture
• MEMS Optical Switch Operation Brief
• Bipartite Graphs
• Matchings
• Make the connection!
• Hungarian Algorithm
Part I - Introduction
Part II – Modeling
Part III – Theory &
Algorithm
© 2014 IBM Corporation3
Scope Part I - Background
• Target Markets
– (Cloud) Datacenters - Θ(10K) Servers
– HPC Clusters (82% in Nov'12 Top-500)
• Target Systems:
– Data Network Fabric
© 2014 IBM Corporation4
DC Traffic Trends
• 76% of the traffic is
intra-datacenter *
• Total DC traffic CAGR
33% to 2015 *
• Traffic percentage exiting the rack
is high (up to 90%) **
– ...and we expect it to increase (scale-out workloads)
* Cisco Global Cloud Index: Forecast and Methodology, 2011–2016
** Benson et al., “Network Traffic Characteristics of Data Centers in the Wild”, IMC'10
Part I - Background
© 2014 IBM Corporation5
Design Trade-offs (Performance)
Performance
Cost
Highly
oversubcr.
High
Bisection
Trade-off
• We need high-capacity between any two points in the DC
• and at various scales (incremental deployment)
• ... we need $$$
Part I - Background
© 2014 IBM Corporation6
Motivating Example
Item Item List Price (USD)** Qty Total List Price (USD)
BNT G8264 (64-port switch) 30,000 5,120 153,600,000
BNT SFP+ SR Transceiver 665 262,164 174,325,760
MM Fiber Cable 28 131,072 3,670,016
Estimated List Prices
**Source: ibm.com
Fabric Price
331M USD
≈ Compute Price
(@5K/server)
• Full-bisection fat-tree @ 65k servers
• Building block: 64-port Ethernet switches (ala VL2*)
• Denser switches will not help you (e.g. 288-port Mellanox
Vantage)
Greenberg et al., “VL2: A Scalable and Flexible Data Center Network”, SIGCOMM 2009
Part I - Background
© 2014 IBM Corporation7
Motivating Example (cont.)
Total Price
331m USD
AND.....
#Cables to route
131,000
Can you count the birds in this nest?
Part I - Background
© 2014 IBM Corporation8
Paradigm Shift - Switch Light
Tiltable Mirrors implemented via MEMS (Micro-Electrical Mechanical Systems)
+ High-radix (320 ports you can buy, 1024 feasible)
+ No transceivers
+ Decreasing $/port
+ 50x less Watts/port vs. electronics
+ Can switch up to ~1Tbps
+ Protocol Agnostic
Electronic Switch (Ethernet) Optical MEMS switch
Price/Port (USD) 1100 (includes TxRx cost) 350
Bandwidth/Port 10Gbps “Rate-free”
Power/Port (W) 10 0.2
Requires TxRxs Yes No
x3
x∞
x50
Part I - Background
© 2014 IBM Corporation9
Hybrid Fabric Architecture Part I - Architecture
© 2014 IBM Corporation10
Dublin Prototype - Photos
Single-mode fiber
links, 25m length,
10GBASE-LR
96x96-Port 3D-MEMS Switch
Shamrock
Server Rack,
Chelsio T4 NIC
cards
G8264 TOR Switch
Redirect traffic from over-subscribed electrical
network to optical circuits.
 Packet forwarding removes bandwidth limitation of
over-subscribed electrical network.
Max.
Latency <13
ns
Part I - Architecture
© 2014 IBM Corporation11
High-level Functionality
• Bijective TE:
– Mice are routed via the 1G electronic fabric
– Elephants are routed via the 10G optical fabric
Optical Fabric is reconfigurable
– Centralized control optimizes topology against traffic pattern and
demand volume
Part I - Architecture
© 2014 IBM Corporation12
Optical MEMS Switch Part II – MEMS Switch
• Focus on the “Optical MEMS Switch”
• NxN ports (N inputs to connect to N outputs)
• Each input port is dynamically “crossconnected” to at most one output port
based on the rack pair we need to connect (decide every X seconds)
• E.g. Crossconnect port-13 to port-45 to connect rack-2 with rack-5 above
© 2014 IBM Corporation13
Bipartite Graphs
Definition (Bipartite Graphs)
G=(V,E) is bipartite if we can partition its vertex set V to two disjoing sets X
and Y, s.t. there are no edges between X and Y. We say that (X,Y) is a
bipartion of G.
Note: During this lecture, we will constrain our focus for the sake of
understanding to undirected graphs. Applying the concepts to directed graphs
as food for thought.
Part II – Bipartite
© 2014 IBM Corporation14
Matchings
Definition (Matching)
A matching M of a graph G=(V,E) is a set of edges of G such that no two
edges in M share a common vertex.
• If a vertex u is matched by M, then we say that u is saturated by M.
Otherwise, a vertex u is unsaturated by M
Example: In M1, v2 is saturated, whereas v1 is unsaturated
Part II – Matchings
© 2014 IBM Corporation15
Maximum Matchings
• Greediness strikes back: we want a matching to have as many edges as
possible
Definition (Maximum Matching)
A matching M of a graph G=(V,E) is a maximum matching if no matching in G
has more edges.
Example: M2 is a maximum matching (|G|=8 and |M2|=4). Since |M1|=3, M1 is
not maximum.
Part II – Matchings
© 2014 IBM Corporation16
Technology ↔ Theory: Connection Part II – Model
© 2014 IBM Corporation17
Maximum Matching – Optical Switch
• Remember that our Greediness keeps striking back, can't get rid of it!
• If we find a maximum matching (maximum number of edges), then we
have maximized the number of crossconnections in our optical switch
• .... thus we have maximized throughput (aggregate bandwidth that
crosses the optical switch)
Part II – Model
© 2014 IBM Corporation18
Maximum Matching in Bipartite Graphs
• So this is what we need (see title above) to maximize utilization of our
optical switch. We need an algorithm to find a maximum matching on a
bipartite graph. But how? Some theory first (and more definitions)
Definition (Alternating and Augmenting Paths)
Let G=(V,E) have a matching M. An alternating path P with respect to M is
any path whose edges are alternately in M and not in M (E-M). If the start and
end vertices of P are not saturated by M, then P is an augmenting path.
Example: P= (v1,v2,v3,v4,v5) is an alternating path
P'= (v1,v2,v3,v4,v5,v6) is an augmenting path
Part III – T&A
© 2014 IBM Corporation19
Matching expansion
Definition (Symmetric Difference)
Let E and E' be two edge sets. Then we define as the symmetric difference
M=E ◘ E' of the two sets the operation M = (E-E') U (E'-E) = (E U E') – (E ∩ E')
• Let G and M a matching (see below). P = (v1,v2,v3,v4,v5,v6) is an
augmentic path. E(P) are the edges of P.
• |M|=3
• Define M' = M ◘ E(P)
• Observe: |M'|=4 … wow! We obtained a larger matching M' starting from a
non-maximum one (M)
Part III – T&A
© 2014 IBM Corporation20
Expansion Lemma
Lemma –1 (Matching Expansion)
Let G have a matching M and let P be an augmenting path with respect to M.
Then M' = M ◘ E(P) is a matching with one more edge than M – or equivalently
– |M'|=|M|+1.
Proof
M' contains all the edges of M, plus all the edges in E(P) that are not in M.
Thus M' is per construction a matching of G.
Let u and v be the start and end vertices of P. Then u and v are unsaturated in
M, because P is an augmenting path. Because of the symmetric difference
operator, u and v are now saturated in M'. The rest of the edges of M that were
not in E(P) are still in M'. Thus, |M'|=|M|+1
Part III – T&A
© 2014 IBM Corporation21
Berge's Theorem
Theorem-1 (Berge's Theorem)
A matching M in G is maximum if and only if G has no augmenting path with
respect to M.
Proof
Left as an exercise (aka we don't have the time budget in class :-)). Reference
Textbook has a rigorous, easy-to-follow proof
• Theorems and lemmas are tools to an end. Let's use them!
• Back to our goal: We need an algorithm to find a maximum matching on
a bipartite graph
• Strategy:
1) Start with an arbitrary (even empty) matching M. If M is not maximum, there
will be an unsaturated vertex u.
2) Follow alternating paths from u until we identify another unsaturated vertex
v. Then the u-v path P is an augmentic path.
3) Set M'=M ◘ E(P). By the expansion Lemma, M' is a larger matching.
4) Repeat
Part III – T&A
© 2014 IBM Corporation22
Hungarian Algorithm - Preliminaries
Data Structures
• Integer Match[n]; // n is the number of vertices or n=|V| of G=(V,E)
– i.e. Match[u]=v if the matching matches vertex u to vertex v for all u in V
• Default: Match[u]=0 if u is unsaturated (not matched) by the matching
• For Breadth-First-Search (BFS) we use
Integer PrevPt[n]
– i.e. PrevPt[u]=v indicates that v is a parent of u in the BFS tree
• Alternating Paths: we use a combination of Match and PrevPt data
structures to store alternating paths. Example: P = (u, v2, v6, v3, v8)
• List S in X of vertices that are reachable
from a vertex u in X using alternate paths
• List NS in Y of vertices that are reachable
from a vertex u in X using alternate paths
Part III – T&A
PrevPt(v3)
PrevPt(v2)
Match(v6)
Match(v8)
© 2014 IBM Corporation23
Algorithm-1 (Augment subroutine)
Augment (y)
// Input: y is the end vertex of the augmenting path
// Output: augments the edges along the augmenting path “in place”
repeat
w = PrevPt[y]
Match[y] = w
u = Match[w]
Match[w]=y
y=u
until y=0 //reached root of BFS tree ie start vertex of augm. 
          //path
Part III – T&AHungarian Algorithm - Augmenting
© 2014 IBM Corporation24
Part III – T&AHungarian Algorithm – Augm. Example
y
w
v
u
augment(y)
rep.1
w = PrevPt[y]
Match[y] = w
v = Match[w]
Match[w]=y
y=v
rep.2
w = PrevPt[y]
Match[y] = w
v = Match[w]
Match[w]=y
y=v
Augmenting Path
© 2014 IBM Corporation25
Algorithm-2 (Maximum Matching of Graph G with bipartition (X,Y) and n vert.)
for i=1 to n do Match[i]=0 //init
for each u in X do {
  S.append(u);
  for i=1 to n do PrevPt[i]=0; //BFS rooted at u
   k=1;
   repeat
x = S[k];
for each y adjacent to x do {
         if y not in NS {
           NS.append(y);
           PrevPt[y]=x;
           if y is unsaturated {
             // found augmented path!!!
             augment(y);
             go to 1; // we saturated u
           } else S.append(Match[y]); // continue building the BFS tree
         }
     }
     k = k+1;
    until k > S.size(); // BFS rooted at u is now built out, no saturation :­(
    Remove S and NS from the graph
} 
Part III – T&AHungarian Algorithm
© 2014 IBM Corporation26
Part III – T&AHungarian Algorithm – Example (1)
© 2014 IBM Corporation27
Part III – T&AHungarian Algorithm – Example (2)
© 2014 IBM Corporation28
Food for Thought and Further Reading
Kocay and Kreher,
“Graphs, Algorithms,
and Optimization
(Discrete
Mathematics and Its
Applications)”,
Chapman and
Hall/CRC
How about faster algorithms?
Hints:
● Hopcroft-Karp Algorithm
● Edmond's Algorithm
How about weighted demand
(instead of edges with
implied unit demands)?
Intellectually appealing:
● Prove that Algorithm 2 finds indeed a maximum matching
●
Prove that the Hungarian Algorithm is O(n3
)
© 2014 IBM Corporation29
THANK YOU!
Q&A

More Related Content

What's hot

Reduced Complexity Transfer Function Computation for Complex Indoor Channels ...
Reduced Complexity Transfer Function Computation for Complex Indoor Channels ...Reduced Complexity Transfer Function Computation for Complex Indoor Channels ...
Reduced Complexity Transfer Function Computation for Complex Indoor Channels ...
Ramoni Adeogun, PhD
 
Stanford ICME Lecture on Why Deep Learning Works
Stanford ICME Lecture on Why Deep Learning WorksStanford ICME Lecture on Why Deep Learning Works
Stanford ICME Lecture on Why Deep Learning Works
Charles Martin
 
EmacsRedisplayAlgorithm
EmacsRedisplayAlgorithmEmacsRedisplayAlgorithm
EmacsRedisplayAlgorithm
James Gosling
 
Poster2013
Poster2013Poster2013
Poster2013
xinhuima
 
Why Deep Learning Works: Self Regularization in Deep Neural Networks
Why Deep Learning Works: Self Regularization in Deep Neural Networks Why Deep Learning Works: Self Regularization in Deep Neural Networks
Why Deep Learning Works: Self Regularization in Deep Neural Networks
Charles Martin
 
Why Deep Learning Works: Self Regularization in Deep Neural Networks
Why Deep Learning Works: Self Regularization in Deep Neural NetworksWhy Deep Learning Works: Self Regularization in Deep Neural Networks
Why Deep Learning Works: Self Regularization in Deep Neural Networks
Charles Martin
 
Graph Matching
Graph MatchingGraph Matching
Graph Matching
graphitech
 
Why Deep Learning Works: Self Regularization in Deep Neural Networks
Why Deep Learning Works: Self Regularization in Deep Neural NetworksWhy Deep Learning Works: Self Regularization in Deep Neural Networks
Why Deep Learning Works: Self Regularization in Deep Neural Networks
Charles Martin
 
Why Deep Learning Works: Dec 13, 2018 at ICSI, UC Berkeley
Why Deep Learning Works: Dec 13, 2018 at ICSI, UC BerkeleyWhy Deep Learning Works: Dec 13, 2018 at ICSI, UC Berkeley
Why Deep Learning Works: Dec 13, 2018 at ICSI, UC Berkeley
Charles Martin
 
Paper id 37201520
Paper id 37201520Paper id 37201520
Paper id 37201520
IJRAT
 
Lecture15 xing
Lecture15 xingLecture15 xing
Lecture15 xing
Tianlu Wang
 
Search relevance
Search relevanceSearch relevance
Search relevance
Charles Martin
 
CHI 2014 talk by Antti Oulasvirta: Automated Nonlinear Regression Modeling fo...
CHI 2014 talk by Antti Oulasvirta: Automated Nonlinear Regression Modeling fo...CHI 2014 talk by Antti Oulasvirta: Automated Nonlinear Regression Modeling fo...
CHI 2014 talk by Antti Oulasvirta: Automated Nonlinear Regression Modeling fo...
Aalto University
 
The Power-Bandwidth Tradeoff in MIMO Systems
The Power-Bandwidth Tradeoff in MIMO SystemsThe Power-Bandwidth Tradeoff in MIMO Systems
The Power-Bandwidth Tradeoff in MIMO Systems
Marwan Hammouda
 
F04924352
F04924352F04924352
F04924352
IOSR-JEN
 
Image processing with matlab
Image processing with matlabImage processing with matlab
Image processing with matlab
Aman Gupta
 
IRJET- Color Image Compression using Canonic Signed Digit and Block based...
IRJET-  	  Color Image Compression using Canonic Signed Digit and Block based...IRJET-  	  Color Image Compression using Canonic Signed Digit and Block based...
IRJET- Color Image Compression using Canonic Signed Digit and Block based...
IRJET Journal
 
Georgetown B-school Talk 2021
Georgetown B-school Talk  2021Georgetown B-school Talk  2021
Georgetown B-school Talk 2021
Charles Martin
 
Computationally Efficient Multi-Antenna Techniques for Multi-User Two-Way Wire...
Computationally Efficient Multi-Antenna Techniques for Multi-User Two-Way Wire...Computationally Efficient Multi-Antenna Techniques for Multi-User Two-Way Wire...
Computationally Efficient Multi-Antenna Techniques for Multi-User Two-Way Wire...
IJECEIAES
 
Albert
AlbertAlbert
Albert
seungwoo kim
 

What's hot (20)

Reduced Complexity Transfer Function Computation for Complex Indoor Channels ...
Reduced Complexity Transfer Function Computation for Complex Indoor Channels ...Reduced Complexity Transfer Function Computation for Complex Indoor Channels ...
Reduced Complexity Transfer Function Computation for Complex Indoor Channels ...
 
Stanford ICME Lecture on Why Deep Learning Works
Stanford ICME Lecture on Why Deep Learning WorksStanford ICME Lecture on Why Deep Learning Works
Stanford ICME Lecture on Why Deep Learning Works
 
EmacsRedisplayAlgorithm
EmacsRedisplayAlgorithmEmacsRedisplayAlgorithm
EmacsRedisplayAlgorithm
 
Poster2013
Poster2013Poster2013
Poster2013
 
Why Deep Learning Works: Self Regularization in Deep Neural Networks
Why Deep Learning Works: Self Regularization in Deep Neural Networks Why Deep Learning Works: Self Regularization in Deep Neural Networks
Why Deep Learning Works: Self Regularization in Deep Neural Networks
 
Why Deep Learning Works: Self Regularization in Deep Neural Networks
Why Deep Learning Works: Self Regularization in Deep Neural NetworksWhy Deep Learning Works: Self Regularization in Deep Neural Networks
Why Deep Learning Works: Self Regularization in Deep Neural Networks
 
Graph Matching
Graph MatchingGraph Matching
Graph Matching
 
Why Deep Learning Works: Self Regularization in Deep Neural Networks
Why Deep Learning Works: Self Regularization in Deep Neural NetworksWhy Deep Learning Works: Self Regularization in Deep Neural Networks
Why Deep Learning Works: Self Regularization in Deep Neural Networks
 
Why Deep Learning Works: Dec 13, 2018 at ICSI, UC Berkeley
Why Deep Learning Works: Dec 13, 2018 at ICSI, UC BerkeleyWhy Deep Learning Works: Dec 13, 2018 at ICSI, UC Berkeley
Why Deep Learning Works: Dec 13, 2018 at ICSI, UC Berkeley
 
Paper id 37201520
Paper id 37201520Paper id 37201520
Paper id 37201520
 
Lecture15 xing
Lecture15 xingLecture15 xing
Lecture15 xing
 
Search relevance
Search relevanceSearch relevance
Search relevance
 
CHI 2014 talk by Antti Oulasvirta: Automated Nonlinear Regression Modeling fo...
CHI 2014 talk by Antti Oulasvirta: Automated Nonlinear Regression Modeling fo...CHI 2014 talk by Antti Oulasvirta: Automated Nonlinear Regression Modeling fo...
CHI 2014 talk by Antti Oulasvirta: Automated Nonlinear Regression Modeling fo...
 
The Power-Bandwidth Tradeoff in MIMO Systems
The Power-Bandwidth Tradeoff in MIMO SystemsThe Power-Bandwidth Tradeoff in MIMO Systems
The Power-Bandwidth Tradeoff in MIMO Systems
 
F04924352
F04924352F04924352
F04924352
 
Image processing with matlab
Image processing with matlabImage processing with matlab
Image processing with matlab
 
IRJET- Color Image Compression using Canonic Signed Digit and Block based...
IRJET-  	  Color Image Compression using Canonic Signed Digit and Block based...IRJET-  	  Color Image Compression using Canonic Signed Digit and Block based...
IRJET- Color Image Compression using Canonic Signed Digit and Block based...
 
Georgetown B-school Talk 2021
Georgetown B-school Talk  2021Georgetown B-school Talk  2021
Georgetown B-school Talk 2021
 
Computationally Efficient Multi-Antenna Techniques for Multi-User Two-Way Wire...
Computationally Efficient Multi-Antenna Techniques for Multi-User Two-Way Wire...Computationally Efficient Multi-Antenna Techniques for Multi-User Two-Way Wire...
Computationally Efficient Multi-Antenna Techniques for Multi-User Two-Way Wire...
 
Albert
AlbertAlbert
Albert
 

Viewers also liked

Graph
GraphGraph
Maximum Matching in General Graphs
Maximum Matching in General GraphsMaximum Matching in General Graphs
Maximum Matching in General Graphs
Ahmad Khayyat
 
Graphs
GraphsGraphs
Graphs
Ali Saleem
 
Graph Coloring and Its Implementation
Graph Coloring and Its ImplementationGraph Coloring and Its Implementation
Graph Coloring and Its Implementation
IJARIIT
 
[ACM-ICPC] Bipartite Matching
[ACM-ICPC] Bipartite Matching[ACM-ICPC] Bipartite Matching
[ACM-ICPC] Bipartite Matching
Chih-Hsuan Kuo
 
Simple algorithm & hopcroft karp for bipartite graph
Simple algorithm & hopcroft karp for bipartite graphSimple algorithm & hopcroft karp for bipartite graph
Simple algorithm & hopcroft karp for bipartite graph
Miguel Pereira
 
Mems optical switches
Mems optical switchesMems optical switches
Mems optical switches
Mohd Nazir Shakeel
 

Viewers also liked (7)

Graph
GraphGraph
Graph
 
Maximum Matching in General Graphs
Maximum Matching in General GraphsMaximum Matching in General Graphs
Maximum Matching in General Graphs
 
Graphs
GraphsGraphs
Graphs
 
Graph Coloring and Its Implementation
Graph Coloring and Its ImplementationGraph Coloring and Its Implementation
Graph Coloring and Its Implementation
 
[ACM-ICPC] Bipartite Matching
[ACM-ICPC] Bipartite Matching[ACM-ICPC] Bipartite Matching
[ACM-ICPC] Bipartite Matching
 
Simple algorithm & hopcroft karp for bipartite graph
Simple algorithm & hopcroft karp for bipartite graphSimple algorithm & hopcroft karp for bipartite graph
Simple algorithm & hopcroft karp for bipartite graph
 
Mems optical switches
Mems optical switchesMems optical switches
Mems optical switches
 

Similar to Teaching Graph Algorithms in the Field - Bipartite Matching in optical datacenters

Thesis_Draft_Nurkhaidarov
Thesis_Draft_NurkhaidarovThesis_Draft_Nurkhaidarov
Thesis_Draft_Nurkhaidarov
Bek Nurkhaidarov
 
On the-optimal-number-of-smart-dust-particles
On the-optimal-number-of-smart-dust-particlesOn the-optimal-number-of-smart-dust-particles
On the-optimal-number-of-smart-dust-particles
Cemal Ardil
 
Analysis of Impact of Graph Theory in Computer Application
Analysis of Impact of Graph Theory in Computer ApplicationAnalysis of Impact of Graph Theory in Computer Application
Analysis of Impact of Graph Theory in Computer Application
IRJET Journal
 
Day 5 application of graph ,biconnectivity fdp on ds
Day 5 application of graph ,biconnectivity fdp on dsDay 5 application of graph ,biconnectivity fdp on ds
Day 5 application of graph ,biconnectivity fdp on ds
GUNASUNDARISAPIIICSE
 
Graphs in Data Structure
 Graphs in Data Structure Graphs in Data Structure
Graphs in Data Structure
hafsa komal
 
An Alternative Genetic Algorithm to Optimize OSPF Weights
An Alternative Genetic Algorithm to Optimize OSPF WeightsAn Alternative Genetic Algorithm to Optimize OSPF Weights
An Alternative Genetic Algorithm to Optimize OSPF Weights
EM Legacy
 
Applied Graph Theory Applications
Applied Graph Theory ApplicationsApplied Graph Theory Applications
Applied Graph Theory Applications
vipin3195
 
A comparison of efficient algorithms for scheduling parallel data redistribution
A comparison of efficient algorithms for scheduling parallel data redistributionA comparison of efficient algorithms for scheduling parallel data redistribution
A comparison of efficient algorithms for scheduling parallel data redistribution
IJCNCJournal
 
Sigmod11 outsource shortest path
Sigmod11 outsource shortest pathSigmod11 outsource shortest path
Sigmod11 outsource shortest path
redhatdb
 
Computer Networking Assignment Help
Computer Networking Assignment HelpComputer Networking Assignment Help
Computer Networking Assignment Help
Computer Network Assignment Help
 
Computation Assignment Help
Computation Assignment Help Computation Assignment Help
Computation Assignment Help
Programming Homework Help
 
Network Design Assignment Help
Network Design Assignment HelpNetwork Design Assignment Help
Network Design Assignment Help
Computer Network Assignment Help
 
Traveling Salesman Problem in Distributed Environment
Traveling Salesman Problem in Distributed EnvironmentTraveling Salesman Problem in Distributed Environment
Traveling Salesman Problem in Distributed Environment
csandit
 
TRAVELING SALESMAN PROBLEM IN DISTRIBUTED ENVIRONMENT
TRAVELING SALESMAN PROBLEM IN DISTRIBUTED ENVIRONMENTTRAVELING SALESMAN PROBLEM IN DISTRIBUTED ENVIRONMENT
TRAVELING SALESMAN PROBLEM IN DISTRIBUTED ENVIRONMENT
cscpconf
 
Description Of A Graph
Description Of A GraphDescription Of A Graph
Description Of A Graph
Winstina Kennedy
 
K-BestMatch
K-BestMatchK-BestMatch
K-BestMatch
Roberto Trasarti
 
IRJET- Comparison for Max-Flow Min-Cut Algorithms for Optimal Assignment Problem
IRJET- Comparison for Max-Flow Min-Cut Algorithms for Optimal Assignment ProblemIRJET- Comparison for Max-Flow Min-Cut Algorithms for Optimal Assignment Problem
IRJET- Comparison for Max-Flow Min-Cut Algorithms for Optimal Assignment Problem
IRJET Journal
 
Algorithm Finding Maximum Concurrent Multicommodity Linear Flow with Limited ...
Algorithm Finding Maximum Concurrent Multicommodity Linear Flow with Limited ...Algorithm Finding Maximum Concurrent Multicommodity Linear Flow with Limited ...
Algorithm Finding Maximum Concurrent Multicommodity Linear Flow with Limited ...
IJCNCJournal
 
An improved spfa algorithm for single source shortest path problem using forw...
An improved spfa algorithm for single source shortest path problem using forw...An improved spfa algorithm for single source shortest path problem using forw...
An improved spfa algorithm for single source shortest path problem using forw...
IJMIT JOURNAL
 
International Journal of Managing Information Technology (IJMIT)
International Journal of Managing Information Technology (IJMIT)International Journal of Managing Information Technology (IJMIT)
International Journal of Managing Information Technology (IJMIT)
IJMIT JOURNAL
 

Similar to Teaching Graph Algorithms in the Field - Bipartite Matching in optical datacenters (20)

Thesis_Draft_Nurkhaidarov
Thesis_Draft_NurkhaidarovThesis_Draft_Nurkhaidarov
Thesis_Draft_Nurkhaidarov
 
On the-optimal-number-of-smart-dust-particles
On the-optimal-number-of-smart-dust-particlesOn the-optimal-number-of-smart-dust-particles
On the-optimal-number-of-smart-dust-particles
 
Analysis of Impact of Graph Theory in Computer Application
Analysis of Impact of Graph Theory in Computer ApplicationAnalysis of Impact of Graph Theory in Computer Application
Analysis of Impact of Graph Theory in Computer Application
 
Day 5 application of graph ,biconnectivity fdp on ds
Day 5 application of graph ,biconnectivity fdp on dsDay 5 application of graph ,biconnectivity fdp on ds
Day 5 application of graph ,biconnectivity fdp on ds
 
Graphs in Data Structure
 Graphs in Data Structure Graphs in Data Structure
Graphs in Data Structure
 
An Alternative Genetic Algorithm to Optimize OSPF Weights
An Alternative Genetic Algorithm to Optimize OSPF WeightsAn Alternative Genetic Algorithm to Optimize OSPF Weights
An Alternative Genetic Algorithm to Optimize OSPF Weights
 
Applied Graph Theory Applications
Applied Graph Theory ApplicationsApplied Graph Theory Applications
Applied Graph Theory Applications
 
A comparison of efficient algorithms for scheduling parallel data redistribution
A comparison of efficient algorithms for scheduling parallel data redistributionA comparison of efficient algorithms for scheduling parallel data redistribution
A comparison of efficient algorithms for scheduling parallel data redistribution
 
Sigmod11 outsource shortest path
Sigmod11 outsource shortest pathSigmod11 outsource shortest path
Sigmod11 outsource shortest path
 
Computer Networking Assignment Help
Computer Networking Assignment HelpComputer Networking Assignment Help
Computer Networking Assignment Help
 
Computation Assignment Help
Computation Assignment Help Computation Assignment Help
Computation Assignment Help
 
Network Design Assignment Help
Network Design Assignment HelpNetwork Design Assignment Help
Network Design Assignment Help
 
Traveling Salesman Problem in Distributed Environment
Traveling Salesman Problem in Distributed EnvironmentTraveling Salesman Problem in Distributed Environment
Traveling Salesman Problem in Distributed Environment
 
TRAVELING SALESMAN PROBLEM IN DISTRIBUTED ENVIRONMENT
TRAVELING SALESMAN PROBLEM IN DISTRIBUTED ENVIRONMENTTRAVELING SALESMAN PROBLEM IN DISTRIBUTED ENVIRONMENT
TRAVELING SALESMAN PROBLEM IN DISTRIBUTED ENVIRONMENT
 
Description Of A Graph
Description Of A GraphDescription Of A Graph
Description Of A Graph
 
K-BestMatch
K-BestMatchK-BestMatch
K-BestMatch
 
IRJET- Comparison for Max-Flow Min-Cut Algorithms for Optimal Assignment Problem
IRJET- Comparison for Max-Flow Min-Cut Algorithms for Optimal Assignment ProblemIRJET- Comparison for Max-Flow Min-Cut Algorithms for Optimal Assignment Problem
IRJET- Comparison for Max-Flow Min-Cut Algorithms for Optimal Assignment Problem
 
Algorithm Finding Maximum Concurrent Multicommodity Linear Flow with Limited ...
Algorithm Finding Maximum Concurrent Multicommodity Linear Flow with Limited ...Algorithm Finding Maximum Concurrent Multicommodity Linear Flow with Limited ...
Algorithm Finding Maximum Concurrent Multicommodity Linear Flow with Limited ...
 
An improved spfa algorithm for single source shortest path problem using forw...
An improved spfa algorithm for single source shortest path problem using forw...An improved spfa algorithm for single source shortest path problem using forw...
An improved spfa algorithm for single source shortest path problem using forw...
 
International Journal of Managing Information Technology (IJMIT)
International Journal of Managing Information Technology (IJMIT)International Journal of Managing Information Technology (IJMIT)
International Journal of Managing Information Technology (IJMIT)
 

Recently uploaded

Driving Business Innovation: Latest Generative AI Advancements & Success Story
Driving Business Innovation: Latest Generative AI Advancements & Success StoryDriving Business Innovation: Latest Generative AI Advancements & Success Story
Driving Business Innovation: Latest Generative AI Advancements & Success Story
Safe Software
 
Your One-Stop Shop for Python Success: Top 10 US Python Development Providers
Your One-Stop Shop for Python Success: Top 10 US Python Development ProvidersYour One-Stop Shop for Python Success: Top 10 US Python Development Providers
Your One-Stop Shop for Python Success: Top 10 US Python Development Providers
akankshawande
 
Removing Uninteresting Bytes in Software Fuzzing
Removing Uninteresting Bytes in Software FuzzingRemoving Uninteresting Bytes in Software Fuzzing
Removing Uninteresting Bytes in Software Fuzzing
Aftab Hussain
 
Essentials of Automations: The Art of Triggers and Actions in FME
Essentials of Automations: The Art of Triggers and Actions in FMEEssentials of Automations: The Art of Triggers and Actions in FME
Essentials of Automations: The Art of Triggers and Actions in FME
Safe Software
 
Presentation of the OECD Artificial Intelligence Review of Germany
Presentation of the OECD Artificial Intelligence Review of GermanyPresentation of the OECD Artificial Intelligence Review of Germany
Presentation of the OECD Artificial Intelligence Review of Germany
innovationoecd
 
Unlock the Future of Search with MongoDB Atlas_ Vector Search Unleashed.pdf
Unlock the Future of Search with MongoDB Atlas_ Vector Search Unleashed.pdfUnlock the Future of Search with MongoDB Atlas_ Vector Search Unleashed.pdf
Unlock the Future of Search with MongoDB Atlas_ Vector Search Unleashed.pdf
Malak Abu Hammad
 
Fueling AI with Great Data with Airbyte Webinar
Fueling AI with Great Data with Airbyte WebinarFueling AI with Great Data with Airbyte Webinar
Fueling AI with Great Data with Airbyte Webinar
Zilliz
 
Taking AI to the Next Level in Manufacturing.pdf
Taking AI to the Next Level in Manufacturing.pdfTaking AI to the Next Level in Manufacturing.pdf
Taking AI to the Next Level in Manufacturing.pdf
ssuserfac0301
 
How to use Firebase Data Connect For Flutter
How to use Firebase Data Connect For FlutterHow to use Firebase Data Connect For Flutter
How to use Firebase Data Connect For Flutter
Daiki Mogmet Ito
 
Artificial Intelligence for XMLDevelopment
Artificial Intelligence for XMLDevelopmentArtificial Intelligence for XMLDevelopment
Artificial Intelligence for XMLDevelopment
Octavian Nadolu
 
Uni Systems Copilot event_05062024_C.Vlachos.pdf
Uni Systems Copilot event_05062024_C.Vlachos.pdfUni Systems Copilot event_05062024_C.Vlachos.pdf
Uni Systems Copilot event_05062024_C.Vlachos.pdf
Uni Systems S.M.S.A.
 
Video Streaming: Then, Now, and in the Future
Video Streaming: Then, Now, and in the FutureVideo Streaming: Then, Now, and in the Future
Video Streaming: Then, Now, and in the Future
Alpen-Adria-Universität
 
みなさんこんにちはこれ何文字まで入るの?40文字以下不可とか本当に意味わからないけどこれ限界文字数書いてないからマジでやばい文字数いけるんじゃないの?えこ...
みなさんこんにちはこれ何文字まで入るの?40文字以下不可とか本当に意味わからないけどこれ限界文字数書いてないからマジでやばい文字数いけるんじゃないの?えこ...みなさんこんにちはこれ何文字まで入るの?40文字以下不可とか本当に意味わからないけどこれ限界文字数書いてないからマジでやばい文字数いけるんじゃないの?えこ...
みなさんこんにちはこれ何文字まで入るの?40文字以下不可とか本当に意味わからないけどこれ限界文字数書いてないからマジでやばい文字数いけるんじゃないの?えこ...
名前 です男
 
Mariano G Tinti - Decoding SpaceX
Mariano G Tinti - Decoding SpaceXMariano G Tinti - Decoding SpaceX
Mariano G Tinti - Decoding SpaceX
Mariano Tinti
 
Choosing The Best AWS Service For Your Website + API.pptx
Choosing The Best AWS Service For Your Website + API.pptxChoosing The Best AWS Service For Your Website + API.pptx
Choosing The Best AWS Service For Your Website + API.pptx
Brandon Minnick, MBA
 
Mind map of terminologies used in context of Generative AI
Mind map of terminologies used in context of Generative AIMind map of terminologies used in context of Generative AI
Mind map of terminologies used in context of Generative AI
Kumud Singh
 
Generating privacy-protected synthetic data using Secludy and Milvus
Generating privacy-protected synthetic data using Secludy and MilvusGenerating privacy-protected synthetic data using Secludy and Milvus
Generating privacy-protected synthetic data using Secludy and Milvus
Zilliz
 
20240607 QFM018 Elixir Reading List May 2024
20240607 QFM018 Elixir Reading List May 202420240607 QFM018 Elixir Reading List May 2024
20240607 QFM018 Elixir Reading List May 2024
Matthew Sinclair
 
AI-Powered Food Delivery Transforming App Development in Saudi Arabia.pdf
AI-Powered Food Delivery Transforming App Development in Saudi Arabia.pdfAI-Powered Food Delivery Transforming App Development in Saudi Arabia.pdf
AI-Powered Food Delivery Transforming App Development in Saudi Arabia.pdf
Techgropse Pvt.Ltd.
 
CAKE: Sharing Slices of Confidential Data on Blockchain
CAKE: Sharing Slices of Confidential Data on BlockchainCAKE: Sharing Slices of Confidential Data on Blockchain
CAKE: Sharing Slices of Confidential Data on Blockchain
Claudio Di Ciccio
 

Recently uploaded (20)

Driving Business Innovation: Latest Generative AI Advancements & Success Story
Driving Business Innovation: Latest Generative AI Advancements & Success StoryDriving Business Innovation: Latest Generative AI Advancements & Success Story
Driving Business Innovation: Latest Generative AI Advancements & Success Story
 
Your One-Stop Shop for Python Success: Top 10 US Python Development Providers
Your One-Stop Shop for Python Success: Top 10 US Python Development ProvidersYour One-Stop Shop for Python Success: Top 10 US Python Development Providers
Your One-Stop Shop for Python Success: Top 10 US Python Development Providers
 
Removing Uninteresting Bytes in Software Fuzzing
Removing Uninteresting Bytes in Software FuzzingRemoving Uninteresting Bytes in Software Fuzzing
Removing Uninteresting Bytes in Software Fuzzing
 
Essentials of Automations: The Art of Triggers and Actions in FME
Essentials of Automations: The Art of Triggers and Actions in FMEEssentials of Automations: The Art of Triggers and Actions in FME
Essentials of Automations: The Art of Triggers and Actions in FME
 
Presentation of the OECD Artificial Intelligence Review of Germany
Presentation of the OECD Artificial Intelligence Review of GermanyPresentation of the OECD Artificial Intelligence Review of Germany
Presentation of the OECD Artificial Intelligence Review of Germany
 
Unlock the Future of Search with MongoDB Atlas_ Vector Search Unleashed.pdf
Unlock the Future of Search with MongoDB Atlas_ Vector Search Unleashed.pdfUnlock the Future of Search with MongoDB Atlas_ Vector Search Unleashed.pdf
Unlock the Future of Search with MongoDB Atlas_ Vector Search Unleashed.pdf
 
Fueling AI with Great Data with Airbyte Webinar
Fueling AI with Great Data with Airbyte WebinarFueling AI with Great Data with Airbyte Webinar
Fueling AI with Great Data with Airbyte Webinar
 
Taking AI to the Next Level in Manufacturing.pdf
Taking AI to the Next Level in Manufacturing.pdfTaking AI to the Next Level in Manufacturing.pdf
Taking AI to the Next Level in Manufacturing.pdf
 
How to use Firebase Data Connect For Flutter
How to use Firebase Data Connect For FlutterHow to use Firebase Data Connect For Flutter
How to use Firebase Data Connect For Flutter
 
Artificial Intelligence for XMLDevelopment
Artificial Intelligence for XMLDevelopmentArtificial Intelligence for XMLDevelopment
Artificial Intelligence for XMLDevelopment
 
Uni Systems Copilot event_05062024_C.Vlachos.pdf
Uni Systems Copilot event_05062024_C.Vlachos.pdfUni Systems Copilot event_05062024_C.Vlachos.pdf
Uni Systems Copilot event_05062024_C.Vlachos.pdf
 
Video Streaming: Then, Now, and in the Future
Video Streaming: Then, Now, and in the FutureVideo Streaming: Then, Now, and in the Future
Video Streaming: Then, Now, and in the Future
 
みなさんこんにちはこれ何文字まで入るの?40文字以下不可とか本当に意味わからないけどこれ限界文字数書いてないからマジでやばい文字数いけるんじゃないの?えこ...
みなさんこんにちはこれ何文字まで入るの?40文字以下不可とか本当に意味わからないけどこれ限界文字数書いてないからマジでやばい文字数いけるんじゃないの?えこ...みなさんこんにちはこれ何文字まで入るの?40文字以下不可とか本当に意味わからないけどこれ限界文字数書いてないからマジでやばい文字数いけるんじゃないの?えこ...
みなさんこんにちはこれ何文字まで入るの?40文字以下不可とか本当に意味わからないけどこれ限界文字数書いてないからマジでやばい文字数いけるんじゃないの?えこ...
 
Mariano G Tinti - Decoding SpaceX
Mariano G Tinti - Decoding SpaceXMariano G Tinti - Decoding SpaceX
Mariano G Tinti - Decoding SpaceX
 
Choosing The Best AWS Service For Your Website + API.pptx
Choosing The Best AWS Service For Your Website + API.pptxChoosing The Best AWS Service For Your Website + API.pptx
Choosing The Best AWS Service For Your Website + API.pptx
 
Mind map of terminologies used in context of Generative AI
Mind map of terminologies used in context of Generative AIMind map of terminologies used in context of Generative AI
Mind map of terminologies used in context of Generative AI
 
Generating privacy-protected synthetic data using Secludy and Milvus
Generating privacy-protected synthetic data using Secludy and MilvusGenerating privacy-protected synthetic data using Secludy and Milvus
Generating privacy-protected synthetic data using Secludy and Milvus
 
20240607 QFM018 Elixir Reading List May 2024
20240607 QFM018 Elixir Reading List May 202420240607 QFM018 Elixir Reading List May 2024
20240607 QFM018 Elixir Reading List May 2024
 
AI-Powered Food Delivery Transforming App Development in Saudi Arabia.pdf
AI-Powered Food Delivery Transforming App Development in Saudi Arabia.pdfAI-Powered Food Delivery Transforming App Development in Saudi Arabia.pdf
AI-Powered Food Delivery Transforming App Development in Saudi Arabia.pdf
 
CAKE: Sharing Slices of Confidential Data on Blockchain
CAKE: Sharing Slices of Confidential Data on BlockchainCAKE: Sharing Slices of Confidential Data on Blockchain
CAKE: Sharing Slices of Confidential Data on Blockchain
 

Teaching Graph Algorithms in the Field - Bipartite Matching in optical datacenters

  • 1. © 2014 IBM Corporation Bipartite Matching and Optical Clouds - what? Kostas Katrinis Guest Lecture – CS2012 Programming Techniques Trinity College Dublin April 14, 2014
  • 2. © 2014 IBM Corporation2 Outline • Scope & Background • Motivation & Challenges • Hybrid Network Architecture • MEMS Optical Switch Operation Brief • Bipartite Graphs • Matchings • Make the connection! • Hungarian Algorithm Part I - Introduction Part II – Modeling Part III – Theory & Algorithm
  • 3. © 2014 IBM Corporation3 Scope Part I - Background • Target Markets – (Cloud) Datacenters - Θ(10K) Servers – HPC Clusters (82% in Nov'12 Top-500) • Target Systems: – Data Network Fabric
  • 4. © 2014 IBM Corporation4 DC Traffic Trends • 76% of the traffic is intra-datacenter * • Total DC traffic CAGR 33% to 2015 * • Traffic percentage exiting the rack is high (up to 90%) ** – ...and we expect it to increase (scale-out workloads) * Cisco Global Cloud Index: Forecast and Methodology, 2011–2016 ** Benson et al., “Network Traffic Characteristics of Data Centers in the Wild”, IMC'10 Part I - Background
  • 5. © 2014 IBM Corporation5 Design Trade-offs (Performance) Performance Cost Highly oversubcr. High Bisection Trade-off • We need high-capacity between any two points in the DC • and at various scales (incremental deployment) • ... we need $$$ Part I - Background
  • 6. © 2014 IBM Corporation6 Motivating Example Item Item List Price (USD)** Qty Total List Price (USD) BNT G8264 (64-port switch) 30,000 5,120 153,600,000 BNT SFP+ SR Transceiver 665 262,164 174,325,760 MM Fiber Cable 28 131,072 3,670,016 Estimated List Prices **Source: ibm.com Fabric Price 331M USD ≈ Compute Price (@5K/server) • Full-bisection fat-tree @ 65k servers • Building block: 64-port Ethernet switches (ala VL2*) • Denser switches will not help you (e.g. 288-port Mellanox Vantage) Greenberg et al., “VL2: A Scalable and Flexible Data Center Network”, SIGCOMM 2009 Part I - Background
  • 7. © 2014 IBM Corporation7 Motivating Example (cont.) Total Price 331m USD AND..... #Cables to route 131,000 Can you count the birds in this nest? Part I - Background
  • 8. © 2014 IBM Corporation8 Paradigm Shift - Switch Light Tiltable Mirrors implemented via MEMS (Micro-Electrical Mechanical Systems) + High-radix (320 ports you can buy, 1024 feasible) + No transceivers + Decreasing $/port + 50x less Watts/port vs. electronics + Can switch up to ~1Tbps + Protocol Agnostic Electronic Switch (Ethernet) Optical MEMS switch Price/Port (USD) 1100 (includes TxRx cost) 350 Bandwidth/Port 10Gbps “Rate-free” Power/Port (W) 10 0.2 Requires TxRxs Yes No x3 x∞ x50 Part I - Background
  • 9. © 2014 IBM Corporation9 Hybrid Fabric Architecture Part I - Architecture
  • 10. © 2014 IBM Corporation10 Dublin Prototype - Photos Single-mode fiber links, 25m length, 10GBASE-LR 96x96-Port 3D-MEMS Switch Shamrock Server Rack, Chelsio T4 NIC cards G8264 TOR Switch Redirect traffic from over-subscribed electrical network to optical circuits.  Packet forwarding removes bandwidth limitation of over-subscribed electrical network. Max. Latency <13 ns Part I - Architecture
  • 11. © 2014 IBM Corporation11 High-level Functionality • Bijective TE: – Mice are routed via the 1G electronic fabric – Elephants are routed via the 10G optical fabric Optical Fabric is reconfigurable – Centralized control optimizes topology against traffic pattern and demand volume Part I - Architecture
  • 12. © 2014 IBM Corporation12 Optical MEMS Switch Part II – MEMS Switch • Focus on the “Optical MEMS Switch” • NxN ports (N inputs to connect to N outputs) • Each input port is dynamically “crossconnected” to at most one output port based on the rack pair we need to connect (decide every X seconds) • E.g. Crossconnect port-13 to port-45 to connect rack-2 with rack-5 above
  • 13. © 2014 IBM Corporation13 Bipartite Graphs Definition (Bipartite Graphs) G=(V,E) is bipartite if we can partition its vertex set V to two disjoing sets X and Y, s.t. there are no edges between X and Y. We say that (X,Y) is a bipartion of G. Note: During this lecture, we will constrain our focus for the sake of understanding to undirected graphs. Applying the concepts to directed graphs as food for thought. Part II – Bipartite
  • 14. © 2014 IBM Corporation14 Matchings Definition (Matching) A matching M of a graph G=(V,E) is a set of edges of G such that no two edges in M share a common vertex. • If a vertex u is matched by M, then we say that u is saturated by M. Otherwise, a vertex u is unsaturated by M Example: In M1, v2 is saturated, whereas v1 is unsaturated Part II – Matchings
  • 15. © 2014 IBM Corporation15 Maximum Matchings • Greediness strikes back: we want a matching to have as many edges as possible Definition (Maximum Matching) A matching M of a graph G=(V,E) is a maximum matching if no matching in G has more edges. Example: M2 is a maximum matching (|G|=8 and |M2|=4). Since |M1|=3, M1 is not maximum. Part II – Matchings
  • 16. © 2014 IBM Corporation16 Technology ↔ Theory: Connection Part II – Model
  • 17. © 2014 IBM Corporation17 Maximum Matching – Optical Switch • Remember that our Greediness keeps striking back, can't get rid of it! • If we find a maximum matching (maximum number of edges), then we have maximized the number of crossconnections in our optical switch • .... thus we have maximized throughput (aggregate bandwidth that crosses the optical switch) Part II – Model
  • 18. © 2014 IBM Corporation18 Maximum Matching in Bipartite Graphs • So this is what we need (see title above) to maximize utilization of our optical switch. We need an algorithm to find a maximum matching on a bipartite graph. But how? Some theory first (and more definitions) Definition (Alternating and Augmenting Paths) Let G=(V,E) have a matching M. An alternating path P with respect to M is any path whose edges are alternately in M and not in M (E-M). If the start and end vertices of P are not saturated by M, then P is an augmenting path. Example: P= (v1,v2,v3,v4,v5) is an alternating path P'= (v1,v2,v3,v4,v5,v6) is an augmenting path Part III – T&A
  • 19. © 2014 IBM Corporation19 Matching expansion Definition (Symmetric Difference) Let E and E' be two edge sets. Then we define as the symmetric difference M=E ◘ E' of the two sets the operation M = (E-E') U (E'-E) = (E U E') – (E ∩ E') • Let G and M a matching (see below). P = (v1,v2,v3,v4,v5,v6) is an augmentic path. E(P) are the edges of P. • |M|=3 • Define M' = M ◘ E(P) • Observe: |M'|=4 … wow! We obtained a larger matching M' starting from a non-maximum one (M) Part III – T&A
  • 20. © 2014 IBM Corporation20 Expansion Lemma Lemma –1 (Matching Expansion) Let G have a matching M and let P be an augmenting path with respect to M. Then M' = M ◘ E(P) is a matching with one more edge than M – or equivalently – |M'|=|M|+1. Proof M' contains all the edges of M, plus all the edges in E(P) that are not in M. Thus M' is per construction a matching of G. Let u and v be the start and end vertices of P. Then u and v are unsaturated in M, because P is an augmenting path. Because of the symmetric difference operator, u and v are now saturated in M'. The rest of the edges of M that were not in E(P) are still in M'. Thus, |M'|=|M|+1 Part III – T&A
  • 21. © 2014 IBM Corporation21 Berge's Theorem Theorem-1 (Berge's Theorem) A matching M in G is maximum if and only if G has no augmenting path with respect to M. Proof Left as an exercise (aka we don't have the time budget in class :-)). Reference Textbook has a rigorous, easy-to-follow proof • Theorems and lemmas are tools to an end. Let's use them! • Back to our goal: We need an algorithm to find a maximum matching on a bipartite graph • Strategy: 1) Start with an arbitrary (even empty) matching M. If M is not maximum, there will be an unsaturated vertex u. 2) Follow alternating paths from u until we identify another unsaturated vertex v. Then the u-v path P is an augmentic path. 3) Set M'=M ◘ E(P). By the expansion Lemma, M' is a larger matching. 4) Repeat Part III – T&A
  • 22. © 2014 IBM Corporation22 Hungarian Algorithm - Preliminaries Data Structures • Integer Match[n]; // n is the number of vertices or n=|V| of G=(V,E) – i.e. Match[u]=v if the matching matches vertex u to vertex v for all u in V • Default: Match[u]=0 if u is unsaturated (not matched) by the matching • For Breadth-First-Search (BFS) we use Integer PrevPt[n] – i.e. PrevPt[u]=v indicates that v is a parent of u in the BFS tree • Alternating Paths: we use a combination of Match and PrevPt data structures to store alternating paths. Example: P = (u, v2, v6, v3, v8) • List S in X of vertices that are reachable from a vertex u in X using alternate paths • List NS in Y of vertices that are reachable from a vertex u in X using alternate paths Part III – T&A PrevPt(v3) PrevPt(v2) Match(v6) Match(v8)
  • 23. © 2014 IBM Corporation23 Algorithm-1 (Augment subroutine) Augment (y) // Input: y is the end vertex of the augmenting path // Output: augments the edges along the augmenting path “in place” repeat w = PrevPt[y] Match[y] = w u = Match[w] Match[w]=y y=u until y=0 //reached root of BFS tree ie start vertex of augm.            //path Part III – T&AHungarian Algorithm - Augmenting
  • 24. © 2014 IBM Corporation24 Part III – T&AHungarian Algorithm – Augm. Example y w v u augment(y) rep.1 w = PrevPt[y] Match[y] = w v = Match[w] Match[w]=y y=v rep.2 w = PrevPt[y] Match[y] = w v = Match[w] Match[w]=y y=v Augmenting Path
  • 25. © 2014 IBM Corporation25 Algorithm-2 (Maximum Matching of Graph G with bipartition (X,Y) and n vert.) for i=1 to n do Match[i]=0 //init for each u in X do {   S.append(u);   for i=1 to n do PrevPt[i]=0; //BFS rooted at u    k=1;    repeat x = S[k]; for each y adjacent to x do {          if y not in NS {            NS.append(y);            PrevPt[y]=x;            if y is unsaturated {              // found augmented path!!!              augment(y);              go to 1; // we saturated u            } else S.append(Match[y]); // continue building the BFS tree          }      }      k = k+1;     until k > S.size(); // BFS rooted at u is now built out, no saturation :­(     Remove S and NS from the graph }  Part III – T&AHungarian Algorithm
  • 26. © 2014 IBM Corporation26 Part III – T&AHungarian Algorithm – Example (1)
  • 27. © 2014 IBM Corporation27 Part III – T&AHungarian Algorithm – Example (2)
  • 28. © 2014 IBM Corporation28 Food for Thought and Further Reading Kocay and Kreher, “Graphs, Algorithms, and Optimization (Discrete Mathematics and Its Applications)”, Chapman and Hall/CRC How about faster algorithms? Hints: ● Hopcroft-Karp Algorithm ● Edmond's Algorithm How about weighted demand (instead of edges with implied unit demands)? Intellectually appealing: ● Prove that Algorithm 2 finds indeed a maximum matching ● Prove that the Hungarian Algorithm is O(n3 )
  • 29. © 2014 IBM Corporation29 THANK YOU! Q&A