1 Introduction
Dynamic graph algorithms is a vibrant area of reasearch. An update operation on the graph is an insertion or a deletion of an edge or a vertex. The goal of a dynamic graph algorithm is to efficiently modify the solution after an update operation. A dynamic graph algorithm is said to be fully dynamic if the update operation includes both insertion or deletion of edges (or vertices). Dynamic algorithms for maintaining a maximal matching in a graph are wellstudied and still present many research challenges. In particular, the approximate maximum cardinality matching (approximate MCM) problem is a very interesting question in the dynamic graph model. It is very well known from [5] that for each , a maximal matching that does not have augmenting paths of length upto is of size at least fraction of the maximum cardinality matching. This theorem provides a natural way of addressing this problem in the dynamic setting. However, there are two conditional lower bounds on the complexity of maintaining a maximal matching by eliminating augmenting paths of length upto 5. Assuming 3sum hardness, Kopelowitz et al.[6] show that any algorithm that maintains a matching in which all the augmenting paths of length at most are removed requires an update time of for any fixed
. Secondly, assuming the Online Matrix Vector conjecture, Henzinger et al.
[4] show that any algorithm which maintains a maximal matching in which all the augmenting paths of length at most are removed requires an update time of for . Consequently, our aim in this paper is to understand the complexity of maintaining a maximal matching after eliminating augmenting paths of length 3. In Table [1] we tabulate current results and our result. The results in fourth row due to Neiman and Solomon [7] output a maximal matching without 3 length augmenting paths in time. Bernstein et al. [2] gave the first algorithm which achieve better than approximation in update time. They maintain a approximate matching in amortized update time. However their work does not provide the guarantee to maintain a maximal matching without any 3 length augmenting paths. We ask whether it is possible to remove all the augmenting paths of length up to in update time? We answer this question affirmatively. To the best of our knowledge, our algorithm is the first one to maintain an approximate matching in which all augmenting paths are of length at least in amortized update time. Our two main results are regarding the expected total update time, which is in Theorem 4.3, and regarding the worst case total update time with high probability which is Theorem 4.4.Reference  Approximation  Update time  Bound 

