SlideShare ist ein Scribd-Unternehmen logo
1 von 4
Downloaden Sie, um offline zu lesen
2WO08: Graphs and Algorithms
Instructor: Nikhil Bansal

1

Lecture 3

Date: 14/2/2012
Scribe: Ellen Dibbits

Halls’ Theorem

In the second lecture Halls’ Theorem is discussed, this lecture we started with proving it again in
another way.
Theorem 1 Halls’ Theorem Given a bipartite graph, there is a perfect matching iff |N (s)| ≥
|S| ∀ S ⊆ X, where X is one of the sets of points of the graph.
Proof: This proof is with induction. We take n the amount of vertices in X. For n = 1 it is trivial,
because we just have one vertex in each part, so we can match those vertices with one edge. And
S is empty or contains one point, and in both cases is the amount of neighbors the same. Now we
assume that the statement is true for all graphs on k vertices in X. We want to prove that it is also
true for k + 1 vertices in X. Take vertex v in X, then there is at least one edge leaving v otherwise
there won’t be a perfect matching possible at all. Now we consider two cases.
Case 1: Suppose ∀ S ⊆ X − {v} : |N (S)| ≥ |S| + 1. In this case we have slack so we can
match v with that one edge and then there is still a perfect matching for the other vertices, because
we then have a graph of size k where |N (S)| ≥ |S| holds, and we assumed then the statement is
true. The +1 dissapears because we’ve matched v to some vertex and in the worst case that was a
neighbor of all other vertices in X as well. So in this case we’ve proven we have a perfect matching.
Case 2: So in this case there exists some subset S ⊆ X − v such that |N (S)| = |S|. Pick a
minimum cardinality set satisfying this property. By induction and the minimality of S, we know
that S can be matched to N (S)
Now look at X − S, for this specific S, take a set S ⊆ X − S. Then this S needs to have
neighbors outside N (S), otherwise S ∪ S doesn’t suffice the Hall’s condition. Note that it has to
have |S | outside N (S). If we then look at the rest, by induction also those points have a matching
in Y − N (S). So combining this matchings we have a full matching. This proves the statement. 2
We will now continue with some examples where it is possible to use Halls’ Theorem.
Example 1 If you have n teachers and n courses you can see this as a bipartite graph. Every
teacher can teach a few courses and you want a teacher assigned to each course. This you can solve
with a matching.
Example 2 We have a usual deck of 52 cards. Divide this deck into 13 arbitrary piles of 4 cards.
Prove that it is always possible to get exactly the set A, 2, 3, ..., J, Q, K by picking one card from
each pile.
We can transform this problem into a bipartite graph. On one side 13 vertices representing the
piles and on the other side 13 vertices, one for A, one for 2, etc. Notice that each vertex has degree
four and that we want a perfect matching. Take a set S, a subset of the piles, 4∗|S| edges are leaving
of
this set, but the receiving vertices have also degree four so |N (S)| ≥ number 4 edges = 4|S| = |S|,
4
otherwise there is a vertex with degree greater than 4. So by Halls’ Theorem a perfect matching
exists.
1
Note that we can also decompose all cards into 4 sets, such that each set contains exactly one
card from each pile, and contains exactly a single A, 2, 3, ..., J, Q, K. This can be seen by after
getting that set, remove the edges from the graph and then use the same argument with the degree
one less.
Example 3 Dancing Problem Consider a group of n boys and n girls where everyone knows
exactly k people of the other gender. It is possible to make a dance scheme of k rounds where
everyone will dance exactly once with each of the people they know. This can be seen with a
matching.
Example 4 Scheduling tasks We want to schedule n tasks among m machines. Every task j has
size pj and our goal is to minimize the total completion time of all jobs, where the total completion
time equals the sum of the completion times. This is useful as it is equivalent to computing the
average waiting time.
To solve this problem we make the following crucial observation. Consider some machine, if
job i is the k-th last job to be assigned to it, then it contributes exactly kpi to total completion time
(this is because it contributes pi to its own completion time, and to each of the jobs that are place
after it).
We will construct a bipartite graph where on one side there are n vertices representing the jobs
and on the other side we will mn vertices, where there are n vertices of the type (m, j) for each
machine m. The vertex (m, 1) represents the last job on machine m, (m, 2) the second last job on
machine m, etc. Note that we do not want a perfect matching in this case because we don’t want to
match all mn vertices representing the machines. The edge costs will be determined in the following
way, for an edge from j to (m, i) the cost will be pj ∗ i. Then the problem can be solved by finding
a minimum cost maximal matching.

2

Maximum Flows

