0% found this document useful (0 votes)
18 views11 pages

Edmond Blossoms Algorithm

The document discusses concepts related to graph matching including maximal matching, maximum matching, perfect matching, alternating paths, augmenting paths, blossoms, and Edmond's blossom algorithm. Maximal matching is a matching that is not contained within any other matching. Maximum matching has greater cardinality than any other matching. Perfect matching means every vertex has degree 1. Augmenting paths allow improving a matching. Blossoms refer to odd cycles formed in a matching graph. Edmond's blossom algorithm finds augmenting paths using backtracking and blossom contraction.

Uploaded by

saswatashu
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
18 views11 pages

Edmond Blossoms Algorithm

The document discusses concepts related to graph matching including maximal matching, maximum matching, perfect matching, alternating paths, augmenting paths, blossoms, and Edmond's blossom algorithm. Maximal matching is a matching that is not contained within any other matching. Maximum matching has greater cardinality than any other matching. Perfect matching means every vertex has degree 1. Augmenting paths allow improving a matching. Blossoms refer to odd cycles formed in a matching graph. Edmond's blossom algorithm finds augmenting paths using backtracking and blossom contraction.

Uploaded by

saswatashu
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 11

s45b are matchung pours

Td are ngtched vettces


MAXIMAL MATCHING

Mis said to be maximal matching if it is not contained in any other matching of G


properly
The cut in Min FIGURE-1 is an example of maximal matching
MAXIMUM MATCHING

Amaximal,matching is said to be maximum matching ßf graph G with greater


cardinality, FIGURE-2 shows an example of maximum matching.
malchg

maxenal

FIGURE-2
<1, 2>,<3,4>, <6,7),<5,8> is amaximum
matching
PERFECT MATCHING

Amatching is said to be perfect if the degree of every vertex in M is 1


ALTERNATING PATH
Let G be a graph and M bea matching in G. Then a path vi, V2, V3, V4, .Vk
is said to be alternating path if successive edges of the path alternatively belong to M
and E-M

AUGMENTING PATH
An alternating path is said to be an augmenting path if the first vertex and the
last vertex in it are
unmatched.
CHARACTERIZATIONOF MAXIMAL MATCHING
THEOREM
ITGis a graph and Misa matching in G. Then Mis maximum matching iff (G,M) has no
augmenting path.

Augmenting path: 7 -> 3-> 4 -> 8


Switching between matching edges and unmatching edge in the augmenting path we get a
better matching

FIGURE-3

ODD ALTERNATING CYCLE

Let c= Vo, V1, V2 ..V2k be an odd cycle where < Vo, V e E-M and <
V1, V2 > e M.. <vak-1, V2K> ¬ M, < Vo, V2k > ¬ E- M.. Then c is called an odd
alternating cycle.
TRANSFORMA T/O N
Let G=(V, E) be a graph and M be a matching in G. Let Ube the set of
unmatched vertices.Then H=G/U is a graph obtained from Gafter applying the
following transformation:

Combine the vertices in Uinto a single vertex and modify the edges accordingly.
RESULT:Every augmented path in G(GM) is transformed into an odd alternating
cycle in (G/U, M)
between vertices and edges in (G,M) and (G/U,M)
function say oto map
Here, we use a
such that

o(u) s for all u in U


in V-U
> o(v)=v for all v for all v in V-U
> olu,v)-(s,v) for all u in Uand
for all vl,v2 in V-U
> o(vl,v2) = (v1,v2) all ul and u2 in U
undefined for
º o(ul,u2) =
there is an inverse edge o'(e) in G
So for every edgee in H

(G M) H=(6/UM)
Here,U={1, 5)
FIGURE-4

ALTERNATING BFS TREE

such that edges


It istree computed with respect to a graph G(V,E) and a matching M
belong to
from even level to odd level belong to E-M and edges from odd to even level
M. The root of the tree is at level O and corresponds to the
start node.

ALGORITHM TO COMPUTE ALTERNATING BFS TREE(V,Ms)

1. Uo={s}: level[s]=0
2. for each ve V-{s) do
a. level[v]=o
3. i=1

1,2
5. while (U ) do
a. U, = 0
b. fòr each ve U1 do
i. for each w e Adi[v] do
1. if (i is odd) then
a. if <v,w> eE-M and level[w]=oo then
i. U,= U, +{w}
ii. level[w]=i
ii. Er= ErU (<v,w).
2. else
a. if <v,w> e Mand level[w]=oo then
i. U,= U, +{w)
i. level[w]=i
ii. Er= ErU{v,w»}
6. U = V- Er

NON-TREE EDGES = AUBUCU Eu


ALTERNATING BFS TREE
FIGURE-5
types
When the above algorithm is run on a graph with a given matching Mthree other
of edges are generated in addition to the tree edges.
or to
Type-A: Non-matching edges from a vertex in odd level to a vertex in Uo
some vertices in lower levels