Baswana et al. [1]  2  and  expected and w.h.p 
Solomon [9]  2  expected and w.h.p  
Peleg and Solomon (uniformly sparse graph) [8]  deterministic  
Gupta and Peng [3]  deterministic  
Neiman and Solomon [7]  deterministic  
Bernstein and Stein [2]  deterministic  
This Paper[Theorem 4.3]  3/2  O()  expected 
This Paper[Theorem 4.4]  3/2  O()  w.h.p 
Paper Outline: In Section 2 we present an overview of how our algorithm is different from and how it extends the algorithm of Baswana et. al [1]. In Section 3 we describe the invariants maintained by our algorithms, the procedures in our algorithm, and analysis of the worst case running time of each procedure. In Section 4, we present the analysis of the expected total update time and the worst case total update time.
2 Outline of our Algorithm
To achieve our main result we extend the algorithm to maintain a maximal matching in the first part of the work by Baswana et al. [1] (hereafter referred to as BGS). We start by a brief and quick presentation of the ideas in BGS. BGS introduced the notion of edge ownership by a vertex. The number of edges owned by a vertex is at most its degree, and a vertex always searches for a mate among the edges that it owns. For every vertex this information is maintained as a ownership list . For an edge , if the edge is not owned by then it is owned by . Further, they maintain the invariant that if an edge is not owned by , then it means that is matched. Therefore for to look for a mate, it is sufficient for it to search for a mate among the edges it owns. BGS has two very important operations done by a vertex : scan its ownership list, and transfer an edge in its ownership list to the other vertex in the edge. The transfer of ownership is designed to ensure that if a vertex has to remain unmatched due to an update, then its ownership list is small (this does help a fast search for a mate subsequently). Clearly, these operations become expensive when the ownership list becomes large. BGS addressed this in the presence of an oblivious adversary, that is an adversary who does not generate the dynamic update requests based on the runtime behaviour of the algorithm. They addressed this by selecting a random mate from the ownership list whenever the ownership list of a matched vertex becomes large
. Specifically, they maintain a maximal matching in which a vertex whose ownership list is large is matched. The algorithm is implemented by organizing the vertices into two levels, namely level 0 and level 1. A vertex in level 0 has a small ownership list, and a vertex with a large ownership list is in level 1 and is matched. To analyze the expected amortized cost of maintaining a maximal matching, BGS first observes that the only updates which incur a cost greater than a constant are those that delete an edge in the matching or those that insert an edge between unmatched vertices. Further they classify the cost into two parts: that incurred by updates which involve vertices of low ownership (at level 0), and the cost incurred at vertices (at level 1) of high ownership. The cost incurred at a vertex in level 0 is small, since the ownership list is small. To analyze the expected amortized cost at level 1 vertices, BGS observe that the probability that an update by an oblivious adversary presents a randomly selected edge by the algorithm is at most the reciprocal of the size of the ownership list (which is large at level 1 vertices). This ensures that the expected amortized cost of maintaining a maximal matching over
updates is . By considering a ownership of size to be large, it follows that BGS maintain a maximal matching with expected amortized cost .Removing 3 length augmenting pathsOur contribution
Conceptually, we extend BGS by deterministically checking at the end of each update whether a vertex affected by the update is part of 3 length augmenting path. For this our algorithm has to scan the whole neighbourhood of a matched vertex for an unmatched neighbour. Pessimistically, it seems that an oblivious adversary could force any algorithm to spend a high cost eliminating 3 length augmenting paths after finding mate with lower expected amortized cost. We observe by a careful analysis of our algorithm that this is not the case for eliminating 3 length augmenting paths. Central to our approach is the concept of an epoch in BGS. An epoch is a maximal runtime interval during which an edge is in the matching. As in BGS we associate with the beginning and ending of an epoch, the running time of the procedures that insert an edge into the matching and remove an edge from the matching. Apart from the procedures in BGS, we have the additional procedure to remove 3 length augmenting paths. Therefore, a single edge update by the oblivious adversary can trigger a sequence of changes to the matching, and apriori it is not clear how to analyze the length of this sequence. Our first contribution is that we ensure that this sequence is of constant length, that is any update only triggers a constant number of procedure calls, some to ensure that the matching is maximal, some to ensure that 3 length augmenting paths are eliminated, and some to ensure that unmatched vertices have a small ownership list and a small neighborhood list. The second crucial idea is that if an oblivious adversary has to force a high cost during the search of 3 length augmenting path involving one matching edge then the adversary would succeed at this task with probability which is the reciprocal of the large degree or should expect to make many low cost updates prior to the high cost update. We ensure this by matching a vertex of high degree to a randomly chosen neighbour in its ownership list. This is achieved by having a randomized courterpart for each deterministic method that changes the matching. This idea is already present in BGS where RandomSettle is the randomized counterpart of NaiveSettle. To complete the analysis, we observe that the expensive procedure calls made during runtime can be classified into one of the following two types:

Those expensive procedure calls that are preceeded by many low cost udpates.

The remaining expensive calls can be grouped into sets of constant size such that each set has a procedure call that matches a vertex to a randomly chosen neighbour in its ownership list.
Finally, like BGS we classify vertices into level 0 and level 1, but with rules that include the vertex degree also, apart from the size of the ownership list. Unlike BGS who use a Free array to keep track of whether a vertex is matched, we maintain a free neighbour list for each vertex. At first sight this operation is indeed an expensive operation, that an unmatched vertex must be maintained in the free neighbour list of all its neighbours. However, the expected amortized cost is still controlled to be by our algorithm.
3 Fully Dynamic Algorithm
Let be an undirected graph. Vertex set does not change throughout the algorithm and . The edge set changes during the course of the algorithm due to the insert and delete operations. We start with an empty graph. At every update step we allow an insertion or the deletion of exactly one edge. Given a matching , an edge is said to be matched if , otherwise edge is said to be unmatched. A vertex is said to be matched if there exist an edge such that , otherwise is called free. If then is called Mate of and is called Mate of . Let be an augmenting path of length 3 where and are free vertices and the edge is matched. We call is a 3 length augmenting path involving as the matched edge. Over a sequence of updates, we maintain a maximal matching of and ensure that the graph does not have an augmenting paths of length 3 with respect to . Therefore our matching is a approximate MCM. Similar to [1], in our algorithm we partition the vertex set into two levels 0 and 1. denotes the level of a vertex . For an edge , = max. We also define ownership for the edges similar to [1]. If both the endpoints of an edge have level 0 then both the endpoints own that edge. If level of one endpoint is and the other endpoint is , then the endpoint with level owns that edge. If both the endpoints have level 1 then ownership is assigned to anyone of the endpoints arbitrarily. For every vertex we maintain two sets : and . denotes the set of edges that owns. denotes the set of edges which are not owned by and whose other endpoint has level 1.
3.1 Invariants
Before an update step and after completion of an update step, our algorithm maintains the following invariants :