You should have seen max-flow in your previous courses, so this will be quick recap. A definition
can be found on page 145 of [2]. The capacity of an edge e we will denote with ce , and we want to
find a maximum flow from s to t. Max-flow can be used to model various problems.
Transforming the matching problem on a bipartite graph into a maximum flow problem can
be done with adding a source and a sink. On one side you will add the source, s, and join this
with all vertices of one side of the bipartite graph, those edges go from s to the original graph. On
the other side you’ll add a sink, t, which will be joined with all vertices on the other side of the
bipartite graph, here the edges will go from the original graph to t. All extra edges will have capacity one. All edges from the already existing graph will have capacity infinity, unless stated otherwise.
As recap we discussed the maximum flow-minimum cut theorem, which can be found on page
149 of [2]. We discussed a proof of this theorem using residual graphs. To find the maximum flow
in a graph there exist efficient algorithms. The naive algorithm that simple augments flow along a
path a residual graph can perform very poorly. Two useful ones are the Maximum augmenting path
algorithm (O(min(m2 log nlog(C), mn2 log C)) where C is the maximum capacity) and the shortest
length path (O(mn2 )). The first one is a simple algorithm, the second is a bit more complex. A
nice readable description of these can be found in the notes that are linked on the course webpage.
2
There are also other algorithms known with improved running times. We will now start with a new
theorem but first we need a definition.

Definition 2 Vertex Cover A subset of vertices such that ∀ edges at least one endpoint is in this
subset.
Theorem 3 Konig-Egervary In a bipartite graph the size of a minimum vertex cover equals the
size of the maximum matching.
Corollary 4 The maximal independent set1 in a bipartite graph can be found in polynomial time.
Proof of [.Konig-Egervary]
• For proving that the size of the minimum vertex cover is greater or equal than the size of
the maximum matching, we first notice that the size of any vertex cover must be at least the
size of any matching. To see this, consider some matching M , clearly at least one endpoint
of each edge must lie in every vertex cover (otherwise this will not be covered). Picking M
to be a maximum size matching, the claim follows.
• To prove the other direction, we know that any flow in the network corresponding to the
bipartite graph (mentioned earlier) gives a matching. So the maximum can be no smaller
than the maximum flow. Consider the min-cut corresponding to this maximum flow. his cut
splits S and T , where S is the part containing s and T the part containing t. We notice that
the minimum cut cannot cross edges with capacity infinity going from S to T , because the
cut where S = {s} is smaller in that case. By drawing a picture, and noting that no infinite
capacity edges are cut, we see that the size of the minimum cut equals |L ∩ T | + |R ∩ S|, where
L are the vertices of the bipartite graph connected with s and R the ones connected with t.
We also note that that |L ∩ T | + |R ∩ S| is a vertex cover because there are no edges form
|L ∩ S| to |R ∩ T | because the cut is not of infinite size. So now we know there is a vertex
cover equal to this minimum cut. So the minimum vertex cover can only be smaller that this
minimum cut. As the maximum matching is not smaller than the minimum cut, this implies
the other direction.
Those points together conclude that indeed the size of the minimum vertex cover in a bipartite
graph equals the size of the maximal matching in the same graph.
2

3

Menger’s Theorem

There are several versions of Menger’s Theorem, we will discuss a few here. But first we will state
a few definitions.
Definition 5 Paths are said to be edge disjoint if they share no edges.
Definition 6 s-t-paths are said to be vertex disjoint if they share no vertices other then s and t.
1

see [1]

3
Theorem 7 Menger’s Theorem for directed graphs, edgedisjoint case Consider a directed
graph. Then the maximum number of edge disjoint s-t-paths equals the minimum number of edges
needed to disconnect s and t.
For proving this, the ’≤’ one is quite obvious, because every path has to go through one of those
edges. The other side follows by giving each edge a capacity of one and using the max-flow-min-cut
theorem.
Theorem 8 Menger’s Theorem for directed graphs, vertexdisjoint case Consider a directed graph. Then the maximum number of vertex disjoint s-t-paths equals the minimum number
of vertices needed to disconnect s and t.
Here also the proof is obvious one way and a bit harder the other way.
Since, min-cut deals with edges, while we want a statement about vertices, we transform a vertex
into an edge as follows. Consider vertex v, and replace it by two vertices v1 and v2 connected by an
edge from v1 to v2 of capacity 1. All incoming edges will now go into v1 and all outgoing edges will
now leave v2 (so an original edge (v, w) now becomes (v2 , w1 )). The original edges have capacity
∞. You can then again see it as a max-flow problem, where the size of the maximal flow equals
the number of vertex disjoint paths and size of the minimum cut.
Several proofs of Menger’s Theorem can be found in Chapter 3 of [2].

References
[1] http://en.wikipedia.org/wiki/Independent set
[2] Reinhard Diestel. Graph Theory, fourth electronic edition, 2010.

4

Weitere ähnliche Inhalte

Was ist angesagt?

A Fixed Point Theorem Using Common Property (E. A.) In PM Spaces
A Fixed Point Theorem Using Common Property (E. A.) In PM SpacesA Fixed Point Theorem Using Common Property (E. A.) In PM Spaces
A Fixed Point Theorem Using Common Property (E. A.) In PM Spacesinventionjournals
 
