Graph Matching Problem
Graph Matching Problem
This chapter explains the graph matching problem in detail. We first introduce some
notation and terminology. Next, a classification of the different graph matching types is
presented: this PhD thesis concentrates on inexact graph matching problems, but this chap-
ter summarizes other types of graph matching too. The complexity of the different graph
matching problems is also analyzed. Finally, the state of the art is presented. The amount
of this type of work shows that the interest on the field is increasing with the years.
3
2.2 Definition and classification of graph matching problems
head
right left
arm trunk arm
right left
leg leg
Figure 2.1: Illustration of how the physical parts of a human body can be represented using a graph.
Graph vertices and edges can also contain information. When this information is a
simple label (i.e. a name or number) the graph is called labelled graph. Other times, vertices
and edges contain some more information. These are called vertex and edge attributes,
and the graph is called attributed graph. More usually, this concept is further specified by
distinguishing between vertex-attributed (or weighted graphs) and edge-attributed graphs3 .
A path between any two vertices u, u0 ∈ V is a non-empty sequence of k different vertices
< v0 , v1 , . . . , vk > where u = v0 , u0 = vk and (vi−1 , vi ) ∈ E, i = 1, 2, . . . , k. Finally, a graph
G is said to be acyclic when there are no cycles between its edges, independently of whether
the graph G is directed or not.
either directed or undirected. When edges are undirected, they simply indicate the existence
of a relation between two vertices. On the other hand, directed edges are used when relations
between vertices are considered in a not symmetric way. Note that the graph in Figure 2.1
is undirected, and therefore the attributes on each edge (u, u0 ) are not specified to be from
u to u0 or vice-versa.
Graph Matching
Figure 2.2: Classification of all the graph matching types into two main classes: exact graph matching
and inexact graph matching (in which the best among all the possible non necessarily bijective
matchings has to be found).
The best correspondence of a graph matching problem is defined as the optimum of some
objective function which measures the similarity between matched vertices and edges. This
objective function is also called fitness function 5 .
In an inexact graph matching problem such as the ones described as examples, since we
have |VM | < |VD |, the goal is to find a mapping f 0 : VD → VM such that (u, v) ∈ ED iff
(f (u), f (v)) ∈ EM . This corresponds to the search for a small graph within a big one. An
important sub-type of these problems are sub-graph matching problems, in which we have
two graphs G = (V, E) and G0 = (V 0 , E 0 ), where V 0 ⊆ V and E 0 ⊆ E, and in this case the
aim if to find a mapping f 0 : V 0 → V such that (u, v) ∈ E 0 iff (f (u), f (v)) ∈ E. When such
a mapping exists, this is called a subgraph matching or subgraph isomorphism.
Exact and inexact graph matching are the terms that we will use in this thesis to differen-
tiate these two basic types of graph matching problems. However, in the literature this type
of graph matching problems are also called isomorphic and homomorphic graph matching
problems respectively.
the graph matching procedure will not be able to match the vertices corresponding to these
objects satisfactorily to any of the brain regions to be recognized. Similar examples can be
found in satellite images for instance, when the model graph has been extracted from an
image obtained some years before the actual photograph to be analyzed and new roads and
buildings are present on the place.
More formally, given two graphs GM = (VM , EM ) and S GD = (VD , ED ), the problem
consists in searching for a homomorphism h : VD → VM {∅}, where ∅ represents the null
value, meaning that when for a vertex a ∈ VD we have h(a) = ∅ there is no correspondence
in the model graph for vertex a in the data graph. This value ∅ is known in the literature
as the null vertex or the dummy vertex.
Note that in these cases the fitness function that measures the fitness of the homomor-
phism h has to be designed taking into account that it should encourage the graph match-
ing algorithm to reduce the number of vertices a1 , a2 , . . . , an ∈ VD satisfying the condition
h(ai ) = ∅, i = 1, 2, . . . , n. In other words, nothing avoids that the homomorphism h for which
∀ai ∈ VD h(ai ) = ∅ is valid, but this solution would not represent any satisfactory result.
It is important to note that the use of the dummy vertex can be regarded as an additional
vertex only for the model graph. However, in some problems the equivalent opposite case is
also happening: using the same example of the human brain, the graph matching algorithm
could face the case of having to recognize the data image of a patient that has undergone
a lobotomy, and therefore a lobe is missing in the image. In this case, the graph matching
problem has the particularity that there would not be a correspondence in the optimal
solution for all the model vertices, but it does require the use of dummy vertices. This aspect
is also common in other image recognition problems such as the aerial image recognition one,
in which ancien buildings and factories can leave space in a newer photograph to new parks
or roads.
2.2.3 Graph matching allowing more than one correspondence per vertex
Some other graph matching problems allow many-to-many matches, that is, given two graphs
GM = (VM , EM ) and GD = (VD , ED ), the problem consists on searching for a homomorphism
f : VD → W where W ∈ P(VM )\{∅} and W ⊆ VM . In case of using also dummy vertices,
W can take the value ∅, and therefore W ∈ P(VM ).
This type of graph matching problems are more difficult to solve, as the complexity
of the search for the best homomorphism has much more combinations and therefore the
search space of the graph matching algorithm is much bigger. These types of graph matching
problems make sense when the segmentation step in the image does not satisfy the condition
of having segmented all the regions completely, and therefore some of the automatically
segmented regions are at the same time part of two or more model regions.
An important difficulty in graph matching problems that allow more than a single match-
ing per data vertex is the design of a fitness function to measure the quality of each of the
possible homomorphisms. Again, the number of model vertices matched to each single data
vertex needs to be kept as low as possible so that the graph matching algorithm is forced to
return more concrete results. These aspects are very dependent on each particular problem.
Even if this chapter has been focused on the graph matching types that can be found in
the literature, this section focuses also in other related aspects such as the image processing
techniques, the way of building the attributes, the different algorithms and formalizations of
these problems, and their applications. The outline of this section is as follows: Section 2.4.1
reviews image processing techniques for graph matching purposes, as well as the generation
of the graphs from images. Section 2.4.2 refers to the different ways of representing the infor-
mation in graphs, and records references on geometrical properties of graph edit distances,
and graph metrics. Finally, Sections 2.4.3, 2.4.4, 2.4.5, 2.4.6, and 2.4.7 explain the different
graph matching problems that have been proposed based on genetic algorithms, probability
theory-based approaches, decision trees, neural networks, and clustering techniques respec-
tively. Each section comments examples of applications in which these methods have been
applied. Finally, Section 2.4.8 discusses the advantages and disadvantages of the main ap-
proaches analyzed in the previous sections.
2.4.1 Image processing and graph construction techniques for graph match-
ing
In most of the graph matching problems for image recognition, vertices in graphs represent
regions of images, and the division in regions is the result of a segmentation procedure. This
segmentation procedure is sometimes performed with the aid of an expert, but other times
automatic segmentation and graph construction techniques are applied to create the graphs
that are to be matched.
as their intensity. Due to the high variation and complexity of cloud activities for the
tropical cyclone patterns, meteorological analysts all over the world so far are still relying on
subjective human justification for cyclone identification purposes. Elastic graph matching
techniques have been proposed for automatic detection of this problem.
Another usual application of this technique is the authentication of human faces, where
the deformation patterns of the face are represented as graph attributes [Duc et al., 1999,
Kotropoulos et al., 2000a,b, Tefas et al., 2002]. The different facial expression and the
rotation patterns of the human head are intended to be represented in the form of graphs.
Wavelet transforms are also used for creating the elastic face graph model, such as in [Ma
and Xiaoou, 2001] where the face graph model is constructed using the discrete wavelet
transform, and in [Duc et al., 1997, Lyons et al., 1999, Wiskott, 1999], where different 2D
Gabor wavelet representation are used. Another related problem is the recognition of facial
regions such as mouth and nose, which is also solved using these methods [Herpers and
Sommer, 1998].
Morphological graph matching applies hyperplanes or deformable spline-based models to
the skeleton of non-rigid discrete objects [di Ruberto and Dempster, 2001, Ifrah, 1997, Kumar
et al., 2001, Rangarajan et al., 2001, Tefas et al., 2001], the graph being built from skeleton
characteristic points. An approach to interactively define features and subsequently recognize
parts regarding shape features using a sub-graph matching algorithm is proposed in [Sonthi,
1997]. An illustrative example of mathematical morphology applied to curve fitting and not
to skeleton points can be found in [Bakircioglu et al., 1998], where curves on brain surfaces are
matched by defining distances between curves regarding their speed, curvature, and torsion.
Also, in [Dorai, 1996] another framework for representation and recognition of 3D free-form
objects is shown, where the surface representation scheme describes an object concisely in
terms of maximal surface patches of constant shape index. Finally, the application of planar
surfaces to the modelling the data graph can be solved with probabilistic relaxation as shown
in [Branca et al., 2000].
Another geometrical approach is introduced in [Shams, 1999], using generalized cylinders
called geons as visual primitives to represent object models. Geons constitute a structural
level intermediate between local features and whole objects, used here as a basis for pow-
erful generalization between different view points. This work makes use of graph matching
techniques and cross-correlation methods to find 2D projections of geons as partial matches
between several images.
Examples of other applications of these techniques are: symmetry-based indexing of
image databases [Sharvit et al., 1998], shape recognition from large image libraries [Huet and
Hancock, 1999], recognition of shape features via multiple geometric abstractions [Sonthi,
1997], shape recognition using probability theory-based methods [Khoo and Suganthan, 2002,
Shao and Kittler, 1999], structural matching by discrete relaxation [Wilson and Hancock,
1997], representation and recognition of 3D free-form objects [Cheng et al., 2001, Dorai,
1996], and hand posture recognition [Triesch and von der Malsburg, 2001].
for graph and subgraph isomorphism detection in order to match a graph to the best of a
dictionary of graphs.
Due to the computation cost of using databases and to perform image processing on each,
several references can be found about the subject of how to perform efficiently graph matching
to all the models. For instance, in [Berretti et al., 2001] the usage of an indexing metric
to organize large archives of graph models and for (sub)graph error correcting isomorphism
problem is proposed. [Sharvit et al., 1998] proposes an approach for indexing pictorial
databases based on a characterization of the symmetry in edge maps.
From a more theoretical point of view, [Williams et al., 1997] describes the development
of a Bayesian framework for multiple graph matching. The starting point of this proposal is
the Bayesian consistency measure developed by Wilson and Hancock [Wilson and Hancock,
1996] which is generalized from matching graph pairs to multiple graphs. In [Huet and
Hancock, 1999] a graph-matching technique for recognizing line-pattern shapes in large image
databases is described. The methodological contribution of the paper is to develop a Bayesian
matching algorithm that uses edge-consistency and vertex attribute similarity. Recognition is
performed by selecting from the database the image with the largest a posteriori probability.
One of the problems faced most commonly as multiple graph matching is the human
face recognition [Kotropoulos et al., 2000a,b]. The particularity of [Mariani, 2000] is that
the images of the database are all taken from the same person viewed from different angles,
which aim is to estimate the orientation of the head. Following the same problem, [Hancock
et al., 1998] compares the performance of two computer-based face database identification
systems based on human ratings of similarity and distinctiveness, and human memory per-
formance. Multiple graph matching has also been applied to many other problems such as
the comparison of saliency map graphs [Shokoufandeh et al., 1999].
2.4.2 Distance measures, conceptual graphs, and graph edit distances and
metrics
The graph edit distance between two graphs is defined as the number of modifications that
one has to undertake to arrive from one graph to be the other. The distance between
two graphs is defined as the weighted sum of the costs of edit operations (insert, delete, and
relabel the vertices and edges) to transform one graph to the other. The fact of applying these
concepts and removing vertices or edges in graphs is analyzed in many works, as removal
will lead to smaller graphs and therefore the graph matching problem can be reduced in
complexity.
[Fernandez and Valiente, 2001] proposes a way of representing attributed relational
graphs, the maximum common subgraph and the minimum common supergraph of two
graphs by means of simple constructions, which allow to obtain the maximum common
subgraph from the minimum common supergraph, and vice versa. A distance measure be-
tween pairs of circular edges and relations among them is introduced in [Foggia et al., 1999].
This measure is to be applied in domains with high variability in the shape of the visual
patterns (i.e. where a structural approach is particularly useful). In [Bunke, 1997] the rela-
tion between graph edit distance and the maximum common subgraph is analyzed, showing
that under a fitness function introduced in this paper, graph edit distance computation is
equivalent to solving the maximum common subgraph problem. Other related theoretical
subjects are addressed in [Wang et al., 1995], in which two variants of the approximate graph
matching problem are considered and analyzed: the computation of the distance between
the graphs GM and GD , and the definition of the minimum distance between GM and GD
Bunke, 1998b] an algorithm for error-correcting subgraph isomorphism detection from a set
of model graphs to an unknown input graph is introduced.
Applications of this technique are manyfold. [Fuchs and Men, 2000] present a procedure
to compute error-correcting subgraph isomorphism in order to encode a priory knowledge
for application to 3D reconstruction of buildings for cartography. Other examples are: re-
lating error-correction and decision trees [Messmer and Bunke, 1998a], related to indexing
of graph models [Berretti et al., 2001], crystallographic map interpretation [Oldfield, 2002],
and construction of specific frameworks for error-tolerant graph matching [Bunke, 1998].
Conceptual graphs
Conceptual graphs have been used to model knowledge representations since their intro-
duction in the early 80’s. The formalism of conceptual graphs introduced in [Sowa, 1984]
is a flexible and consistent knowledge representation with a well-defined theoretical basis.
Moreover, simple conceptual graphs are considered as the kernel of most knowledge repre-
sentation formalisms built upon Sowa’s model. This formalism can capture semantics in the
representation of data, and it offers some useful constructs which makes it a likely platform
for a knowledge-based system. An extension of this concept to graph matching is introduced
in [Baget and Mugnier, 2002], where reasoning in Sowa’s model can be expressed by a graph
homomorphism called projection. This paper presents a family of extensions of this mode,
based on rules and constraints, keeping graph homomorphism as the basic operation. The
use of conceptual graphs is also extended to some other works [Chen, 1996, Emami, 1997,
Finch et al., 1997, Lai et al., 1999].
Apart from this type of graphs, graph matching has also been proposed, from both
a theoretical or a practical view point, in combination with: matching graphs [Eroh and
Schultz, 1998], minimal condition subgraphs [Gao and Shah, 1998], finite graphs [Bacik,
2001], weighted mean of a pair of graphs [Bunke and Gunter, 2001], median graphs [Jiang
et al., 2001], and decomposition approaches [Messmer and Bunke, 2000]. Furthermore, dif-
ferent ways of representing patterns are analyzed in terms of symbolic data structures such
as strings, trees, and graphs in [Bunke, 2001].
that incorporates a local search strategy using a hill-climbing step. The authors demon-
strate analytically that this hill-climbing step accelerates convergence significantly. This
idea is extended in [Cross et al., 2000], which is also a convergence analysis for the problem
of attributed graph matching using genetic search. [Myers and Hancock, 2001] constitutes
an extension of the Bayesian matching framework introduced in [Wilson and Hancock, 1997]
by taking into account the cases with ambiguities in feature measurements. This paper also
develops an evolutionary optimization framework that is applied on a genetic algorithm
adapted for this search. Finally, the main idea in [Myers and Hancock, 2000] is that at-
tributed graph matching problems (or consistent labelling problems as called by the authors)
usually have more than one valid and satisfactory solution, and the aim of the authors is to
propose a method to obtain different solutions at the same time during the genetic search,
using an appropriately modified genetic algorithm.
As an example of real applications, works on the field on the human brain images recog-
nition example can be found in [Boeres et al., 1999, Boeres, 2002, Perchant et al., 1999,
Perchant and Bloch, 1999].
multiple graph matching [Messmer and Bunke, 1999]. The decision tree is created using a
set of a priori known model graphs generated from exact subgraph isomorphism detection.
2.4.8 Discussion
In this Section, we discuss the pros and cons of the main classes of approaches found in the
literature.
The complexity of the graph matching approaches make it very difficult to take into
account all types of dependencies between the vertices and edges in the model and data
graphs. That is why in most existing frameworks defined for this problem (e.g. Bayesian,
morphological and EM frameworks described in the previous sections) only unary and binary
relations between vertices are taken into account. The advantage of such simplifications is
that the complexity of graph matching is reduced when tackling the original problem, and
this allows the use of techniques that require evaluating a lot of individuals through the search
for the best solution. On the other hand, these approaches are ignoring many relationships
that can be decisive when searching for a satisfactory matching. Due to this, and depending
on the type of problem, these simplifications could lead to non satisfactory results.
Regarding the application of genetic algorithms in graph matching problems, the per-
formance that they present is remarkable, specially when they are combined with dedicated
frameworks such as Bayesian ones. In addition, the number of evaluations that they require
to reach a solution is very low compared to other stochastic heuristic searches. However,
one of their drawbacks is that their performance is very dependent on the high number of
input parameters that have to be set. This dependence is specially dependent on the type of
cross-over and mutation operators selected. The literature presents plenty of different GAs
which are more appropriated for particular types of problems, and the user who wants to
apply these methods needs to have a lot of experience in order to tune properly the algorithm
and obtain satisfactory results. Another important drawback of GAs is the fact that when
the fitness function contains many local maxima these algorithms get easily stuck on them.
Moreover, in the definitions of similarities proposed for building the fitness functions for
GAs, again only unary and binary relationships are taken into account. This simplification
is understandable since the number of evaluations that GAs require to reach the optimum
solution in such complex problems is high, but important relationships can be missed out.
Regarding the use of neural networks, they have shown in the last years a good per-
formance in solving problems as complex as graph matching ones. The ability of neural
networks to take into account particular restrictions of problems has also been proved exper-
imentally. However, regarding the way of representing the knowledge, the main drawback of
this approach is that this information is encoded in a kind of black box that does not allow
easily to infer how the network reasons. Other approaches based on probabilistic structures
(such as Bayesian networks) have the ability to express in a format directly comprehensible
for researchers how the knowledge is represented.