SlideShare une entreprise Scribd logo
1  sur  43
Télécharger pour lire hors ligne
The Hungarian algorithm
                                                                                                                    1    2   3       4   5
We will start today’s lecture by running through an example. Consider the
graph below. We will compare the results of GREEDY-MATCHING1 with
those of HUNGARIAN-MATCHING.
                        1     2     3      4    5




                              10      9        8       7       6
                                                                                                                    10   9   8       7   6
You are warmly invited to try this at home with paper and pencil first.




                                                1                                                                                3




                  GREEDY-MATCHING1 (G)
                  M ←∅
                                                                                                                    1    2   3       4   5
                  while E(G) = ∅
                       pick the lexicographically first e ∈ E(G)
                (*)
                       M ← M ∪ {e}
                       remove e and all
                             edges adjacent to e
                             from E(G)
                  return M

Assume the edges in the given graph are ordered pairs (i.e. put a
top-down direction on them).
                                                                                                                    10   9   8       7   6
E(G) = {(1, 6), (1, 9), (1, 10), (2, 7), (2, 8), (2, 9), (2, 10), (3, 7), (3, 8), (4, 6), (4, 7), (4, 8), (5, 6)}



                                                2                                                                                4
1    2   3       4   5   1    2   3       4   5




10   9   8       7   6   10   9   8       7   6

             5                        7




1    2   3       4   5   1    2   3       4   5




10   9   8       7   6   10   9   8       7   6

             6                        8
U1
        1           2            3           4            5                   1    2   3    4   5




                                                                         U2
        10          9            8           7            6                   10   9   8    7   6

                                     9                                                 11




Hungarian algorithm
The approach given below seems to have first appeared in the work of

                                                                                                    U1
K¨ nig (1916, 1931, 1936) and Egerv´ ry (1931) who reduced the problem
 o                                 a
                                                                              1    2   3    4   5
with general non-negative weights on the edges to the unweighted case.

            HUNGARIAN-MATCHING (G)
               let M be any matching in G
               repeat
                     form a maximal forest F having
                          properties 1. and 2.
                                                                         U2
                     if there is an edge joining V (F ) ∩ V1 to
                               a vertex in U2
                          M ← Augment(M, F )
                                                                              10   9   8    7   6
                     else return M
               until TRUE


                                   10                                                  12
Maximum matching in general graphs
                           U1
     1    2   3    4   5        We presented an algorithm for finding a maximum matching in a bipartite
                                graph.
                                From a mathematical point of view, this algorithm is essentially no more
                                involved than the proof of K¨ nig’s equality.
                                                            o
                                For non-bipartite graphs the situation is quite different. Known poly-time
                                algorithms for finding a maximum matching in a general graph are among

U2                              the most involved combinatorial algorithms.
                                Most of them are based on augmentation along alternating paths. But
                                important new ideas are needed to turn these tricks into polynomial time
     10   9   8    7   6        algorithms.



              13                                                    15




                                Edmonds’ algorithm
                                The first polynomial time matching algorithm for general graphs was
     1    2   3    4   5        constructed by Edmonds.
                                In this algorithm the key idea of “shrinking” certain odd cycles was
                                introduced.
                                Up to the present time most matching algorithms – certainly the most
                                successful ones – are based (implicitly or explicitly) on this idea.
                                We begin with a lemma which will enable us to reduce the size of the
                                graph under consideration in many cases.
                                The lemma help us understand the crucial step of “cycle shrinking” and
     10   9   8    7   6        lends us confidence that we are not losing necessary information when
                                carrying out such shrinking.



              14                                                    16
Algorithm description
                                                                            We now turn to an informal description of Edmonds Matching Algorithm.

                                                                            We are given a graph G. Let M be a matching in G.
Shrinking Lemma. Let G be a graph and M a matching in G. Let Z be a
                                                                            If M is perfect we are done!
cycle of length 2k + 1 which contains k lines of M and is vertex-disjoint
                                                                            Otherwise let S be the set of vertices that are not covered by M .