Local properties and differential forms of smooth map and tangent bundle
Local properties and differential forms of smooth map and tangent bundleLocal properties and differential forms of smooth map and tangent bundle
Local properties and differential forms of smooth map and tangent bundleAlexander Decker
 
A disproof of the Riemann hypothesis
A disproof of the Riemann hypothesisA disproof of the Riemann hypothesis
A disproof of the Riemann hypothesisiosrjce
 
div, grad, curl, and all that - a review
div, grad, curl, and all that - a reviewdiv, grad, curl, and all that - a review
div, grad, curl, and all that - a reviewKwanghee Choi
 
Common fixed point theorems using faintly compatible
Common fixed point theorems using faintly compatibleCommon fixed point theorems using faintly compatible
Common fixed point theorems using faintly compatibleAlexander Decker
 
An Analysis and Study of Iteration Procedures
An Analysis and Study of Iteration ProceduresAn Analysis and Study of Iteration Procedures
An Analysis and Study of Iteration Proceduresijtsrd
 
Afm chapter 4 powerpoint
Afm chapter 4 powerpointAfm chapter 4 powerpoint
Afm chapter 4 powerpointvolleygurl22
 
Chapter 12 vectors and the geometry of space merged
Chapter 12 vectors and the geometry of space mergedChapter 12 vectors and the geometry of space merged
Chapter 12 vectors and the geometry of space mergedEasyStudy3
 
Impacts of a New Spatial Variable on a Black Hole Metric Solution
Impacts of a New Spatial Variable on a Black Hole Metric SolutionImpacts of a New Spatial Variable on a Black Hole Metric Solution
Impacts of a New Spatial Variable on a Black Hole Metric SolutionIJSRED
 
AndersSchreiber_ThesisFinal
AndersSchreiber_ThesisFinalAndersSchreiber_ThesisFinal
AndersSchreiber_ThesisFinalAnders Schreiber
 
Tracing of cartesian curve
Tracing of cartesian curveTracing of cartesian curve
Tracing of cartesian curveKaushal Patel
 
Derivation of a prime verification formula to prove the related open problems
Derivation of a prime verification formula to prove the related open problemsDerivation of a prime verification formula to prove the related open problems
Derivation of a prime verification formula to prove the related open problemsChris De Corte
 
On Hilbert Space Operator Deformation Analysis in Application to Some Element...
On Hilbert Space Operator Deformation Analysis in Application to Some Element...On Hilbert Space Operator Deformation Analysis in Application to Some Element...
On Hilbert Space Operator Deformation Analysis in Application to Some Element...BRNSS Publication Hub
 

Was ist angesagt? (19)

Chapter 4
Chapter 4Chapter 4
Chapter 4
 
A Fixed Point Theorem Using Common Property (E. A.) In PM Spaces
A Fixed Point Theorem Using Common Property (E. A.) In PM SpacesA Fixed Point Theorem Using Common Property (E. A.) In PM Spaces
A Fixed Point Theorem Using Common Property (E. A.) In PM Spaces
 
Local properties and differential forms of smooth map and tangent bundle
Local properties and differential forms of smooth map and tangent bundleLocal properties and differential forms of smooth map and tangent bundle
Local properties and differential forms of smooth map and tangent bundle
 
An introduction to probability theory geiss
An introduction to probability theory   geissAn introduction to probability theory   geiss
An introduction to probability theory geiss
 
A disproof of the Riemann hypothesis
A disproof of the Riemann hypothesisA disproof of the Riemann hypothesis
A disproof of the Riemann hypothesis
 
div, grad, curl, and all that - a review
div, grad, curl, and all that - a reviewdiv, grad, curl, and all that - a review
div, grad, curl, and all that - a review
 
Limits BY ATC
Limits BY ATCLimits BY ATC
Limits BY ATC
 
Common fixed point theorems using faintly compatible
Common fixed point theorems using faintly compatibleCommon fixed point theorems using faintly compatible
Common fixed point theorems using faintly compatible
 
An Analysis and Study of Iteration Procedures
An Analysis and Study of Iteration ProceduresAn Analysis and Study of Iteration Procedures
An Analysis and Study of Iteration Procedures
 
Sol24
Sol24Sol24
Sol24
 
Afm chapter 4 powerpoint
Afm chapter 4 powerpointAfm chapter 4 powerpoint
Afm chapter 4 powerpoint
 
Chapter 12 vectors and the geometry of space merged
Chapter 12 vectors and the geometry of space mergedChapter 12 vectors and the geometry of space merged
Chapter 12 vectors and the geometry of space merged
 
Impacts of a New Spatial Variable on a Black Hole Metric Solution
Impacts of a New Spatial Variable on a Black Hole Metric SolutionImpacts of a New Spatial Variable on a Black Hole Metric Solution
Impacts of a New Spatial Variable on a Black Hole Metric Solution
 