Type-B: Non-matching edges between two vertices at agiven even level or


matching edges between two vertices at an odd level. Presence of cycles can be
detected by B-edges.

Type-C: Non-matching edges from a vertex at even level to the immediate next
level but- mot e

CLAIM
In Hevery alternating odd cycle must pass through at least one type -B edge.
PROOF
Let Xbe an alternating odd cycle in H which contains no B-type edge
X: pieip2e2. where p is a piece comprising of tree edges and type-C edges and e is
atype-A edge
But a tYpe-Aedge can either lead to a vertex in set Uo or to some vertex at lower level
but never back to s

Hence starting from s it is impossible for Xto reach back s


This implies that the cycle necessarily goes through some type-B edge.

OBSERVATIONS:
An augmenting path Pin G=> Ø(P) an alternating odd cycle in H
O.
U1

-O
V2 V2 V3

Let C be an odd alternating cycle in H. Then Ø(C)be the image of C in G.


An augmenting path in Gif ucorrosponds to two different nodes

An odd augmenting cycle inG if ucorrosponds to asingle node


THEOREM
If Cis an alternating odd cycle in G, then Ghas an augmenting path if and
only if G/C
has an augmenting path.
PROOF
> The outgoing edges from vertices (except the unmatched vertex )in the cycle
areunmatched
The vertices in the cycle are combined into a new vertex say x
> Let P be an augmenting path in G
Then x can either reside outside the path p or if it is on the
path it exists as an
end vertex.
BERGE'S THEOREM:
Amatching M in G has maximum size iff G
has no augmented path
In a bipartide graph, an augmented path can be
each vertex only once.
quickly searched as we explore from
An M-alternating path from ucan reach a
vertex x in the same set / partitionas u
along a saturated edge.

V
Let Mbe a matching in a graph Gwith cycles.
Let u be an unsaturated vertex. Then there may be two paths from uto a vertexx in G
as shownin the example below
X

b C

There is two path from u to x: (i) u - V-a -x (ü) u- v-a-b - c


-d -x

FLOWER
It is aunion of two
alternating paths from uthat reacha vertex on steps of
parity. opposite

b C

FLOWER
STEM
The stem of the f lower is the
maximal common initial path of
non-negative even length
V

STEM
BLOSSOM
The blossom of the flower is the
odd cycle obtained by
deleting the stem.
X

amd veorlaces eac ha d oleng


sa lus a d cdg
b C T conlans blostond
BLOSSOM

EDMOND BLOSSOMS ALGORITHM


INPUT: Agraph G, a matching Min G, and an M-unsaturated vertex u
where it is reached and contracting the blossoms when found.
Two setsS and T are maintained.
S consistsof u and vertices reached along saturated edges
Reaching an unsaturated vertex yields an augmentation

INITIALIZATION
S={u), T=Ø
ITERATION
a. If Shas no unmarked vertex then stop
else select an unmarked vertex ve S
b. for each vertex yinAdjacent (v) do
i. If y is unsaturated by Mthen trace back from y[expand blossom
as needed to report an m-augmenting u,y path]
ii. if ybelongs to s,then a blossom has been found
1. suspend exploration of v,
2. Contract the blossom replacing it's vertices in S and T by a
single new vertex in S
3. continue the search from this new vertex in the smaller
graph(recursion)
iii. else
1. y is matched with some w by M,so include yin T and win S
c. After exploring all neighbours of Vmark v and iterate
EXAMPLE

Initially,S-(u} and T=)


The algorithm starts by exploring the unsaturated edges from u reaching a and b.
Since a and bare saturated, paths are extended along <a,c> and <b,d.
Now cand dhave unsaturated edges from them, so they are included in S. Now,5=(ue,d)
Next exploration from cstarts. The algorithm reaches e and f along unsaturated edges
<c,e> and <c,f>. Now <e,f> is in M. Ablossom (c,e,f} is discovered
This blossom is contracted to a newvertex Cin the next graph.

Now,exploration starts at Calong two unsaturated edges from C <c,g> and


<C,d>
Now, gis saturated by the edge <g.h so h is included in S. Now
Next the other edge <C,d> istraversed and the S={u, C, d, h}
S. This indicates that a blossom has algorithm reaches d, avertex in
been found. This blossom has been
by the union of two paths - Qu- b- d and (ii) u- formed
This blossom (u,b,d,c,a) is a-C-d
contracted to a new vertex Uresulting in the
following graph
U (U

Now, S-(U)
Now, hcannot be explored further and exploration from U leads toan
unsaturated vertex x.
Generate the u,x path expanding each blossom encountered in the
process.Thus the augmented patth is given by the following graph.

f
C

b d
X

After flipping betweenthe matched and


unmatched edges a maximum matching is
obtained
f
a C

b d
X

You might also like