All the vertices with level 1 are always matched. A free vertex with level 0 has all its neighbours matched.

For a vertex with level 0, .

For a matched vertex with level 0, for some constant . Here is defined as . Note that is the degree of .

Both the endpoints of a matched edge have the same level.

There is no 3 length augmenting path with respect to .
So invariant 1 and 5 together implies that is a approximate MCM.
Observation 3.1.
From Invariant 1, if is a free vertex with level 0 then all neighbours of are matched. Suppose at some update step, is matched to . Since prior to this update step was free, hence all its neighbours were matched. Therefore this update step will not result in a 3 length augmenting path which involves as the matched edge.
3.2 Data Structures
In this section we describe the data structures used by our algorithm. Our data structures are similar to the data structures used in [1] and [7].

Matching is maintained in a matrix of size . If edge is in the matching then entries and in the matrix are set to 1. Therefore insertion into the matching and deletion from the matching takes time.

For every vertex the set and is stored as a dynamic hash table. Hence search, delete and insert can be performed in time. Also the count = , which is the degree of , is maintained for every vertex .

For every vertex a data structure is maintained that stores the free neighbours of . This data structure supports insert and delete in time. In addition it supports the method hasfree which returns TRUE if has a free neighbour in time, and the method getfree which returns an arbitrary free neighbour of in time. The data structure is implemented as follows : for every vertex , a boolean array of size is maintained which indicates the free neighbours of , a counter array of size in which the th element stores the number of free neighbours in the range , and a variable for total number of free neighbours. So insert,delete and hasfree are clearly operations. getfree requires a scan in the counter array to find a nonzero entry and then a scan in the boolean array in the appropriate range to find the free neighbour resulting in a operation.
3.3 Description of the Procedures
To handle updates and maintain the invariants over a sequence of updates our algorithm uses several procedures. We give a summarized description of these procedures in Table 2. The detailed description of the procedures along with the proofs of correctness and runtime analysis is also presented in this section. Since these procedures call each other in Table 3 we summarize the calling procedures and the conditions at the time of call. In this table we also point out the invariants that are ensured at the end of each procedure call. The pseudocode for each of the procedures is presented in Section 5. The names of the functions are also chosen in a very suggestive way, and also as an extension of the names in [1]: A settle function finds the mate of a vertex, a Raise function changes the level of a vertex from level 0 to level 1, a Fix function removes 3 length augmenting paths, and the Handle function deals with the delete of an edge in the matching at level 1.
Observation 3.2.
If a free vertex becomes matched, then for every neighbour of , must be removed from F(w). For one neighbour of , updating information about takes time. Therefore total time to update the status of for all neighbours of takes time . Similarly if a matched vertex becomes free, then for every neighbour of , must be added to F(z). For one neighbour of , updating information about takes time. Therefore total time to update status of for all neighbours of takes time .
NOTE : Vertex is matched randomly to means that the edge is selected uniformly at random from and included in the matching.
In the following two tables, we present the procedure calls made and the invariants the time of the call. The purpose of the tables is to give the reader an intuition of how the functions calls ensure that the five invariants are maintained by the algorithm on each update.
Procedure  Description  Computation time 