Physics Assignment Help
Physics Assignment HelpPhysics Assignment Help
Physics Assignment Help
 
AndersSchreiber_ThesisFinal
AndersSchreiber_ThesisFinalAndersSchreiber_ThesisFinal
AndersSchreiber_ThesisFinal
 
Tracing of cartesian curve
Tracing of cartesian curveTracing of cartesian curve
Tracing of cartesian curve
 
Spin
SpinSpin
Spin
 
Derivation of a prime verification formula to prove the related open problems
Derivation of a prime verification formula to prove the related open problemsDerivation of a prime verification formula to prove the related open problems
Derivation of a prime verification formula to prove the related open problems
 
On Hilbert Space Operator Deformation Analysis in Application to Some Element...
On Hilbert Space Operator Deformation Analysis in Application to Some Element...On Hilbert Space Operator Deformation Analysis in Application to Some Element...
On Hilbert Space Operator Deformation Analysis in Application to Some Element...
 

Andere mochten auch

Andere mochten auch (7)

Graphtheory
GraphtheoryGraphtheory
Graphtheory
 
Games.4
Games.4Games.4
Games.4
 
Matching
MatchingMatching
Matching
 
Summer+training 2
Summer+training 2Summer+training 2
Summer+training 2
 
Comerv3 1-12(2)
Comerv3 1-12(2)Comerv3 1-12(2)
Comerv3 1-12(2)
 
Math350 hw2solutions
Math350 hw2solutionsMath350 hw2solutions
Math350 hw2solutions
 
Summer2014 internship
Summer2014 internshipSummer2014 internship
Summer2014 internship
 

Ähnlich wie Graphs and Algorithms Lecture on Hall's Theorem, Maximum Flows, and Menger's Theorem

The Concept of Dimension
The Concept of DimensionThe Concept of Dimension
The Concept of Dimensiongizemk
 
Applied Graph Theory Applications
Applied Graph Theory ApplicationsApplied Graph Theory Applications
Applied Graph Theory Applicationsvipin3195
 
ON ALGORITHMIC PROBLEMS CONCERNING GRAPHS OF HIGHER DEGREE OF SYMMETRY
ON ALGORITHMIC PROBLEMS CONCERNING GRAPHS OF HIGHER DEGREE OF SYMMETRYON ALGORITHMIC PROBLEMS CONCERNING GRAPHS OF HIGHER DEGREE OF SYMMETRY
ON ALGORITHMIC PROBLEMS CONCERNING GRAPHS OF HIGHER DEGREE OF SYMMETRYFransiskeran
 
On algorithmic problems concerning graphs of higher degree of symmetry
On algorithmic problems concerning graphs of higher degree of symmetryOn algorithmic problems concerning graphs of higher degree of symmetry
On algorithmic problems concerning graphs of higher degree of symmetrygraphhoc
 
Mithfh lecturenotes 9
Mithfh lecturenotes 9Mithfh lecturenotes 9
Mithfh lecturenotes 9Praveen Kumar
 
Ireducible core and equal remaining obligations rule for mcst games
Ireducible core and equal remaining obligations rule for mcst gamesIreducible core and equal remaining obligations rule for mcst games
Ireducible core and equal remaining obligations rule for mcst gamesvinnief
 
A Quest for Subexponential Time Parameterized Algorithms for Planar-k-Path: F...
A Quest for Subexponential Time Parameterized Algorithms for Planar-k-Path: F...A Quest for Subexponential Time Parameterized Algorithms for Planar-k-Path: F...
A Quest for Subexponential Time Parameterized Algorithms for Planar-k-Path: F...cseiitgn
 
20230124 PLOS Fractal Manuscript 8.docx
20230124 PLOS Fractal Manuscript 8.docx20230124 PLOS Fractal Manuscript 8.docx
20230124 PLOS Fractal Manuscript 8.docxSharon Liu
 
MC0082 –Theory of Computer Science
MC0082 –Theory of Computer ScienceMC0082 –Theory of Computer Science
MC0082 –Theory of Computer ScienceAravind NC
 
An Optimal Solution For The Channel-Assignment Problem
An Optimal Solution For The Channel-Assignment ProblemAn Optimal Solution For The Channel-Assignment Problem
An Optimal Solution For The Channel-Assignment ProblemSarah Morrow
 
Comparative Report Ed098
Comparative Report Ed098Comparative Report Ed098
Comparative Report Ed098mikebrowl
 
Final Report
Final ReportFinal Report
Final ReportCan Liu
 

Ähnlich wie Graphs and Algorithms Lecture on Hall's Theorem, Maximum Flows, and Menger's Theorem (20)

The Concept of Dimension
The Concept of DimensionThe Concept of Dimension
The Concept of Dimension
 
