represent matched edges with solid lines and
unmatched edges with dotted lines. Furthermore, let
S X and T be neighbour of S i.e. T = nhbor(S) but
T ≠ Y. So T contains only those vertices from
partition Y, which are matched to a vertex in S.
The Hungarian algorithm outputs a complete
matching M*
V.
The incremental algorithm adds a new pair of
vertices to the max-weighted matched bipartite
graph whose feasible vertex labelling is also given,
together with the max-weighted matching. Then, it
assigns any feasible labelling to the newly added
pair of vertices and, by using this labelling,
determines the maximum-weighted matching of the
whole extended bipartite graph.
When we add a new pair of vertices to the max-
weighted-matched graph, a new weight matrix is
generated by adding a new row and a new column to
the previous weight matrix as the (V + 1)st row and
column corresponding to the edges incident to the
new vertices.
Algorithm 2: OntoMaintain.
Input: The extended bipartite graph
G’= (X
U Y, X × Y), with partitions of size
V+1 represented by a weight matrix W’of size
(V + 1) × (V + 1)
A feasible vertex labeling l of the first V
vertices such that it corresponds to G
l
containing the max-weighted matching
among the first V vertices
The max-weighted matching M*
V
among
the first V vertices of the partitions
Output: Perfect matching M*
V+1
and the updated
labels l of the vertices of the extended
bipartite graph G’.
1. Begin with matching M*
V
derived by Hungarian
algorithm.
Assign labels to new vertices Y
V + 1
and X
V + 1
as follows:
l(Y
V+1
) = 0
l(X
V+1
)= max y
j
Y (w
v+1
,
j
)
2. On the equality subgraph G
l,
pick an unmatched
vertex in partition X (called U) using matching
M*
V
. Grow a Hungarian tree rooted at this
vertex, while doing so; include all vertices
encountered in X (with U) into S and all vertices
encountered in Y into T.
3. If an augmenting path A is found, interchange
matched and unmatched edges in the augmenting
path. Calculate new matching by increasing size
by one.
4. If no augmenting path is found, revise the
labeling l. After label revision, labels of vertices
in S are decreased by the smallest possible
amount which adds at least one edge between S
and Y-T. Concurrently, labels of vertices in T are
increased by the same amount in order to
maintain the current matching between S and T.
Adding such edges will increase the chance of
finding an augmenting path. Revise labels as:
α
l
= min
xi
S, yj
Y - T
{ l (x
i
) + l(y
j
) - w
ij
}
l(v) + α
l
l’(v) =
l(v) - α
l
l(v) otherwise
5. Go to Step 2 to search for an augmenting path
with the new equality subgraph G’
l
defined by
the new labeling
5.1 Complexity Analysis
Our Incremental Algorithm, OntoMaintain, has a
time complexity of O(n
2
), where n denotes the total
number of vertices in the bipartite graph. Finding the
feasible labelling for the new row and column takes
linear time, so it has time complexity of O(n). In
order to find an augmenting path, provided we don’t
find one straight away, we have to modify the labels
of the vertices. This adds at least one edge to the
tree, so in the worst case after n iterations we will
find an augmenting path. Each iteration requires
O(n) operations. The computation of
α
l
requires
O(n
2
) complexity, adding edges from S to Y – T
requires O(n
2
) operations. Thus, the total complexity
of our algorithm is O(n
2
).
5.2 Correctness of the Algorithm
When we add a new pair of vertices to the
maximum-weighted-matched bipartite graph,
feasible labelling for the extended bipartite graph
can be determined by using the labelling on the
already determined max-weighted-matched part of
the graph. After adding the new vertices, all the
matched edges will be in the equality subgraph.
If there is no edge between the new pair of
vertices, then they will be the only unmatched
vertices in the graph. Because there is only a single
unmatched vertex pair, it is possible to find only a
single augmenting path in the equality subgraph. So
INCREMENTAL MAINTENANCE OF ONTOLOGIES BASED ON BIPARTITE GRAPH MATCHING
447