NaiveSettleAugmented(u,flag)  Case If is in and . If is then DeterministicRaiseLevelTo1 is called. Else RandomisedRaiseLevelTo1 is called.  
Case If is in , and . If is then DeterministicRaiseLevelTo1 is called. Else RandomisedRaiseLevelTo1 is called.  
Case If is in , and . Edge is included in matching  
Case If the list is empty, then procedure Fix3AugPath is called to check for 3 length augmenting path.  
RandomSettleAugmented(u)  Case Selects an edge, say , uniformly at random from . If was matched then it returns the previous mate of . If has no free neighbour then procedure stops.  
Case Selects an edge, say , uniformly at random from . If was matched then it returns the previous mate of . If is in then procedure Fix3AugPathD is called.  
DeterministicRaiseLevelTo1  Vertex is matched, and level of is . Let is mate of . Levels and are changed to . Edges in are transferred to .  
RandomisedRaiseLevelTo1  Vertex is matched, and level of is . Let is mate of . Edge is removed from the matching. Edges in are transferred to . Procedure RandomSettleAugmented is called. If it returns a vertex and level of is then HandleDeleteLevel1(x,1) is called. Otherwise NaiveSettleAugmented(x,1) is called.  
Fix3AugPathD  is free, level of is , is matched and level of is . Let be the mate of . If () is in , then edge is removed from matching and edges and are included in the matching.  
Fix3AugPath Initial Condition: is free, level of is , is matched and level of is or . Let be the mate of and () is in .  Common step : is removed from matching and and are included in the matching. If level of is ,then levels of and are changed to  
Case If , then procedure RandomRaiseLevelTo1 is called.  
Case If and then procedure RandomRaiseLevelTo1 is called.  
Case If and then,no further processing required.  
HandleDeleteLevel1  Common step : is free, level of is . For every edge in , if level of is then is removed from and inserted to . Then :  
Case If , then procedure RandomSettleAugmented is called.  
Case If , then Level of vertex is changed to . Procedure NaiveSettleAugmented is called. 
Called Procedure  Calling Procedure  Conditions at the time of call  Invariant fixed by Called Procedure 

NaiveSettleAugmented(x,flag)  RandomisedRaiseLevelTo1: is randomly matched to and = Mate  x is free , Level of x is and flag is  x will not violate
Invariant 1
[Lemma 3.3.1] 
HandleDeleteLevel1  is free, Level of is and flag is or 
will not violate Invariant 1
[Lemma 3.3.1] 

HandleDeleteLevel1 : is randomly matched to and = Mate  is free, Level of is and flag is or 
will not violate Invariant 1
[Lemma 3.3.1] 

RandomSettleAugmented(x)  HandleInsertLevel0  is free, Level of is 0 and 
will not violate Invariant 2
[Lemma 4] 
HandleDeleteLevel1 : is or  is free, Level of is 1 and 
will not violate Invariant 1
[Lemma 3.3.7] 

RandomisedRaiseLevelTo1  is free, Level of is 0 and 
will not violate Invariant 3
[Lemma 3.3.4] 

DeterministicRaiseLevelTo1(x)  NaiveSettleAugmented  is matched, Level of is 0 and 
will not violate Invariant 3
[Lemma 3.3.3] 
RandomisedRaiseLevelTo1(x)  NaiveSettleAugmented  is matched, Level of is 0 and 
will not violate Invariant 3
[Lemma 3.3.4] 
Fix3AugPath : is a 3 length augmenting path where = Mate and is in  is matched, Level of is 0 and 
will not violate Invariant 3
[Lemma 3.3.4] 

Fix3AugPathD  RandomSettleAugmented : is in  is free, Level of is 0, is matched and Level of is 1 
will not violate invariant 5.
[Lemma 3.3.5] 
Fix3AugPath(x,y)  NaiveSettleAugmented: is in , = Mate and is in , is or  is free, Level of is 0 and does not have a free neighbour 
will not violate Invariant 5
[Lemma 3.3.6] 
HandleInsertLevel0  is free, Level of is 0 and is matched 
will not violate Invariant 5
[Lemma 3.3.6] 

HandleDeleteLevel1(x,flag)  RandomisedRaiseLevelTo1 : is randomly matched to and =Mate  is free and Level of is 1 
will not violate Invariant 1
[Lemma 3.3.7] 
3.3.1 NaiveSettleAugmented
Procedure receives a free vertex with level 0 and a as input.
As described in Algorithm 1,
the procedure NaiveSettleAugmented works as follows :
It checks for a free neighbour of by calling Hasfree. The following two cases describes the remaining processing.

Vertex has a free neighbour and let be the free neighbour returned by getfree.

If then vertex violates Invariant 3. If is 1 then the edge is included in matching and procedure DeterministicRaiseLevelTo1 is called. Otherwise RandomisedRaiseLevelTo1 is called. At the end of this procedure will be a matched vertex at level 1. At the time of call to this procedure, was a free vertex and it was not violating any invariant. Therefore if gets matched to a vertex other than after call to procedure RandomisedRaiseLevelTo1 then will remain as a free vertex and it will not violate any invariant. If and then vertex violates Invariant 3 and hence same processing is repeated for . At the end of processing for , if is a free vertex then procedure NaiveSettleAugmented is called.