from the rest of M . Let G be the graph obtained from G by shrinking Z
to a single vertex. Then M = M  E(Z) is a maximum matching in G            Construct (as in the bipartite case) a forest F such that every connected
if and only if M is a maximum matching in G.                                component of F contains exactly one vertexa of S, every point of S
                                                                            belongs to exactly one component of F , and every edge of F which is at
                                                                            an odd distance from a point in S belongs to M .
                                                                              a It   may be defined as the root of the component under consideration.




                                   17                                                                                     19




Proof
(|M | = ν(G ) ⇒ |M | = ν(G)) Assume that |M | < ν(G). Then there
exists an augmenting path P relative to M . Two cases arise:
P vertex-disjoint from Z In such case P is also an M -augmenting
    path, and hence |M | < ν(G ). Contradiction!

P does intersect Z W.l.o.g. there must be an endpoint, say x, of P that
   is not in Z. Let z be the first vertex in the path P which also belongs
   to Z. The path Q from x to z is mapped onto an M -augmenting path
   when Z is contracted. Hence |M | < ν(G ). Contradiction!

(|M | = ν(G) ⇒ |M | = ν(G )) This time assume M is not maximum.
Take a maximum matching N in G . Then expand Z and define a
matching N in G. Then |N | = |N | + k > |M | + k = |M |, i.e. M is not
a maximum matching. Contradiction!


                                   18
                                                                                                                        19-1
“Adjacent” outer vertices in different components


Properties of F
Every vertex of F which is at an odd distance from S has degree two in F .
Such vertices will be called inner vertices, while the remaining vertices in
F will be called outer vertices (in particular all vertices in S are outer).
Such a forest is called M -alternating forest.
Clearly, the (trivial) forest with vertex set S and no line is an
M -alternating forest (although not a very useful one!).
                                                                               If F has two adjacent outer vertices x and y belonging to different
                                                                               components of F , then the roots of these two components of F are
                                                                               connected by an M -augmenting path. We can obtain a larger matching!
                                                                               And after this we restart the process by constructing a new (smaller) F .

                                      20                                                                           22




                                                                               “Adjacent” outer vertices in the same component

                                                                                                                                                       Alternating path
                                                                                                                                                       after switching

“External” outer vertices
Next we consider the neighbours of outer vertices. If we find an outer
vertex x adjacent to a vertex y not in F , then we can enlarge F by adding
the edges {x, y} and {y, z} ∈ M .
                                                                                x
                                                                                       y


                                                                                                                                    Blossom before shrinking




                                      21                                                                           23
If F has two outer vertices x and y in the same connected component
                                                                                         In summary we can always do one of the following:
which are adjacent in G, then let C be the cycle formed by the line {x, y}
and the path from x to y in F . Let P denote the (unique) patha in F                       • enlarge F ,
connecting C to a root of F . Clearly P is an M -alternating path, so if we
                                                                                           • enlarge M ,
“switch” on P , we obtain another matching M1 of the same size as M .
                                                                                           • decrease |V (G)|, or
But M1 and C satisfy the conditions of the shrinking Lemma, and so if
we shrink C to a single point to obtain a new graph G , we have reduced                    • stop with a maximum matching!
the task of finding a matching larger than M in G to the task of finding a
                                                                                         Thus it is clear that the algorithm terminates in polynomial time with a
matching larger than M1  E(C) in the smaller graph G .
                                                                                         maximum matching in G.
         allow C to pass through the root, in which case P consists of a single point.
  a We




                                              24                                                                             26




Finally, if every outer vertex has only inner vertices as neighbours, then
we claim that the matching M is already maximum. For suppose that F
contains m inner vertices and n outer vertices. Clearly |S| = n − m.
Furthermore if we delete all the inner vertices of F from G, the remaining
graph will contain all the outer vertices of F as isolated points. Hence
def(G) ≥ n − m = |S|. But M misses exactly |S| vertices, and so it must
be a maximum matching.




                                              25