Applied Graph Theory Applications
Applied Graph Theory ApplicationsApplied Graph Theory Applications
Applied Graph Theory Applications
 
ON ALGORITHMIC PROBLEMS CONCERNING GRAPHS OF HIGHER DEGREE OF SYMMETRY
ON ALGORITHMIC PROBLEMS CONCERNING GRAPHS OF HIGHER DEGREE OF SYMMETRYON ALGORITHMIC PROBLEMS CONCERNING GRAPHS OF HIGHER DEGREE OF SYMMETRY
ON ALGORITHMIC PROBLEMS CONCERNING GRAPHS OF HIGHER DEGREE OF SYMMETRY
 
On algorithmic problems concerning graphs of higher degree of symmetry
On algorithmic problems concerning graphs of higher degree of symmetryOn algorithmic problems concerning graphs of higher degree of symmetry
On algorithmic problems concerning graphs of higher degree of symmetry
 
graph_theory_ch_3_20201124.ppt
graph_theory_ch_3_20201124.pptgraph_theory_ch_3_20201124.ppt
graph_theory_ch_3_20201124.ppt
 
Weighted graphs
Weighted graphsWeighted graphs
Weighted graphs
 
Mithfh lecturenotes 9
Mithfh lecturenotes 9Mithfh lecturenotes 9
Mithfh lecturenotes 9
 
Ireducible core and equal remaining obligations rule for mcst games
Ireducible core and equal remaining obligations rule for mcst gamesIreducible core and equal remaining obligations rule for mcst games
Ireducible core and equal remaining obligations rule for mcst games
 
A Quest for Subexponential Time Parameterized Algorithms for Planar-k-Path: F...
A Quest for Subexponential Time Parameterized Algorithms for Planar-k-Path: F...A Quest for Subexponential Time Parameterized Algorithms for Planar-k-Path: F...
A Quest for Subexponential Time Parameterized Algorithms for Planar-k-Path: F...
 
Daa chapter11
Daa chapter11Daa chapter11
Daa chapter11
 
UNIT III.pptx
UNIT III.pptxUNIT III.pptx
UNIT III.pptx
 
Stochastic Process Assignment Help
Stochastic Process Assignment HelpStochastic Process Assignment Help
Stochastic Process Assignment Help
 
project final
project finalproject final
project final
 
20230124 PLOS Fractal Manuscript 8.docx
20230124 PLOS Fractal Manuscript 8.docx20230124 PLOS Fractal Manuscript 8.docx
20230124 PLOS Fractal Manuscript 8.docx
 
Rv2
Rv2Rv2
Rv2
 
MC0082 –Theory of Computer Science
MC0082 –Theory of Computer ScienceMC0082 –Theory of Computer Science
MC0082 –Theory of Computer Science
 
An Optimal Solution For The Channel-Assignment Problem
An Optimal Solution For The Channel-Assignment ProblemAn Optimal Solution For The Channel-Assignment Problem
An Optimal Solution For The Channel-Assignment Problem
 
Comparative Report Ed098
Comparative Report Ed098Comparative Report Ed098
Comparative Report Ed098
 
Final Report
Final ReportFinal Report
Final Report
 
Stochastic Process Exam Help
Stochastic Process Exam HelpStochastic Process Exam Help
Stochastic Process Exam Help
 

Mehr von Praveen Kumar

Mehr von Praveen Kumar (20)

Summer+training
Summer+trainingSummer+training
Summer+training
 
Solutions1.1
Solutions1.1Solutions1.1
Solutions1.1
 
Slides15
Slides15Slides15
Slides15
 
Scribed lec8
Scribed lec8Scribed lec8
Scribed lec8
 
Scholarship sc st
Scholarship sc stScholarship sc st
Scholarship sc st
 
Networks 2
Networks 2Networks 2
Networks 2
 
Mcs student
Mcs studentMcs student
Mcs student
 
Line circle draw
Line circle drawLine circle draw
Line circle draw
 
Lec2 state space
Lec2 state spaceLec2 state space
Lec2 state space
 
Graphics display-devicesmod-1
Graphics display-devicesmod-1Graphics display-devicesmod-1
Graphics display-devicesmod-1
 
Dda line-algorithm
Dda line-algorithmDda line-algorithm
Dda line-algorithm
 
Cs344 lect15-robotic-knowledge-inferencing-prolog-11feb08
Cs344 lect15-robotic-knowledge-inferencing-prolog-11feb08Cs344 lect15-robotic-knowledge-inferencing-prolog-11feb08
Cs344 lect15-robotic-knowledge-inferencing-prolog-11feb08
 
Cse3461.c.signal encoding.09 04-2012
Cse3461.c.signal encoding.09 04-2012Cse3461.c.signal encoding.09 04-2012
Cse3461.c.signal encoding.09 04-2012
 
Cimplementation
CimplementationCimplementation
Cimplementation
 