If and then the edge is included in matching . Therefore and are now matched vertices. No further processing is required.
Let be the Mate of . Vertices and are removed from free neighbour lists of all their neighbours.


Vertex does not have a free neighbour. If is part of a 3 length augmenting path then it violates Invariant 5. To check this, for every neighbour of , procedure Fix3AugPath is called.
At the end of procedure NaiveSettleAugmented, vertex will not violate Invariant 1.
Proof.
Following two cases prove that will not violate Invariant 1 after call to NaiveSettleAugmented.

Vertex has a free neighbour. Therefore at the start of procedure call NaiveSettleAugmented, is violating Invariant 1. Let be the free neighbour returned by getfree.

. If is then procedure RandomisedRaiseLevelTo1 is called. As explained in section 3.3.4, after call to procedure RandomisedRaiseLevelTo1, will be a matched vertex and hence will not violate Invariant 1. If is 1 then edge is included in the matching and procedure DeterministicRaiseLevelTo1 is called. As explained in section 3.3.3, after call to procedure DeterministicRaiseLevelTo1, will be a matched vertex and hence will not violate Invariant 1.

and . If is 1 then edge is included in the matching and procedure DeterministicRaiseLevelTo1 is called. As explained in section 3.3.3, after call to procedure DeterministicRaiseLevelTo1, will be a matched edge at level and hence will not violate Invariant 1. If is then procedure RandomisedRaiseLevelTo1 is called. After this call if remains free then procedure NaiveSettleAugmented is called which will ensure that will not violate Invariant 1.

and . Edge is included in the matching. Hence will not violate Invariant 1.


Vertex does not have a free neighbour. Therefore does not violate Invariant 1.
∎
Running time of procedure NaiveSettleAugmented is :

if has a free neighbour and and .

in all other cases.
Proof.
Procedure hasfree takes time. Remaining processing takes place as follows :

Vertex has a free neighbour. Procedure getfree takes time and return a free neighbour, say .

and . Edge is included in matching in time. Vertex is removed from free neighbour list of all its neighbours in time . Similarly vertex is removed from free neighbour list of all its neighbours in time . No further processing required and hence total processing time is .

. If is then edge is included in matching in time and procedure DeterministicRaiseLevelTo1 is called. From Lemma 3.3.3, time required for this procedure call is which is . If is then procedure RandomisedRaiseLevelTo1 is called. From Lemma 3.3.4, time required for this procedure call is . Therefore total processing time for NaiveSettleAugmented is .

and . This case is similar to the previous one and takes time .


Vertex does not have a free neighbour. Procedure NaiveSettleAugmented looks for a 3 length augmenting path if any starting at .

No augmenting path starting at . Total time for processing is which is .

There is an augmenting path starting at . Then procedure Fix3AugPath is called. From Lemma 3.3.6, procedure Fix3AugPath takes time and hence total processing time for NaiveSettleAugmented is .