Maritaferreira Artwork2007
Maritaferreira Artwork2007
Maritaferreira Artwork2007
Maritaferreira Artwork2007
Maritaferreira Artwork2007
Maritaferreira Artwork2007
Maritaferreira Artwork2007
Maritaferreira Artwork2007
Maritaferreira Artwork2007
Maritaferreira Artwork2007
Maritaferreira Artwork2007
Maritaferreira Artwork2007
Maritaferreira Artwork2007
Maritaferreira Artwork2007
Maritaferreira Artwork2007
Maritaferreira Artwork2007
Maritaferreira Artwork2007
Maritaferreira Artwork2007
Maritaferreira Artwork2007
Maritaferreira Artwork2007
Maritaferreira Artwork2007
Maritaferreira Artwork2007
Maritaferreira Artwork2007
Maritaferreira Artwork2007
Maritaferreira Artwork2007
Maritaferreira Artwork2007
Maritaferreira Artwork2007
Maritaferreira Artwork2007
Maritaferreira Artwork2007
Maritaferreira Artwork2007
Maritaferreira Artwork2007
Maritaferreira Artwork2007
Maritaferreira Artwork2007
Maritaferreira Artwork2007
Maritaferreira Artwork2007
Maritaferreira Artwork2007

Contenu connexe

Tendances

On Some Continuous and Irresolute Maps In Ideal Topological Spaces
On Some Continuous and Irresolute Maps In Ideal Topological SpacesOn Some Continuous and Irresolute Maps In Ideal Topological Spaces
On Some Continuous and Irresolute Maps In Ideal Topological Spacesiosrjce
 
11.characterization of connected vertex magic total labeling graphs in topolo...
11.characterization of connected vertex magic total labeling graphs in topolo...11.characterization of connected vertex magic total labeling graphs in topolo...
11.characterization of connected vertex magic total labeling graphs in topolo...Alexander Decker
 
4. [22 25]characterization of connected vertex magic total labeling graphs in...
4. [22 25]characterization of connected vertex magic total labeling graphs in...4. [22 25]characterization of connected vertex magic total labeling graphs in...
4. [22 25]characterization of connected vertex magic total labeling graphs in...Alexander Decker
 
BGW2012 - Linear balanceable and subcubic balanceable graphs
BGW2012 - Linear balanceable and subcubic balanceable graphsBGW2012 - Linear balanceable and subcubic balanceable graphs
BGW2012 - Linear balanceable and subcubic balanceable graphsttrunck
 
Stability criterion of periodic oscillations in a (2)
Stability criterion of periodic oscillations in a (2)Stability criterion of periodic oscillations in a (2)
Stability criterion of periodic oscillations in a (2)Alexander Decker
 
Application H-matrices for solving PDEs with multi-scale coefficients, jumpin...
Application H-matrices for solving PDEs with multi-scale coefficients, jumpin...Application H-matrices for solving PDEs with multi-scale coefficients, jumpin...
Application H-matrices for solving PDEs with multi-scale coefficients, jumpin...Alexander Litvinenko
 
On Embedding and NP-Complete Problems of Equitable Labelings
On Embedding and NP-Complete Problems of Equitable LabelingsOn Embedding and NP-Complete Problems of Equitable Labelings
On Embedding and NP-Complete Problems of Equitable LabelingsIOSR Journals
 
Paper id 71201961
Paper id 71201961Paper id 71201961
Paper id 71201961IJRAT
 
SUPER MAGIC CORONATIONS OF GRAPHS
SUPER MAGIC CORONATIONS OF GRAPHS SUPER MAGIC CORONATIONS OF GRAPHS
SUPER MAGIC CORONATIONS OF GRAPHS IAEME Publication
 
International journal of applied sciences and innovation vol 2015 - no 2 - ...
International journal of applied sciences and innovation   vol 2015 - no 2 - ...International journal of applied sciences and innovation   vol 2015 - no 2 - ...
International journal of applied sciences and innovation vol 2015 - no 2 - ...sophiabelthome
 