Artificial intelligence lecturenotes.v.1.0.4
Artificial intelligence lecturenotes.v.1.0.4Artificial intelligence lecturenotes.v.1.0.4
Artificial intelligence lecturenotes.v.1.0.4
 
Ai ch2
Ai ch2Ai ch2
Ai ch2
 
Aipapercpt
AipapercptAipapercpt
Aipapercpt
 
01127694
0112769401127694
01127694
 
445 colouring0
445 colouring0445 colouring0
445 colouring0
 
1452 86301000013 m
1452 86301000013 m1452 86301000013 m
1452 86301000013 m
 

Kürzlich hochgeladen

Slack Application Development 101 Slides
Slack Application Development 101 SlidesSlack Application Development 101 Slides
Slack Application Development 101 Slidespraypatel2
 
Enhancing Worker Digital Experience: A Hands-on Workshop for Partners
Enhancing Worker Digital Experience: A Hands-on Workshop for PartnersEnhancing Worker Digital Experience: A Hands-on Workshop for Partners
Enhancing Worker Digital Experience: A Hands-on Workshop for PartnersThousandEyes
 
Swan(sea) Song – personal research during my six years at Swansea ... and bey...
Swan(sea) Song – personal research during my six years at Swansea ... and bey...Swan(sea) Song – personal research during my six years at Swansea ... and bey...
Swan(sea) Song – personal research during my six years at Swansea ... and bey...Alan Dix
 
SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024Scott Keck-Warren
 
Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)Allon Mureinik
 
Human Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsHuman Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsMark Billinghurst
 
Presentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreterPresentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreternaman860154
 
Pigging Solutions in Pet Food Manufacturing
Pigging Solutions in Pet Food ManufacturingPigging Solutions in Pet Food Manufacturing
Pigging Solutions in Pet Food ManufacturingPigging Solutions
 
The Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxThe Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxMalak Abu Hammad
 
Azure Monitor & Application Insight to monitor Infrastructure & Application
Azure Monitor & Application Insight to monitor Infrastructure & ApplicationAzure Monitor & Application Insight to monitor Infrastructure & Application
Azure Monitor & Application Insight to monitor Infrastructure & ApplicationAndikSusilo4
 
Breaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountBreaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountPuma Security, LLC
 
Unblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesUnblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesSinan KOZAK
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerThousandEyes
 
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticsKotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticscarlostorres15106
 
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptxHampshireHUG
 
My Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationMy Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationRidwan Fadjar
 
Benefits Of Flutter Compared To Other Frameworks
Benefits Of Flutter Compared To Other FrameworksBenefits Of Flutter Compared To Other Frameworks
Benefits Of Flutter Compared To Other FrameworksSoftradix Technologies
 
Pigging Solutions Piggable Sweeping Elbows
Pigging Solutions Piggable Sweeping ElbowsPigging Solutions Piggable Sweeping Elbows
Pigging Solutions Piggable Sweeping ElbowsPigging Solutions
 
AI as an Interface for Commercial Buildings
AI as an Interface for Commercial BuildingsAI as an Interface for Commercial Buildings
AI as an Interface for Commercial BuildingsMemoori
 
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking MenDelhi Call girls
 

Kürzlich hochgeladen (20)

Slack Application Development 101 Slides
Slack Application Development 101 SlidesSlack Application Development 101 Slides
Slack Application Development 101 Slides
 
Enhancing Worker Digital Experience: A Hands-on Workshop for Partners
Enhancing Worker Digital Experience: A Hands-on Workshop for PartnersEnhancing Worker Digital Experience: A Hands-on Workshop for Partners
Enhancing Worker Digital Experience: A Hands-on Workshop for Partners
 
Swan(sea) Song – personal research during my six years at Swansea ... and bey...
Swan(sea) Song – personal research during my six years at Swansea ... and bey...Swan(sea) Song – personal research during my six years at Swansea ... and bey...
Swan(sea) Song – personal research during my six years at Swansea ... and bey...
 
SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024
 
Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)
 
Human Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsHuman Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR Systems
 
Presentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreterPresentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreter
 
Pigging Solutions in Pet Food Manufacturing
Pigging Solutions in Pet Food ManufacturingPigging Solutions in Pet Food Manufacturing
Pigging Solutions in Pet Food Manufacturing
 
The Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxThe Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptx
 
Azure Monitor & Application Insight to monitor Infrastructure & Application
Azure Monitor & Application Insight to monitor Infrastructure & ApplicationAzure Monitor & Application Insight to monitor Infrastructure & Application
Azure Monitor & Application Insight to monitor Infrastructure & Application
 
Breaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountBreaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path Mount
 
Unblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesUnblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen Frames
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticsKotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
 
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
 
My Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationMy Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 Presentation
 