∎
3.3.2 RandomSettleAugmented
As described in Algorithm 2, the procedure works as follows : The procedure selects an edge uniformly at random from . Let be the randomly selected edge. For all the edges in , the edge is removed from and put in . If was matched and let = Mate, then this procedure returns . Otherwise, if was free then it returns NULL. After this, the procedure changes the level of and level of to 1 and the edge is included in the matching. The procedure also checks for any new 3 length augmenting path involving the matched edge using procedure Fix3AugPathD. Let Vertex be at level 0 and inside procedure Insert. After a call to procedure RandomSettleAugmented, vertex will not violate Invariant 2.
Proof.
Procedure RandomSettleAugmented select an edge from uniformly at random. Let be the edge selected. At the end of the procedure, will be a matched edge at level 1. Hence will not violate Invariant 2. ∎
Running time of procedure RandomSettleAugmented is , where is mate of , is free neighbour of and is free neighbour of .
Proof.
Selecting an edge uniformly at random takes time and . For every edge owned by , the edge is removed from and placed in . This step takes time . If was matched then mate of is obtained in time. Let be the previous mate of . Edge is removed from matching in time. Edge is included in the matching in time. Level of vertex and is changed to 1 in constant time. Vertex and is removed from the free neighbour lists of their neighbours. This takes time which is . If vertex does not have any free neighbour then processing stops at this point and total time required by procedure RandomSettleAugmented is . Otherwise procedure Fix3AugPathD is called. From Lemma 3.3.5, this procedure takes time, where is free neighbour of and is free neighbour of . Since , total time taken by procedure RandomSettleAugmented is . ∎
3.3.3 DeterministicRaiseLevelTo1
This procedure receives vertex as input.
Vertex is a matched vertex at level 0 and . Therefore Invariant 3 is violated by vertex .
As described in Algorithm 3, the procedure works as follows :
Let be the mate of . For every edge in , is removed from and added to
. Similarly for every edge in , is removed from and added to . After this for every edge in , removed from and added to . Also, is removed from and added to .
After this step is . Procedure changes the levels of and to 1.
At the end of call to procedure DeterministicRaiseLevelTo1, Invariant 3 is not violated by vertex .
Proof.
Let be the mate of . The procedure changes levels of vertices and to 1. The edge remains in the matching. Therefore at end of the procedure and are matched vertices at level 1. Hence Invariant 3 is not violated by vertex . ∎
Running time of procedure DeterministicRaiseLevelTo1 is , where is mate of .
Proof.
Let be the mate of . For every edge in , is removed from and added to . Similarly for every edge in , is removed from and added to . After this for every edge in , removed from and added to . Also, is removed from and added to . Total time required for all these processing is which is . Therefore running time of procedure DeterministicRaiseLevelTo1 is . ∎
3.3.4 RandomisedRaiseLevelTo1
Procedure RandomisedRaiseLevelTo1 receives a vertex as input which is a matched vertex at level 0 and . Therefore violates Invariant 3.
As described in Algorithm 4, procedure RandomisedRaiseLevelTo1 works as follows :
Let be the mate of . Edge is removed from matching.
For every edge in , is removed from and put in . For every edge in , is removed from and and placed in and . After this step, is . Among the edges in this procedure picks an edge uniformly at random using procedure RandomSettleAugmented. Let be the edge picked at random.
Following two cases describe the remaining processing :

Level of is 1. Therefore is matched and let be the mate of . Edge is removed from the matching and becomes a free vertex at level 1. Therefore violates Invariant 1. To fix this procedure HandleDeleteLevel1 is called. Edge is included in the matching.

Level of is 0. We describe the following cases :

is matched and let be the mate of . Since edge is removed from the matching, is a free vertex at level 0. Procedure NaiveSettleAugmented is called. Edge is included in the matching.

was free then edge is included in the matching.

At the end of call to procedure RandomisedRaiseLevelTo1, Invariant 3 is not violated by vertex .
Proof.
Procedure RandomisedRaiseLevelTo1 calls procedure RandomSettleAugmented. Procedure RandomSettleAugmented selects an edge uniformly at random from . Edge is included in the matching and level of is . Therefore vertex becomes a matched vertex at level 1. Successive steps in the procedure does not involve vertex . Therefore at the time of completion of the procedure, remains matched at level 1. Hence Invariant 3 is not violated by vertex . ∎
Running time of procedure RandomisedRaiseLevelTo1 is .
Proof.
Mate of , say , is obtained in time and edge is removed from matching in time. For every edge in , is removed from and put in . For every edge in , is removed from and and placed in and . This takes time which is . After this procedure RandomSettleAugmented is called. From Lemma 3.3.2, this procedure takes time. Let be the edge included into matching by procedure RandomSettleAugmented.

was free. Therefore no further processing required and hence total time taken by procedure RandomisedRaiseLevelTo1 is .

was matched. Let be the previous mate of .

Level of is . Procedure HandleDeleteLevel1 is called. From Lemma 3.3.7, this procedure takes time and hence total time taken by procedure RandomisedRaiseLevelTo1 is .

Level of is . Procedure NaiveSettleAugmented is called. From Lemma 3.3.1, this procedure takes time and hence total time taken by procedure RandomisedRaiseLevelTo1 is .