Strong (Weak) Triple Connected Domination Number of a Fuzzy Graph
Strong (Weak) Triple Connected Domination Number of a Fuzzy GraphStrong (Weak) Triple Connected Domination Number of a Fuzzy Graph
Strong (Weak) Triple Connected Domination Number of a Fuzzy Graphijceronline
 
Ba32759764
Ba32759764Ba32759764
Ba32759764IJMER
 
IRJET- Independent Middle Domination Number in Jump Graph
IRJET- Independent Middle Domination Number in Jump GraphIRJET- Independent Middle Domination Number in Jump Graph
IRJET- Independent Middle Domination Number in Jump GraphIRJET Journal
 
A common fixed point of integral type contraction in generalized metric spacess
A  common fixed point of integral type contraction in generalized metric spacessA  common fixed point of integral type contraction in generalized metric spacess
A common fixed point of integral type contraction in generalized metric spacessAlexander Decker
 
Darmon Points in mixed signature
Darmon Points in mixed signatureDarmon Points in mixed signature
Darmon Points in mixed signaturemmasdeu
 

Tendances (18)

On Some Continuous and Irresolute Maps In Ideal Topological Spaces
On Some Continuous and Irresolute Maps In Ideal Topological SpacesOn Some Continuous and Irresolute Maps In Ideal Topological Spaces
On Some Continuous and Irresolute Maps In Ideal Topological Spaces
 
11.characterization of connected vertex magic total labeling graphs in topolo...
11.characterization of connected vertex magic total labeling graphs in topolo...11.characterization of connected vertex magic total labeling graphs in topolo...
11.characterization of connected vertex magic total labeling graphs in topolo...
 
4. [22 25]characterization of connected vertex magic total labeling graphs in...
4. [22 25]characterization of connected vertex magic total labeling graphs in...4. [22 25]characterization of connected vertex magic total labeling graphs in...
4. [22 25]characterization of connected vertex magic total labeling graphs in...
 
BGW2012 - Linear balanceable and subcubic balanceable graphs
BGW2012 - Linear balanceable and subcubic balanceable graphsBGW2012 - Linear balanceable and subcubic balanceable graphs
BGW2012 - Linear balanceable and subcubic balanceable graphs
 
Stability criterion of periodic oscillations in a (2)
Stability criterion of periodic oscillations in a (2)Stability criterion of periodic oscillations in a (2)
Stability criterion of periodic oscillations in a (2)
 
Application H-matrices for solving PDEs with multi-scale coefficients, jumpin...
Application H-matrices for solving PDEs with multi-scale coefficients, jumpin...Application H-matrices for solving PDEs with multi-scale coefficients, jumpin...
Application H-matrices for solving PDEs with multi-scale coefficients, jumpin...
 
On Embedding and NP-Complete Problems of Equitable Labelings
On Embedding and NP-Complete Problems of Equitable LabelingsOn Embedding and NP-Complete Problems of Equitable Labelings
On Embedding and NP-Complete Problems of Equitable Labelings
 
Digital text
Digital  textDigital  text
Digital text
 
Paper id 71201961
Paper id 71201961Paper id 71201961
Paper id 71201961
 
SUPER MAGIC CORONATIONS OF GRAPHS
SUPER MAGIC CORONATIONS OF GRAPHS SUPER MAGIC CORONATIONS OF GRAPHS
SUPER MAGIC CORONATIONS OF GRAPHS
 
Wythoff construction and l1-embedding
Wythoff construction and l1-embeddingWythoff construction and l1-embedding
Wythoff construction and l1-embedding
 
International journal of applied sciences and innovation vol 2015 - no 2 - ...
International journal of applied sciences and innovation   vol 2015 - no 2 - ...International journal of applied sciences and innovation   vol 2015 - no 2 - ...
International journal of applied sciences and innovation vol 2015 - no 2 - ...
 
Strong (Weak) Triple Connected Domination Number of a Fuzzy Graph
Strong (Weak) Triple Connected Domination Number of a Fuzzy GraphStrong (Weak) Triple Connected Domination Number of a Fuzzy Graph
Strong (Weak) Triple Connected Domination Number of a Fuzzy Graph
 