Benefits Of Flutter Compared To Other Frameworks
Benefits Of Flutter Compared To Other FrameworksBenefits Of Flutter Compared To Other Frameworks
Benefits Of Flutter Compared To Other Frameworks
 
Pigging Solutions Piggable Sweeping Elbows
Pigging Solutions Piggable Sweeping ElbowsPigging Solutions Piggable Sweeping Elbows
Pigging Solutions Piggable Sweeping Elbows
 
AI as an Interface for Commercial Buildings
AI as an Interface for Commercial BuildingsAI as an Interface for Commercial Buildings
AI as an Interface for Commercial Buildings
 
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
 

Graphs and Algorithms Lecture on Hall's Theorem, Maximum Flows, and Menger's Theorem

  • 1. 2WO08: Graphs and Algorithms Instructor: Nikhil Bansal 1 Lecture 3 Date: 14/2/2012 Scribe: Ellen Dibbits Halls’ Theorem In the second lecture Halls’ Theorem is discussed, this lecture we started with proving it again in another way. Theorem 1 Halls’ Theorem Given a bipartite graph, there is a perfect matching iff |N (s)| ≥ |S| ∀ S ⊆ X, where X is one of the sets of points of the graph. Proof: This proof is with induction. We take n the amount of vertices in X. For n = 1 it is trivial, because we just have one vertex in each part, so we can match those vertices with one edge. And S is empty or contains one point, and in both cases is the amount of neighbors the same. Now we assume that the statement is true for all graphs on k vertices in X. We want to prove that it is also true for k + 1 vertices in X. Take vertex v in X, then there is at least one edge leaving v otherwise there won’t be a perfect matching possible at all. Now we consider two cases. Case 1: Suppose ∀ S ⊆ X − {v} : |N (S)| ≥ |S| + 1. In this case we have slack so we can match v with that one edge and then there is still a perfect matching for the other vertices, because we then have a graph of size k where |N (S)| ≥ |S| holds, and we assumed then the statement is true. The +1 dissapears because we’ve matched v to some vertex and in the worst case that was a neighbor of all other vertices in X as well. So in this case we’ve proven we have a perfect matching. Case 2: So in this case there exists some subset S ⊆ X − v such that |N (S)| = |S|. Pick a minimum cardinality set satisfying this property. By induction and the minimality of S, we know that S can be matched to N (S) Now look at X − S, for this specific S, take a set S ⊆ X − S. Then this S needs to have neighbors outside N (S), otherwise S ∪ S doesn’t suffice the Hall’s condition. Note that it has to have |S | outside N (S). If we then look at the rest, by induction also those points have a matching in Y − N (S). So combining this matchings we have a full matching. This proves the statement. 2 We will now continue with some examples where it is possible to use Halls’ Theorem. Example 1 If you have n teachers and n courses you can see this as a bipartite graph. Every teacher can teach a few courses and you want a teacher assigned to each course. This you can solve with a matching. Example 2 We have a usual deck of 52 cards. Divide this deck into 13 arbitrary piles of 4 cards. Prove that it is always possible to get exactly the set A, 2, 3, ..., J, Q, K by picking one card from each pile. We can transform this problem into a bipartite graph. On one side 13 vertices representing the piles and on the other side 13 vertices, one for A, one for 2, etc. Notice that each vertex has degree four and that we want a perfect matching. Take a set S, a subset of the piles, 4∗|S| edges are leaving of this set, but the receiving vertices have also degree four so |N (S)| ≥ number 4 edges = 4|S| = |S|, 4 otherwise there is a vertex with degree greater than 4. So by Halls’ Theorem a perfect matching exists. 1
  • 2. Note that we can also decompose all cards into 4 sets, such that each set contains exactly one card from each pile, and contains exactly a single A, 2, 3, ..., J, Q, K. This can be seen by after getting that set, remove the edges from the graph and then use the same argument with the degree one less. Example 3 Dancing Problem Consider a group of n boys and n girls where everyone knows exactly k people of the other gender. It is possible to make a dance scheme of k rounds where everyone will dance exactly once with each of the people they know. This can be seen with a matching. Example 4 Scheduling tasks We want to schedule n tasks among m machines. Every task j has size pj and our goal is to minimize the total completion time of all jobs, where the total completion time equals the sum of the completion times. This is useful as it is equivalent to computing the average waiting time. To solve this problem we make the following crucial observation. Consider some machine, if job i is the k-th last job to be assigned to it, then it contributes exactly kpi to total completion time (this is because it contributes pi to its own completion time, and to each of the jobs that are place after it). We will construct a bipartite graph where on one side there are n vertices representing the jobs and on the other side we will mn vertices, where there are n vertices of the type (m, j) for each machine m. The vertex (m, 1) represents the last job on machine m, (m, 2) the second last job on machine m, etc. Note that we do not want a perfect matching in this case because we don’t want to match all mn vertices representing the machines. The edge costs will be determined in the following way, for an edge from j to (m, i) the cost will be pj ∗ i. Then the problem can be solved by finding a minimum cost maximal matching. 2 Maximum Flows You should have seen max-flow in your previous courses, so this will be quick recap. A definition can be found on page 145 of [2]. The capacity of an edge e we will denote with ce , and we want to find a maximum flow from s to t. Max-flow can be used to model various problems. Transforming the matching problem on a bipartite graph into a maximum flow problem can be done with adding a source and a sink. On one side you will add the source, s, and join this with all vertices of one side of the bipartite graph, those edges go from s to the original graph. On the other side you’ll add a sink, t, which will be joined with all vertices on the other side of the bipartite graph, here the edges will go from the original graph to t. All extra edges will have capacity one. All edges from the already existing graph will have capacity infinity, unless stated otherwise. As recap we discussed the maximum flow-minimum cut theorem, which can be found on page 149 of [2]. We discussed a proof of this theorem using residual graphs. To find the maximum flow in a graph there exist efficient algorithms. The naive algorithm that simple augments flow along a path a residual graph can perform very poorly. Two useful ones are the Maximum augmenting path algorithm (O(min(m2 log nlog(C), mn2 log C)) where C is the maximum capacity) and the shortest length path (O(mn2 )). The first one is a simple algorithm, the second is a bit more complex. A nice readable description of these can be found in the notes that are linked on the course webpage. 2
  • 3. There are also other algorithms known with improved running times. We will now start with a new theorem but first we need a definition. Definition 2 Vertex Cover A subset of vertices such that ∀ edges at least one endpoint is in this subset. Theorem 3 Konig-Egervary In a bipartite graph the size of a minimum vertex cover equals the size of the maximum matching. Corollary 4 The maximal independent set1 in a bipartite graph can be found in polynomial time. Proof of [.Konig-Egervary] • For proving that the size of the minimum vertex cover is greater or equal than the size of the maximum matching, we first notice that the size of any vertex cover must be at least the size of any matching. To see this, consider some matching M , clearly at least one endpoint of each edge must lie in every vertex cover (otherwise this will not be covered). Picking M to be a maximum size matching, the claim follows. • To prove the other direction, we know that any flow in the network corresponding to the bipartite graph (mentioned earlier) gives a matching. So the maximum can be no smaller than the maximum flow. Consider the min-cut corresponding to this maximum flow. his cut splits S and T , where S is the part containing s and T the part containing t. We notice that the minimum cut cannot cross edges with capacity infinity going from S to T , because the cut where S = {s} is smaller in that case. By drawing a picture, and noting that no infinite capacity edges are cut, we see that the size of the minimum cut equals |L ∩ T | + |R ∩ S|, where L are the vertices of the bipartite graph connected with s and R the ones connected with t. We also note that that |L ∩ T | + |R ∩ S| is a vertex cover because there are no edges form |L ∩ S| to |R ∩ T | because the cut is not of infinite size. So now we know there is a vertex cover equal to this minimum cut. So the minimum vertex cover can only be smaller that this minimum cut. As the maximum matching is not smaller than the minimum cut, this implies the other direction. Those points together conclude that indeed the size of the minimum vertex cover in a bipartite graph equals the size of the maximal matching in the same graph. 2 3 Menger’s Theorem There are several versions of Menger’s Theorem, we will discuss a few here. But first we will state a few definitions. Definition 5 Paths are said to be edge disjoint if they share no edges. Definition 6 s-t-paths are said to be vertex disjoint if they share no vertices other then s and t. 1 see [1] 3
  • 4. Theorem 7 Menger’s Theorem for directed graphs, edgedisjoint case Consider a directed graph. Then the maximum number of edge disjoint s-t-paths equals the minimum number of edges needed to disconnect s and t. For proving this, the ’≤’ one is quite obvious, because every path has to go through one of those edges. The other side follows by giving each edge a capacity of one and using the max-flow-min-cut theorem. Theorem 8 Menger’s Theorem for directed graphs, vertexdisjoint case Consider a directed graph. Then the maximum number of vertex disjoint s-t-paths equals the minimum number of vertices needed to disconnect s and t. Here also the proof is obvious one way and a bit harder the other way. Since, min-cut deals with edges, while we want a statement about vertices, we transform a vertex into an edge as follows. Consider vertex v, and replace it by two vertices v1 and v2 connected by an edge from v1 to v2 of capacity 1. All incoming edges will now go into v1 and all outgoing edges will now leave v2 (so an original edge (v, w) now becomes (v2 , w1 )). The original edges have capacity ∞. You can then again see it as a max-flow problem, where the size of the maximal flow equals the number of vertex disjoint paths and size of the minimum cut. Several proofs of Menger’s Theorem can be found in Chapter 3 of [2]. References [1] http://en.wikipedia.org/wiki/Independent set [2] Reinhard Diestel. Graph Theory, fourth electronic edition, 2010. 4