∎
3.3.5 Fix3AugPathD
Let be a free vertex and level of is . Let be a neighbour of , level of is 1 and let be the mate of . If has a free neighbour () then there is a 3 length augmenting path . This violates Invariant 5. As described in Algorithm 5, the procedure works as follows :
For all the edges in in , it removes from and puts in . Same processing is repeated for . Vertices and are removed from the free neighbour lists of all their neighbours. Edge is removed from the matching and edges and are included in the matching. Levels of and are changed to 1.
At the end of procedure call Fix3AugPathD there will not be any 3 length augmenting path starting at .
Proof.
It is clear from the description that at the start of call to procedure Fix3AugPathD, if is a 3 length augmenting path then at the end of call to the procedure and will be matched edges at level 1. Therefore there will not be any 3 length augmenting path starting at . Again from observation 3.3, vertices and will not participate in a 3 length augmenting path until next update. ∎
Running time of procedure Fix3AugPathD is .
Proof.
Mate of is obtained in time. Let be the mate of . Procedure hasfree(y) checks in time if has a free neighbour. If a free neighbour, say , exist then is obtained in time using procedure getfree. For every edge , is removed from and put in . Vertex is removed from free neighbour list of all its neighbours. Same processing is repeated for vertex . Time required for all these processing is . Edge is removed from the matching in time and edges and are added to the matching in time. Levels of and are changed to in time. Therefore total processing time for procedure Fix3AugPathD is which is . ∎
3.3.6 Fix3AugPath
Let be a free vertex. Let be a neighbour of and let be the mate of . If has a free neighbour and , then there is a 3 length augmenting path . This violates Invariant 5. As described in Algorithm 6, procedure Fix3AugPath works as follows :

Level of vertex is 1.
Edge is removed from the matching. Edges and are included in the matching. (Note that we are not changing the levels of and to immediately, but it will be taken care of during the subsequent processing in the following cases)
. Procedure RandomisedRaiseLevelTo1 is called. If edge is not in the matching after call to procedure RandomisedRaiseLevelTo1 then this results in a free vertex at level . Therefore HandleDeleteLevel1 is called. For every neighbour of , is removed from F(). For every edge in , is shifted from to . Level of is changed to .

and . Procedure RandomisedRaiseLevelTo1 is called. If edge is not in the matching after call to RandomisedRaiseLevelTo1, then this results in a free vertex at level 1. Therefore HandleDeleteLevel1 is called. For every edge in , is shifted from to . Level of is changed to .

and . Levels of and are changed to 1. For every edge in , is shifted from to . Same is done for . Then levels of and are changed to 1. For every neighbour of , is removed from free neighbour list F(w). Similarly for every neighbour of , is removed from F().


Level of vertex is 0.
Edge is removed from the matching. Edges and are included in the matching. Vertex is removed from the free neighbour list of all its neighbours. Similarly vertex is removed from the free neighbour list of all its neighbours.
. In this case procedure RandomisedRaiseLevelTo1 is called. If does not get matched to then procedure NaiveSettleAugmented is called.

. In this case procedure RandomisedRaiseLevelTo1 is called. If does not get matched to then procedure NaiveSettleAugmented is called.

and . No further processing is required.

At the end of procedure call Fix3AugPath there will not be any 3 length augmenting path starting at .
Proof.
If a 3 length augmenting starting at exists then procedure Fix3AugPath first finds such a path. Let be such a path where is mate of and is a free neighbour of .

Level of vertex is 1. In this case edge is removed from the matching and edges and are included in the matching.

. Procedure RandomisedRaiseLevelTo1 is called. From Lemma 3.3.4, vertex will be a matched vertex at level 1 after call to RandomisedRaiseLevelTo1. Therefore there will not be any 3 length augmenting path starting at . Level of is changed to and edge will be a matched edge at level .
Observation 3.3.
Since was free prior to this, hence and Mate will not participate in a 3 length augmenting before the next update.

and . Procedure RandomisedRaiseLevelTo1 is called. After call to RandomisedRaiseLevelTo1, level of vertex is changed to 1 and edge is a matched edge at level . Since is matched now, therefore there is no 3 length augmenting path starting at . Observation 3.3 holds for .

and . Levels of and are changed to 1. Therefore there will not be any 3 length augmenting path starting at . Observation 3.3 holds for both vertex and .


Level of vertex is . In this case edge is removed from the matching and edges and are included in the matching. Observation 3.3 holds for both vertices and .

. Procedure RandomisedRaiseLevelTo1 is called. From Lemma 3.3.4, after call to RandomisedRaiseLevelTo1, vertex will be a matched vertex at level 1. Therefore there will not be any 3 length augmenting path starting at .

. No further processing done on vertex . Since is already matched, hence there is no 3 length augmenting path starting at .

∎
Running time for procedure Fix3AugPath is

if and ,
where is a length augmenting path, is mate of and is free neighbour of . 
in all other cases.
Proof.
Mate of can be obtained in time. Let be the mate of . Procedure hasfree takes time and checks if has a free neighbour. If a free neighbour, say , exist then is obtained in time using procedure getfree.