Ba32759764
Ba32759764Ba32759764
Ba32759764
 
IRJET- Independent Middle Domination Number in Jump Graph
IRJET- Independent Middle Domination Number in Jump GraphIRJET- Independent Middle Domination Number in Jump Graph
IRJET- Independent Middle Domination Number in Jump Graph
 
A common fixed point of integral type contraction in generalized metric spacess
A  common fixed point of integral type contraction in generalized metric spacessA  common fixed point of integral type contraction in generalized metric spacess
A common fixed point of integral type contraction in generalized metric spacess
 
Darmon Points in mixed signature
Darmon Points in mixed signatureDarmon Points in mixed signature
Darmon Points in mixed signature
 
C027011018
C027011018C027011018
C027011018
 

Similaire à Maritaferreira Artwork2007

AlgoPerm2012 - 04 Christophe Paul
AlgoPerm2012 - 04 Christophe PaulAlgoPerm2012 - 04 Christophe Paul
AlgoPerm2012 - 04 Christophe PaulAlgoPerm 2012
 
Graph theory 1
Graph theory 1Graph theory 1
Graph theory 1Tech_MX
 
Skiena algorithm 2007 lecture13 minimum spanning trees
Skiena algorithm 2007 lecture13 minimum spanning treesSkiena algorithm 2007 lecture13 minimum spanning trees
Skiena algorithm 2007 lecture13 minimum spanning treeszukun
 
New Classes of Odd Graceful Graphs - M. E. Abdel-Aal
New Classes of Odd Graceful Graphs - M. E. Abdel-AalNew Classes of Odd Graceful Graphs - M. E. Abdel-Aal
New Classes of Odd Graceful Graphs - M. E. Abdel-AalGiselleginaGloria
 
A generalized bernoulli sub-ODE Method and Its applications for nonlinear evo...
A generalized bernoulli sub-ODE Method and Its applications for nonlinear evo...A generalized bernoulli sub-ODE Method and Its applications for nonlinear evo...
A generalized bernoulli sub-ODE Method and Its applications for nonlinear evo...inventy
 

Similaire à Maritaferreira Artwork2007 (6)

Lingerie Shoot
Lingerie ShootLingerie Shoot
Lingerie Shoot
 
AlgoPerm2012 - 04 Christophe Paul
AlgoPerm2012 - 04 Christophe PaulAlgoPerm2012 - 04 Christophe Paul
AlgoPerm2012 - 04 Christophe Paul
 
Graph theory 1
Graph theory 1Graph theory 1
Graph theory 1
 
Skiena algorithm 2007 lecture13 minimum spanning trees
Skiena algorithm 2007 lecture13 minimum spanning treesSkiena algorithm 2007 lecture13 minimum spanning trees
Skiena algorithm 2007 lecture13 minimum spanning trees
 
New Classes of Odd Graceful Graphs - M. E. Abdel-Aal
New Classes of Odd Graceful Graphs - M. E. Abdel-AalNew Classes of Odd Graceful Graphs - M. E. Abdel-Aal
New Classes of Odd Graceful Graphs - M. E. Abdel-Aal
 
A generalized bernoulli sub-ODE Method and Its applications for nonlinear evo...
A generalized bernoulli sub-ODE Method and Its applications for nonlinear evo...A generalized bernoulli sub-ODE Method and Its applications for nonlinear evo...
A generalized bernoulli sub-ODE Method and Its applications for nonlinear evo...
 

Dernier

Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024The Digital Insurer
 
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...apidays
 
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptxEIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptxEarley Information Science
 
Advantages of Hiring UIUX Design Service Providers for Your Business
Advantages of Hiring UIUX Design Service Providers for Your BusinessAdvantages of Hiring UIUX Design Service Providers for Your Business
Advantages of Hiring UIUX Design Service Providers for Your BusinessPixlogix Infotech
 
Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Enterprise Knowledge
 