and .
Edge is removed from the matching in time. Edges and are added to the matching in time.
Level of is 1. For every edge in , is removed from and put in . Similarly for every edge in , is removed from and put in . This takes time = , because both and are level vertices. Levels of and are changed to in time . Vertex is removed from the free neighbour list of all its neighbours and vertex is also removed from the free neighbour list of all its neighbours. This takes time . Therefore total processing time taken by procedure Fix3AugPath is .

Level of is . Vertex is removed from the free neighbour list of all its neighbours and vertex is also removed from the free neighbour list of all its neighbours. This takes time . Therefore total processing time taken by procedure Fix3AugPath is .


Otherwise it involves call to procedure RandomisedRaiseLevelTo1 and HandleDeleteLevel1. It is clear from Algorithm 6, it involves at most one call to procedure HandleDeleteLevel1 and one call to procedure RandomisedRaiseLevelTo1. From Lemma 3.3.4, time taken by procedure RandomisedRaiseLevelTo1 is . From Lemma 3.3.1, time taken by procedure HandleDeleteLevel1 is . Therefore total time taken by procedure Fix3AugPath is .
∎
3.3.7 HandleDeleteLevel1
Let be a free vertex and level of is 1. This violates Invariant 1 of our algorithm.
As described in Algorithm 7, procedure HandleDeleteLevel1 works as follows :
For every edge in , if level of is 1 then edge is removed from and inserted in . Following two cases describes the remaining processing.

. Procedure RandomSettleAugmented is called. After call to RandomSettleAugmented, will be a matched vertex at level 1.

. In this case, level of is changed to . For every edge in , is also included in . After this, if flag is 1 then NaiveSettleAugmented is called and if flag is 0 then NaiveSettleAugmented.

Vertex has a free neighbour, say . Procedure NaiveSettleAugmented will match to . We have described procedure NaiveSettleAugmented in Section 3.3.1.

Vertex does not have a free neighbour. In this case will remain as a free vertex at level 0. For every neighbour of , is included in F(w).
Depending on the level of vertex , further processing takes place as described in the following two cases :

Vertex remains at level 0. For all its neighbour in , increases by 1. If then procedure RandomSettleAugmented is called.

Vertex remains at level 1 and no further processing is required.

After call to procedure HandleDeleteLevel1, Invariant 1 is not violated by vertex .
Proof.
At the time of call to procedure HandleDeleteLevel1, is a free vertex at level 1. As shown in Algorithm 7, for every edge in where level of is 1, edge is removed from and inserted in . If , procedure RandomSettleAugmented is called. As explained in Section 3.3.2, after call to procedure RandomSettleAugmented, vertex will be a matched vertex at level 1. Hence Invariant 1 is not violated by vertex . If then level of vertex is changed to 0. After this procedure NaiveSettleAugmented is called. From Lemma 3.3.1, after call to NaiveSettleAugmented, vertex will not violate Invariant 1. ∎
Running time of procedure HandleDeleteLevel1 is .
Proof.
For every edge in , if level of is then is removed from and and inserted in and . This step may take time.

If , then procedure RandomSettleAugmented is called. From Lemma 3.3.2, call to RandomSettleAugmented may take time. Let be the vertex returned by RandomSettleAugmented. If is not NULL then procedure NaiveSettleAugmented is called. From Lemma 3.3.1, call to procedure NaiveSettleAugmented may take time. Therefore total time required by process HandleDeleteLevel1 is .

If , then for every edge in , is also included in . This step takes time. After this procedure NaiveSettleAugmented is called. From Lemma 3.3.1, call to procedure NaiveSettleAugmented may take time. Therefore total time required by process HandleDeleteLevel1 is .
Note that if remains in level 0 then procedure may call RandomSettleAugmented for if . There will be at most many such calls. However, in our analysis we will consider the time required for those calls as independent from the current call to HandleDeleteLevel1. ∎
3.4 Insertion
We describe procedure calls made during the insertion of an edge .
Assuming that all the invariants are maintained before the insertion, we show that our algorithm maintains all the invariants after the insertion.
Following four cases exhaustively describes the different insertion cases.
Insert(u,v):

Level of is 1 and level of is 1. Edge is included in (or ) and (or respectively). If insertion is between two level 1 vertices then it takes time.
Proof.
Insertion of edge
Comments
There are no comments yet.