[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdfhans926745
 
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsEnterprise Knowledge
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfsudhanshuwaghmare1
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processorsdebabhi2
 
Slack Application Development 101 Slides
Slack Application Development 101 SlidesSlack Application Development 101 Slides
Slack Application Development 101 Slidespraypatel2
 
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc
 
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
 
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024The Digital Insurer
 
Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsJoaquim Jorge
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityPrincipled Technologies
 
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...Neo4j
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationMichael W. Hawkins
 
A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024Results
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationRadu Cotescu
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Drew Madelung
 

Dernier (20)

Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024
 
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
 
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptxEIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
 
Advantages of Hiring UIUX Design Service Providers for Your Business
Advantages of Hiring UIUX Design Service Providers for Your BusinessAdvantages of Hiring UIUX Design Service Providers for Your Business
Advantages of Hiring UIUX Design Service Providers for Your Business
 
Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...
 
[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf
 
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI Solutions
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdf
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processors
 
Slack Application Development 101 Slides
Slack Application Development 101 SlidesSlack Application Development 101 Slides
Slack Application Development 101 Slides
 
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
 
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
 
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
 
Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and Myths
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivity
 
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day Presentation
 
A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organization
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
 

Maritaferreira Artwork2007

  • 1. The Hungarian algorithm 1 2 3 4 5 We will start today’s lecture by running through an example. Consider the graph below. We will compare the results of GREEDY-MATCHING1 with those of HUNGARIAN-MATCHING. 1 2 3 4 5 10 9 8 7 6 10 9 8 7 6 You are warmly invited to try this at home with paper and pencil first. 1 3 GREEDY-MATCHING1 (G) M ←∅ 1 2 3 4 5 while E(G) = ∅ pick the lexicographically first e ∈ E(G) (*) M ← M ∪ {e} remove e and all edges adjacent to e from E(G) return M Assume the edges in the given graph are ordered pairs (i.e. put a top-down direction on them). 10 9 8 7 6 E(G) = {(1, 6), (1, 9), (1, 10), (2, 7), (2, 8), (2, 9), (2, 10), (3, 7), (3, 8), (4, 6), (4, 7), (4, 8), (5, 6)} 2 4
  • 2. 1 2 3 4 5 1 2 3 4 5 10 9 8 7 6 10 9 8 7 6 5 7 1 2 3 4 5 1 2 3 4 5 10 9 8 7 6 10 9 8 7 6 6 8
  • 3. U1 1 2 3 4 5 1 2 3 4 5 U2 10 9 8 7 6 10 9 8 7 6 9 11 Hungarian algorithm The approach given below seems to have first appeared in the work of U1 K¨ nig (1916, 1931, 1936) and Egerv´ ry (1931) who reduced the problem o a 1 2 3 4 5 with general non-negative weights on the edges to the unweighted case. HUNGARIAN-MATCHING (G) let M be any matching in G repeat form a maximal forest F having properties 1. and 2. U2 if there is an edge joining V (F ) ∩ V1 to a vertex in U2 M ← Augment(M, F ) 10 9 8 7 6 else return M until TRUE 10 12
  • 4. Maximum matching in general graphs U1 1 2 3 4 5 We presented an algorithm for finding a maximum matching in a bipartite graph. From a mathematical point of view, this algorithm is essentially no more involved than the proof of K¨ nig’s equality. o For non-bipartite graphs the situation is quite different. Known poly-time algorithms for finding a maximum matching in a general graph are among U2 the most involved combinatorial algorithms. Most of them are based on augmentation along alternating paths. But important new ideas are needed to turn these tricks into polynomial time 10 9 8 7 6 algorithms. 13 15 Edmonds’ algorithm The first polynomial time matching algorithm for general graphs was 1 2 3 4 5 constructed by Edmonds. In this algorithm the key idea of “shrinking” certain odd cycles was introduced. Up to the present time most matching algorithms – certainly the most successful ones – are based (implicitly or explicitly) on this idea. We begin with a lemma which will enable us to reduce the size of the graph under consideration in many cases. The lemma help us understand the crucial step of “cycle shrinking” and 10 9 8 7 6 lends us confidence that we are not losing necessary information when carrying out such shrinking. 14 16
  • 5. Algorithm description We now turn to an informal description of Edmonds Matching Algorithm. We are given a graph G. Let M be a matching in G. Shrinking Lemma. Let G be a graph and M a matching in G. Let Z be a If M is perfect we are done! cycle of length 2k + 1 which contains k lines of M and is vertex-disjoint Otherwise let S be the set of vertices that are not covered by M . from the rest of M . Let G be the graph obtained from G by shrinking Z to a single vertex. Then M = M E(Z) is a maximum matching in G Construct (as in the bipartite case) a forest F such that every connected if and only if M is a maximum matching in G. component of F contains exactly one vertexa of S, every point of S belongs to exactly one component of F , and every edge of F which is at an odd distance from a point in S belongs to M . a It may be defined as the root of the component under consideration. 17 19 Proof (|M | = ν(G ) ⇒ |M | = ν(G)) Assume that |M | < ν(G). Then there exists an augmenting path P relative to M . Two cases arise: P vertex-disjoint from Z In such case P is also an M -augmenting path, and hence |M | < ν(G ). Contradiction! P does intersect Z W.l.o.g. there must be an endpoint, say x, of P that is not in Z. Let z be the first vertex in the path P which also belongs to Z. The path Q from x to z is mapped onto an M -augmenting path when Z is contracted. Hence |M | < ν(G ). Contradiction! (|M | = ν(G) ⇒ |M | = ν(G )) This time assume M is not maximum. Take a maximum matching N in G . Then expand Z and define a matching N in G. Then |N | = |N | + k > |M | + k = |M |, i.e. M is not a maximum matching. Contradiction! 18 19-1
  • 6. “Adjacent” outer vertices in different components Properties of F Every vertex of F which is at an odd distance from S has degree two in F . Such vertices will be called inner vertices, while the remaining vertices in F will be called outer vertices (in particular all vertices in S are outer). Such a forest is called M -alternating forest. Clearly, the (trivial) forest with vertex set S and no line is an M -alternating forest (although not a very useful one!). If F has two adjacent outer vertices x and y belonging to different components of F , then the roots of these two components of F are connected by an M -augmenting path. We can obtain a larger matching! And after this we restart the process by constructing a new (smaller) F . 20 22 “Adjacent” outer vertices in the same component Alternating path after switching “External” outer vertices Next we consider the neighbours of outer vertices. If we find an outer vertex x adjacent to a vertex y not in F , then we can enlarge F by adding the edges {x, y} and {y, z} ∈ M . x y Blossom before shrinking 21 23
  • 7. If F has two outer vertices x and y in the same connected component In summary we can always do one of the following: which are adjacent in G, then let C be the cycle formed by the line {x, y} and the path from x to y in F . Let P denote the (unique) patha in F • enlarge F , connecting C to a root of F . Clearly P is an M -alternating path, so if we • enlarge M , “switch” on P , we obtain another matching M1 of the same size as M . • decrease |V (G)|, or But M1 and C satisfy the conditions of the shrinking Lemma, and so if we shrink C to a single point to obtain a new graph G , we have reduced • stop with a maximum matching! the task of finding a matching larger than M in G to the task of finding a Thus it is clear that the algorithm terminates in polynomial time with a matching larger than M1 E(C) in the smaller graph G . maximum matching in G. allow C to pass through the root, in which case P consists of a single point. a We 24 26 Finally, if every outer vertex has only inner vertices as neighbours, then we claim that the matching M is already maximum. For suppose that F contains m inner vertices and n outer vertices. Clearly |S| = n − m. Furthermore if we delete all the inner vertices of F from G, the remaining graph will contain all the outer vertices of F as isolated points. Hence def(G) ≥ n − m = |S|. But M misses exactly |S| vertices, and so it must be a maximum matching. 25