damecco.tex
author Madarasi Peter
Sun, 27 Nov 2016 22:57:56 +0100
changeset 17 909bcb203f25
parent 16 8349e9e65e18
child 19 b9a8744c5efc
permissions -rw-r--r--
Fine tune. To be reviewed: abstract, intro, conclusion.
alpar@0
     1
%% 
alpar@0
     2
%% Copyright 2007, 2008, 2009 Elsevier Ltd
alpar@0
     3
%% 
alpar@0
     4
%% This file is part of the 'Elsarticle Bundle'.
alpar@0
     5
%% ---------------------------------------------
alpar@0
     6
%% 
alpar@0
     7
%% It may be distributed under the conditions of the LaTeX Project Public
alpar@0
     8
%% License, either version 1.2 of this license or (at your option) any
alpar@0
     9
%% later version.  The latest version of this license is in
alpar@0
    10
%%    http://www.latex-project.org/lppl.txt
alpar@0
    11
%% and version 1.2 or later is part of all distributions of LaTeX
alpar@0
    12
%% version 1999/12/01 or later.
alpar@0
    13
%% 
alpar@0
    14
%% The list of all files belonging to the 'Elsarticle Bundle' is
alpar@0
    15
%% given in the file `manifest.txt'.
alpar@0
    16
%% 
alpar@0
    17
alpar@0
    18
%% Template article for Elsevier's document class `elsarticle'
alpar@0
    19
%% with numbered style bibliographic references
alpar@0
    20
%% SP 2008/03/01
alpar@0
    21
alpar@0
    22
\documentclass[preprint,12pt]{elsarticle}
alpar@0
    23
alpar@0
    24
%% Use the option review to obtain double line spacing
alpar@0
    25
%% \documentclass[authoryear,preprint,review,12pt]{elsarticle}
alpar@0
    26
alpar@0
    27
%% Use the options 1p,twocolumn; 3p; 3p,twocolumn; 5p; or 5p,twocolumn
alpar@0
    28
%% for a journal layout:
alpar@0
    29
%% \documentclass[final,1p,times]{elsarticle}
alpar@0
    30
%% \documentclass[final,1p,times,twocolumn]{elsarticle}
alpar@0
    31
%% \documentclass[final,3p,times]{elsarticle}
alpar@0
    32
%% \documentclass[final,3p,times,twocolumn]{elsarticle}
alpar@0
    33
%% \documentclass[final,5p,times]{elsarticle}
alpar@0
    34
%% \documentclass[final,5p,times,twocolumn]{elsarticle}
alpar@0
    35
alpar@0
    36
%% For including figures, graphicx.sty has been loaded in
alpar@0
    37
%% elsarticle.cls. If you prefer to use the old commands
alpar@0
    38
%% please give \usepackage{epsfig}
alpar@0
    39
alpar@0
    40
%% The amssymb package provides various useful mathematical symbols
alpar@0
    41
\usepackage{amssymb}
alpar@0
    42
%% The amsthm package provides extended theorem environments
alpar@0
    43
%% \usepackage{amsthm}
alpar@0
    44
alpar@0
    45
%% The lineno packages adds line numbers. Start line numbering with
alpar@0
    46
%% \begin{linenumbers}, end it with \end{linenumbers}. Or switch it on
alpar@0
    47
%% for the whole article with \linenumbers.
alpar@0
    48
%% \usepackage{lineno}
alpar@0
    49
alpar@2
    50
\usepackage{amsmath}
alpar@2
    51
%% \usepackage[pdftex]{graphicx}
alpar@2
    52
alpar@2
    53
\usepackage{pgfplots}
alpar@2
    54
\pgfplotsset{width=9cm}
alpar@2
    55
\pgfplotsset{compat=1.8}
alpar@2
    56
alpar@2
    57
\usepackage{caption}
alpar@2
    58
\usepackage{subcaption} 
alpar@2
    59
alpar@2
    60
\usepackage{algorithm}
alpar@2
    61
\usepackage{algpseudocode}
alpar@2
    62
\usepackage{tikz}
alpar@2
    63
alpar@2
    64
\usepackage{amsthm,amssymb}
alpar@2
    65
\renewcommand{\qedsymbol}{\rule{0.7em}{0.7em}}
alpar@2
    66
alpar@2
    67
\newtheorem{theorem}{Theorem}[subsection]
alpar@2
    68
\newtheorem{corollary}{Corollary}[theorem]
alpar@2
    69
\newtheorem{claim}[theorem]{Claim}
alpar@2
    70
alpar@2
    71
\newtheorem{definition}{Definition}[subsection]
alpar@2
    72
\newtheorem{notation}{Notation}[subsection]
alpar@2
    73
\newtheorem{example}{Example}[subsection]
alpar@2
    74
\usetikzlibrary{decorations.markings}
alpar@2
    75
\let\oldproofname=\proofname
alpar@2
    76
%% \renewcommand{\proofname}{\rm\bf{Proof:}}
alpar@2
    77
Madarasi@7
    78
\captionsetup{font=normalsize}
Madarasi@7
    79
alpar@1
    80
\journal{Discrete Applied Mathematics}
alpar@0
    81
alpar@0
    82
\begin{document}
alpar@0
    83
alpar@0
    84
\begin{frontmatter}
alpar@0
    85
alpar@0
    86
%% Title, authors and addresses
alpar@0
    87
alpar@0
    88
%% use the tnoteref command within \title for footnotes;
alpar@0
    89
%% use the tnotetext command for theassociated footnote;
alpar@0
    90
%% use the fnref command within \author or \address for footnotes;
alpar@0
    91
%% use the fntext command for theassociated footnote;
alpar@0
    92
%% use the corref command within \author for corresponding author footnotes;
alpar@0
    93
%% use the cortext command for theassociated footnote;
alpar@0
    94
%% use the ead command for the email address,
alpar@0
    95
%% and the form \ead[url] for the home page:
alpar@0
    96
%% \title{Title\tnoteref{label1}}
alpar@0
    97
%% \tnotetext[label1]{}
alpar@0
    98
%% \author{Name\corref{cor1}\fnref{label2}}
alpar@0
    99
%% \ead{email address}
alpar@0
   100
%% \ead[url]{home page}
alpar@0
   101
%% \fntext[label2]{}
alpar@0
   102
%% \cortext[cor1]{}
alpar@0
   103
%% \address{Address\fnref{label3}}
alpar@0
   104
%% \fntext[label3]{}
alpar@0
   105
alpar@1
   106
\title{Improved Algorithms for Matching Biological Graphs}
alpar@0
   107
alpar@0
   108
%% use optional labels to link authors explicitly to addresses:
alpar@0
   109
%% \author[label1,label2]{}
alpar@0
   110
%% \address[label1]{}
alpar@0
   111
%% \address[label2]{}
alpar@0
   112
alpar@1
   113
\author{Alp{\'a}r J{\"u}ttner and P{\'e}ter Madarasi}
alpar@0
   114
alpar@1
   115
\address{Dept of Operations Research, ELTE}
alpar@0
   116
alpar@0
   117
\begin{abstract}
alpar@1
   118
Subgraph isomorphism is a well-known NP-Complete problem, while its
alpar@1
   119
special case, the graph isomorphism problem is one of the few problems
alpar@1
   120
in NP neither known to be in P nor NP-Complete. Their appearance in
alpar@1
   121
many fields of application such as pattern analysis, computer vision
alpar@1
   122
questions and the analysis of chemical and biological systems has
alpar@1
   123
fostered the design of various algorithms for handling special graph
alpar@1
   124
structures.
alpar@0
   125
alpar@1
   126
The idea of using state space representation and checking some
alpar@1
   127
conditions in each state to prune the search tree has made the VF2
alpar@1
   128
algorithm one of the state of the art graph matching algorithms for
alpar@1
   129
more than a decade. Recently, biological questions of ever increasing
alpar@1
   130
importance have required more efficient, specialized algorithms.
alpar@1
   131
alpar@1
   132
This paper presents VF2++, a new algorithm based on the original VF2,
alpar@1
   133
which runs significantly faster on most test cases and performs
alpar@1
   134
especially well on special graph classes stemming from biological
alpar@1
   135
questions. VF2++ handles graphs of thousands of nodes in practically
alpar@1
   136
near linear time including preprocessing. Not only is it an improved
alpar@1
   137
version of VF2, but in fact, it is by far the fastest existing
alpar@1
   138
algorithm regarding biological graphs.
alpar@1
   139
alpar@1
   140
The reason for VF2++' superiority over VF2 is twofold. Firstly, taking
alpar@1
   141
into account the structure and the node labeling of the graph, VF2++
alpar@1
   142
determines a state order in which most of the unfruitful branches of
alpar@1
   143
the search space can be pruned immediately. Secondly, introducing more
alpar@1
   144
efficient - nevertheless still easier to compute - cutting rules
alpar@1
   145
reduces the chance of going astray even further.
alpar@1
   146
alpar@1
   147
In addition to the usual subgraph isomorphism, specialized versions
alpar@1
   148
for induced subgraph isomorphism and for graph isomorphism are
alpar@1
   149
presented. VF2++ has gained a runtime improvement of one order of
alpar@1
   150
magnitude respecting induced subgraph isomorphism and a better
alpar@1
   151
asymptotical behaviour in the case of graph isomorphism problem.
alpar@1
   152
alpar@1
   153
After having provided the description of VF2++, in order to evaluate
alpar@1
   154
its effectiveness, an extensive comparison to the contemporary other
alpar@1
   155
algorithms is shown, using a wide range of inputs, including both real
alpar@1
   156
life biological and chemical datasets and standard randomly generated
alpar@1
   157
graph series.
alpar@1
   158
alpar@1
   159
The work was motivated and sponsored by QuantumBio Inc., and all the
alpar@1
   160
developed algorithms are available as the part of the open source
alpar@1
   161
LEMON graph and network optimization library
alpar@1
   162
(http://lemon.cs.elte.hu).
alpar@0
   163
\end{abstract}
alpar@0
   164
alpar@0
   165
\begin{keyword}
alpar@0
   166
%% keywords here, in the form: keyword \sep keyword
alpar@0
   167
alpar@0
   168
%% PACS codes here, in the form: \PACS code \sep code
alpar@0
   169
alpar@0
   170
%% MSC codes here, in the form: \MSC code \sep code
alpar@0
   171
%% or \MSC[2008] code \sep code (2000 is the default)
alpar@0
   172
alpar@0
   173
\end{keyword}
alpar@0
   174
alpar@0
   175
\end{frontmatter}
alpar@0
   176
alpar@0
   177
%% \linenumbers
alpar@0
   178
alpar@0
   179
%% main text
alpar@2
   180
\section{Introduction}
alpar@2
   181
\label{sec:intro}
alpar@2
   182
alpar@3
   183
In the last decades, combinatorial structures, and especially graphs
alpar@3
   184
have been considered with ever increasing interest, and applied to the
alpar@3
   185
solution of several new and revised questions.  The expressiveness,
alpar@3
   186
the simplicity and the studiedness of graphs make them practical for
alpar@3
   187
modelling and appear constantly in several seemingly independent
alpar@3
   188
fields.  Bioinformatics and chemistry are amongst the most relevant
alpar@3
   189
and most important fields.
alpar@2
   190
alpar@3
   191
Complex biological systems arise from the interaction and cooperation
alpar@3
   192
of plenty of molecular components. Getting acquainted with such
alpar@3
   193
systems at the molecular level has primary importance, since
alpar@3
   194
protein-protein interaction, DNA-protein interaction, metabolic
alpar@3
   195
interaction, transcription factor binding, neuronal networks, and
alpar@3
   196
hormone signaling networks can be understood only this way.
alpar@2
   197
alpar@3
   198
For instance, a molecular structure can be considered as a graph,
alpar@3
   199
whose nodes correspond to atoms and whose edges to chemical bonds. The
alpar@3
   200
secondary structure of a protein can also be represented as a graph,
alpar@3
   201
where nodes are associated with aminoacids and the edges with hydrogen
alpar@3
   202
bonds. The nodes are often whole molecular components and the edges
alpar@3
   203
represent some relationships among them.  The similarity and
alpar@3
   204
dissimilarity of objects corresponding to nodes are incorporated to
alpar@3
   205
the model by \emph{node labels}.  Many other chemical and biological
alpar@3
   206
structures can easily be modeled in a similar way. Understanding such
alpar@3
   207
networks basically requires finding specific subgraphs, which can not
alpar@3
   208
avoid the application of graph matching algorithms.
alpar@2
   209
alpar@3
   210
Finally, let some of the other real-world fields related to some
alpar@3
   211
variants of graph matching be briefly mentioned: pattern recognition
alpar@3
   212
and machine vision \cite{HorstBunkeApplications}, symbol recognition
alpar@3
   213
\cite{CordellaVentoSymbolRecognition}, face identification
alpar@3
   214
\cite{JianzhuangYongFaceIdentification}.  \\
alpar@2
   215
alpar@3
   216
Subgraph and induced subgraph matching problems are known to be
alpar@3
   217
NP-Complete\cite{SubgraphNPC}, while the graph isomorphism problem is
alpar@3
   218
one of the few problems in NP neither known to be in P nor
alpar@3
   219
NP-Complete. Although polynomial time isomorphism algorithms are known
alpar@3
   220
for various graph classes, like trees and planar
alpar@3
   221
graphs\cite{PlanarGraphIso}, bounded valence
alpar@3
   222
graphs\cite{BondedDegGraphIso}, interval graphs\cite{IntervalGraphIso}
alpar@3
   223
or permutation graphs\cite{PermGraphIso}.
alpar@2
   224
alpar@3
   225
In the following, some algorithms based on other approaches are
alpar@3
   226
summarized, which do not need any restrictions on the graphs. However,
alpar@3
   227
an overall polynomial behaviour is not expectable from such an
alpar@3
   228
alternative, it may often have good performance, even on a graph class
alpar@3
   229
for which polynomial algorithm is known. Note that this summary
alpar@3
   230
containing only exact matching algorithms is far not complete, neither
alpar@3
   231
does it cover all the recent algorithms.
alpar@2
   232
alpar@3
   233
The first practically usable approach was due to
alpar@4
   234
Ullmann\cite{Ullmann} which is a commonly used depth-first
alpar@3
   235
search based algorithm with a complex heuristic for reducing the
alpar@3
   236
number of visited states. A major problem is its $\Theta(n^3)$ space
alpar@3
   237
complexity, which makes it impractical in the case of big sparse
alpar@3
   238
graphs.
alpar@2
   239
alpar@4
   240
In a recent paper, Ullmann\cite{UllmannBit} presents an
alpar@3
   241
improved version of this algorithm based on a bit-vector solution for
alpar@3
   242
the binary Constraint Satisfaction Problem.
alpar@2
   243
alpar@4
   244
The Nauty algorithm\cite{Nauty} transforms the two graphs to
alpar@3
   245
a canonical form before starting to check for the isomorphism. It has
alpar@3
   246
been considered as one of the fastest graph isomorphism algorithms,
alpar@3
   247
although graph categories were shown in which it takes exponentially
alpar@3
   248
many steps. This algorithm handles only the graph isomorphism problem.
alpar@2
   249
alpar@4
   250
The \emph{LAD} algorithm\cite{Lad} uses a depth-first search
alpar@3
   251
strategy and formulates the matching as a Constraint Satisfaction
alpar@3
   252
Problem to prune the search tree. The constraints are that the mapping
alpar@3
   253
has to be injective and edge-preserving, hence it is possible to
alpar@3
   254
handle new matching types as well.
alpar@2
   255
alpar@3
   256
The \textbf{RI} algorithm\cite{RI} and its variations are based on a
alpar@3
   257
state space representation. After reordering the nodes of the graphs,
alpar@3
   258
it uses some fast executable heuristic checks without using any
alpar@3
   259
complex pruning rules. It seems to run really efficiently on graphs
alpar@3
   260
coming from biology, and won the International Contest on Pattern
alpar@3
   261
Search in Biological Databases\cite{Content}.
alpar@2
   262
alpar@3
   263
The currently most commonly used algorithm is the
alpar@3
   264
\textbf{VF2}\cite{VF2}, the improved version of VF\cite{VF}, which was
alpar@3
   265
designed for solving pattern matching and computer vision problems,
alpar@3
   266
and has been one of the best overall algorithms for more than a
alpar@3
   267
decade. Although, it can't be up to new specialized algorithms, it is
alpar@3
   268
still widely used due to its simplicity and space efficiency. VF2 uses
alpar@3
   269
a state space representation and checks some conditions in each state
alpar@3
   270
to prune the search tree.
alpar@2
   271
alpar@3
   272
Our first graph matching algorithm was the first version of VF2 which
alpar@3
   273
recognizes the significance of the node ordering, more opportunities
alpar@3
   274
to increase the cutting efficiency and reduce its computational
alpar@3
   275
complexity. This project was initiated and sponsored by QuantumBio
alpar@3
   276
Inc.\cite{QUANTUMBIO} and the implementation --- along with a source
alpar@3
   277
code --- has been published as a part of LEMON\cite{LEMON} open source
alpar@3
   278
graph library.
alpar@2
   279
alpar@3
   280
This paper introduces \textbf{VF2++}, a new further improved algorithm
alpar@3
   281
for the graph and (induced)subgraph isomorphism problem, which uses
alpar@3
   282
efficient cutting rules and determines a node order in which VF2 runs
alpar@3
   283
significantly faster on practical inputs.
alpar@2
   284
alpar@3
   285
Meanwhile, another variant called \textbf{VF2 Plus}\cite{VF2Plus} has
alpar@3
   286
been published. It is considered to be as efficient as the RI
alpar@3
   287
algorithm and has a strictly better behavior on large graphs.  The
alpar@3
   288
main idea of VF2 Plus is to precompute a heuristic node order of the
alpar@3
   289
small graph, in which the VF2 works more efficiently.
alpar@2
   290
alpar@2
   291
\section{Problem Statement}
alpar@3
   292
This section provides a detailed description of the problems to be
alpar@3
   293
solved.
alpar@2
   294
\subsection{Definitions}
alpar@2
   295
alpar@3
   296
Throughout the paper $G_{small}=(V_{small}, E_{small})$ and
alpar@3
   297
$G_{large}=(V_{large}, E_{large})$ denote two undirected graphs.
alpar@2
   298
\begin{definition}\label{sec:ismorphic}
alpar@3
   299
$G_{small}$ and $G_{large}$ are \textbf{isomorphic} if $\exists M:
alpar@3
   300
  V_{small} \longrightarrow V_{large}$ bijection, for which the
alpar@3
   301
  following is true:
alpar@2
   302
\begin{center}
alpar@3
   303
$\forall u,v\in{V_{small}} : (u,v)\in{E_{small}} \Leftrightarrow
alpar@3
   304
  (M(u),M(v))\in{E_{large}}$
alpar@2
   305
\end{center}
alpar@2
   306
\end{definition}
alpar@3
   307
For the sake of simplicity in this paper subgraphs and induced
alpar@3
   308
subgraphs are defined in a more general way than usual:
alpar@2
   309
\begin{definition}
alpar@3
   310
$G_{small}$ is a \textbf{subgraph} of $G_{large}$ if $\exists I:
alpar@3
   311
  V_{small}\longrightarrow V_{large}$ injection, for which the
alpar@3
   312
  following is true:
alpar@2
   313
\begin{center}
alpar@2
   314
$\forall u,v \in{V_{small}} : (u,v)\in{E_{small}} \Rightarrow (I(u),I(v))\in E_{large}$
alpar@2
   315
\end{center}
alpar@2
   316
\end{definition}
alpar@2
   317
alpar@2
   318
\begin{definition} 
alpar@3
   319
$G_{small}$ is an \textbf{induced subgraph} of $G_{large}$ if $\exists
alpar@3
   320
  I: V_{small}\longrightarrow V_{large}$ injection, for which the
alpar@3
   321
  following is true:
alpar@2
   322
\begin{center}
alpar@3
   323
$\forall u,v \in{V_{small}} : (u,v)\in{E_{small}} \Leftrightarrow
alpar@3
   324
  (I(u),I(v))\in E_{large}$
alpar@2
   325
\end{center}
alpar@2
   326
\end{definition}
alpar@2
   327
alpar@2
   328
\begin{definition}
alpar@3
   329
$lab: (V_{small}\cup V_{large}) \longrightarrow K$ is a \textbf{node
alpar@3
   330
    label function}, where K is an arbitrary set. The elements in K
alpar@3
   331
  are the \textbf{node labels}. Two nodes, u and v are said to be
Madarasi@17
   332
  \textbf{equivalent} if $lab(u)=lab(v)$.
alpar@2
   333
\end{definition}
alpar@2
   334
Madarasi@17
   335
When node labels are given, the matched nodes must have the same
alpar@3
   336
labels.  For example, the node labeled isomorphism is phrased by
alpar@2
   337
\begin{definition}
alpar@3
   338
$G_{small}$ and $G_{large}$ are \textbf{isomorphic by the node label
alpar@3
   339
    function lab} if $\exists M: V_{small} \longrightarrow V_{large}$
alpar@3
   340
  bijection, for which the following is true:
alpar@2
   341
\begin{center}
alpar@3
   342
$(\forall u,v\in{V_{small}} : (u,v)\in{E_{small}} \Leftrightarrow
alpar@3
   343
  (M(u),M(v))\in{E_{large}})$ and $(\forall u\in{V_{small}} :
alpar@3
   344
  lab(u)=lab(M(u)))$
alpar@2
   345
\end{center}
alpar@2
   346
\end{definition}
alpar@2
   347
Madarasi@17
   348
Note that he other two definitions can be extended in the same way.
alpar@2
   349
alpar@2
   350
\subsection{Common problems}\label{sec:CommProb}
alpar@2
   351
alpar@3
   352
The focus of this paper is on two extensively studied topics, the
alpar@3
   353
subgraph isomorphism and its variations. However, the following
alpar@3
   354
problems also appear in many applications.
alpar@2
   355
alpar@3
   356
The \textbf{subgraph matching problem} is the following: is
alpar@3
   357
$G_{small}$ isomorphic to any subgraph of $G_{large}$ by a given node
alpar@3
   358
label?
alpar@2
   359
alpar@3
   360
The \textbf{induced subgraph matching problem} asks the same about the
alpar@3
   361
existence of an induced subgraph.
alpar@2
   362
alpar@3
   363
The \textbf{graph isomorphism problem} can be defined as induced
alpar@3
   364
subgraph matching problem where the sizes of the two graphs are equal.
alpar@2
   365
alpar@3
   366
In addition to existence, it may be needed to show such a subgraph, or
alpar@3
   367
it may be necessary to list all of them.
alpar@2
   368
alpar@3
   369
It should be noted that some authors misleadingly refer to the term
alpar@3
   370
\emph{subgraph isomorphism problem} as an \emph{induced subgraph
alpar@3
   371
  isomorphism problem}.
alpar@2
   372
alpar@3
   373
The following sections give the descriptions of VF2, VF2++, VF2 Plus
alpar@3
   374
and a particular comparison.
alpar@2
   375
alpar@2
   376
\section{The VF2 Algorithm}
alpar@3
   377
This algorithm is the basis of both the VF2++ and the VF2 Plus.  VF2
alpar@4
   378
is able to handle all the variations mentioned in Section
alpar@4
   379
  \ref{sec:CommProb}.  Although it can also handle directed graphs,
alpar@3
   380
for the sake of simplicity, only the undirected case will be
alpar@3
   381
discussed.
alpar@2
   382
alpar@2
   383
alpar@2
   384
\subsection{Common notations}
alpar@3
   385
\indent Assume $G_{small}$ is searched in $G_{large}$.  The following
alpar@3
   386
definitions and notations will be used throughout the whole paper.
alpar@2
   387
\begin{definition}
alpar@3
   388
A set $M\subseteq V_{small}\times V_{large}$ is called
Madarasi@17
   389
\textbf{mapping} if no node of $V_{small}\cup V_{large}$ appears
alpar@3
   390
in more than one pair in M.  That is, M uniquely associates some of
alpar@3
   391
the nodes in $V_{small}$ with some nodes of $V_{large}$ and vice
alpar@3
   392
versa.
alpar@2
   393
\end{definition}
alpar@2
   394
alpar@2
   395
\begin{definition}
Madarasi@17
   396
Mapping $M$ \textbf{covers} a node v if there exists a pair in M, which
alpar@3
   397
contains v.
alpar@2
   398
\end{definition}
alpar@2
   399
alpar@2
   400
\begin{definition}
Madarasi@17
   401
A mapping $M$ is $\mathbf{whole\ mapping}$ if $M$ covers all the
alpar@3
   402
nodes in $V_{small}$.
alpar@2
   403
\end{definition}
alpar@2
   404
alpar@2
   405
\begin{notation}
alpar@3
   406
Let $\mathbf{M_{small}(s)} := \{u\in V_{small} : \exists v\in
alpar@3
   407
V_{large}: (u,v)\in M(s)\}$ and $\mathbf{M_{large}(s)} := \{v\in
alpar@3
   408
V_{large} : \exists u\in V_{small}: (u,v)\in M(s)\}$.
alpar@2
   409
\end{notation}
alpar@2
   410
alpar@2
   411
\begin{notation}
Madarasi@17
   412
Let $\mathbf{Pair(M,v)}$ be the pair of $v$ in $M$ if such a node
Madarasi@17
   413
exist, otherwise $\mathbf{Pair(M,v)}$ is undefined, where $M$ is a mapping and $v\in V_{small}\cup V_{large}$.
alpar@2
   414
\end{notation}
alpar@2
   415
alpar@2
   416
Note that if $\mathbf{Pair(M,v)}$ exists, then it is unique
alpar@2
   417
alpar@3
   418
The definitions of the isomorphism types can be rephrased on the
alpar@3
   419
existence of a special whole mapping $M$, since it represents a
alpar@3
   420
bijection. For example
alpar@2
   421
\begin{center}
alpar@3
   422
$M\subseteq V_{small}\times V_{large}$ represents an induced subgraph
alpar@3
   423
  isomorphism $\Leftrightarrow$ $M$ is whole mapping and $\forall u,v
alpar@3
   424
  \in{V_{small}} : (u,v)\in{E_{small}} \Leftrightarrow
alpar@3
   425
  (Pair(M,u),Pair(M,v))\in E_{large}$.
alpar@2
   426
\end{center}
alpar@2
   427
alpar@3
   428
Throughout the paper, $\mathbf{PT}$ denotes a generic problem type
Madarasi@14
   429
which can be substituted by any of $\mathbf{ISO}$, $\mathbf{SUB}$
alpar@4
   430
and $\mathbf{IND}$.
alpar@2
   431
alpar@2
   432
\begin{definition}
alpar@3
   433
Let M be a mapping. A logical function $\mathbf{Cons_{PT}}$ is a
Madarasi@17
   434
\textbf{consistency function by } $\mathbf{PT}$ if the following
Madarasi@14
   435
holds. If there exists whole mapping $W$ of type $PT$ for which
alpar@3
   436
$M\subseteq W$, then $Cons_{PT}(M)$ is true.
alpar@2
   437
\end{definition}
alpar@2
   438
alpar@2
   439
\begin{definition} 
alpar@3
   440
Let M be a mapping. A logical function $\mathbf{Cut_{PT}}$ is a
Madarasi@17
   441
\textbf{cutting function by } $\mathbf{PT}$ if the following
alpar@3
   442
holds. $\mathbf{Cut_{PT}(M)}$ is false if $M$ can be extended to a
Madarasi@14
   443
whole mapping $W$ of type $PT$.
alpar@2
   444
\end{definition}
alpar@2
   445
alpar@2
   446
\begin{definition}
Madarasi@17
   447
$M$ is said to be \textbf{consistent mapping by} $\mathbf{PT}$ if
alpar@3
   448
  $Cons_{PT}(M)$ is true.
alpar@2
   449
\end{definition}
alpar@2
   450
alpar@2
   451
$Cons_{PT}$ and $Cut_{PT}$ will often be used in the following form.
alpar@2
   452
\begin{notation}
Madarasi@17
   453
Let $\mathbf{Cons_{PT}(p, M)}:=Cons_{PT}(M\cup\{p\})$, and
alpar@3
   454
$\mathbf{Cut_{PT}(p, M)}:=Cut_{PT}(M\cup\{p\})$, where
alpar@3
   455
$p\in{V_{small}\!\times\!V_{large}}$ and $M\cup\{p\}$ is mapping.
alpar@2
   456
\end{notation}
alpar@2
   457
alpar@3
   458
$Cons_{PT}$ will be used to check the consistency of the already
alpar@3
   459
covered nodes, while $Cut_{PT}$ is for looking ahead to recognize if
alpar@3
   460
no whole consistent mapping can contain the current mapping.
alpar@2
   461
alpar@2
   462
\subsection{Overview of the algorithm}
alpar@3
   463
VF2 uses a state space representation of mappings, $Cons_{PT}$ for
alpar@3
   464
excluding inconsistency with the problem type and $Cut_{PT}$ for
alpar@3
   465
pruning the search tree.  Each state $s$ of the matching process can
alpar@3
   466
be associated with a mapping $M(s)$.
alpar@2
   467
alpar@4
   468
Algorithm~\ref{alg:VF2Pseu} is a high level description of
alpar@3
   469
the VF2 matching algorithm.
alpar@2
   470
alpar@2
   471
alpar@2
   472
\begin{algorithm}
Madarasi@13
   473
\algtext*{EndIf}%ne nyomtasson end if-et
Madarasi@13
   474
\algtext*{EndFor}%ne
Madarasi@13
   475
\algtext*{EndProcedure}%ne nyomtasson ..
alpar@2
   476
\caption{\hspace{0.5cm}$A\ high\ level\ description\ of\ VF2$}\label{alg:VF2Pseu}
alpar@2
   477
\begin{algorithmic}[1]
alpar@2
   478
alpar@3
   479
\Procedure{VF2}{State $s$, ProblemType $PT$} \If{$M(s$) covers
alpar@3
   480
  $V_{small}$} \State Output($M(s)$) \Else
alpar@2
   481
  
alpar@3
   482
  \State Compute the set $P(s)$ of the pairs candidate for inclusion
alpar@3
   483
  in $M(s)$ \ForAll{$p\in{P(s)}$} \If{Cons$_{PT}$($p, M(s)$) $\wedge$
alpar@3
   484
    $\neg$Cut$_{PT}$($p, M(s)$)} \State Compute the nascent state
alpar@3
   485
  $\tilde{s}$ by adding $p$ to $M(s)$ \State \textbf{call}
alpar@3
   486
  VF2($\tilde{s}$, $PT$) \EndIf \EndFor \EndIf \EndProcedure
alpar@2
   487
\end{algorithmic}
alpar@2
   488
\end{algorithm}
alpar@2
   489
alpar@2
   490
alpar@3
   491
The initial state $s_0$ is associated with $M(s_0)=\emptyset$, i.e. it
alpar@3
   492
starts with an empty mapping.
alpar@2
   493
alpar@3
   494
For each state $s$, the algorithm computes $P(s)$, the set of
alpar@3
   495
candidate node pairs for adding to the current state $s$.
alpar@2
   496
alpar@3
   497
For each pair $p$ in $P(s)$, $Cons_{PT}(p,M(s))$ and
alpar@3
   498
$Cut_{PT}(p,M(s))$ are evaluated. If $Cons_{PT}(p,M(s))$ is true and
alpar@3
   499
$Cut_{PT}(p,M(s))$ is false, the successor state $\tilde{s}=s\cup
alpar@3
   500
\{p\}$ is computed, and the whole process is recursively applied to
Madarasi@17
   501
$\tilde{s}$. Otherwise, $\tilde{s}$ is not consistent by $PT$, or it
alpar@3
   502
can be proved that $s$ can not be extended to a whole mapping.
alpar@2
   503
Madarasi@11
   504
In order to make sure of the correctness, see
alpar@2
   505
\begin{claim}
alpar@3
   506
Through consistent mappings, only consistent whole mappings can be
alpar@3
   507
reached, and all of the whole mappings are reachable through
alpar@3
   508
consistent mappings.
alpar@2
   509
\end{claim}
alpar@2
   510
Madarasi@17
   511
Note that a state may be reached in exponentially many different ways, since the
Madarasi@17
   512
order of insertions into $M$ does not influence the nascent mapping.
alpar@2
   513
alpar@2
   514
However, one may observe
alpar@2
   515
alpar@2
   516
\begin{claim}
alpar@2
   517
\label{claim:claimTotOrd}
alpar@3
   518
Let $\prec$ an arbitrary total ordering relation on $V_{small}$.  If
alpar@3
   519
the algorithm ignores each $p=(u,v) \in P(s)$, for which
alpar@2
   520
\begin{center}
Madarasi@17
   521
$\exists (\tilde{u},\tilde{v})\in P(s): \tilde{u} \prec u$,
alpar@2
   522
\end{center}
Madarasi@17
   523
then no state can be reached more than once, and each state associated
alpar@3
   524
with a whole mapping remains reachable.
alpar@2
   525
\end{claim}
alpar@2
   526
alpar@3
   527
Note that the cornerstone of the improvements to VF2 is a proper
alpar@3
   528
choice of a total ordering.
alpar@2
   529
alpar@2
   530
\subsection{The candidate set P(s)}
alpar@2
   531
\label{candidateComputingVF2}
Madarasi@14
   532
Let $P(s)$ be the set of the candidate pairs for inclusion in $M(s)$.
alpar@2
   533
alpar@2
   534
\begin{notation}
alpar@3
   535
Let $\mathbf{T_{small}(s)}:=\{u \in V_{small} : u$ is not covered by
alpar@3
   536
$M(s)\wedge\exists \tilde{u}\in{V_{small}: (u,\tilde{u})\in E_{small}}
alpar@3
   537
\wedge \tilde{u}$ is covered by $M(s)\}$, and
alpar@3
   538
\\ $\mathbf{T_{large}(s)}\!:=\!\{v \in\!V_{large}\!:\!v$ is not
alpar@3
   539
covered by
alpar@3
   540
$M(s)\wedge\!\exists\tilde{v}\!\in\!{V_{large}\!:\!(v,\tilde{v})\in\!E_{large}}
alpar@3
   541
\wedge \tilde{v}$ is covered by $M(s)\}$
alpar@2
   542
\end{notation}
alpar@2
   543
alpar@3
   544
The set $P(s)$ includes the pairs of uncovered neighbours of covered
Madarasi@17
   545
nodes, and if there is not such a node pair, all the pairs containing
alpar@3
   546
two uncovered nodes are added. Formally, let
alpar@2
   547
\[
alpar@2
   548
 P(s)\!=\!
alpar@2
   549
  \begin{cases} 
alpar@3
   550
   T_{small}(s)\times T_{large}(s)&\hspace{-0.15cm}\text{if }
alpar@3
   551
   T_{small}(s)\!\neq\!\emptyset\!\wedge\!T_{large}(s)\!\neq
alpar@3
   552
   \emptyset,\\ (V_{small}\!\setminus\!M_{small}(s))\!\times\!(V_{large}\!\setminus\!M_{large}(s))
alpar@3
   553
   &\hspace{-0.15cm}otherwise.
alpar@2
   554
  \end{cases}
alpar@2
   555
\]
alpar@2
   556
alpar@2
   557
\subsection{Consistency}
Madarasi@15
   558
Suppose $p=(u,v)$, where $u\in V_{small}$ and $v\in V_{large}$, $s$ is
Madarasi@15
   559
a state of the matching procedure, $M(s)$ is consistent mapping by
Madarasi@15
   560
$PT$ and $lab(u)=lab(v)$.  $Cons_{PT}(p,M(s))$ checks whether
Madarasi@15
   561
including pair $p$ into $M(s)$ leads to a consistent mapping by $PT$.
Madarasi@15
   562
Madarasi@15
   563
For example, the consistency function of induced subgraph isomorphism is as follows.
alpar@2
   564
\begin{notation}
alpar@3
   565
Let $\mathbf{\Gamma_{small} (u)}:=\{\tilde{u}\in V_{small} :
Madarasi@17
   566
(u,\tilde{u})\in E_{small}\}$, and $\mathbf{\Gamma_{large}
Madarasi@17
   567
  (v)}:=\{\tilde{v}\in V_{large} : (v,\tilde{v})\in E_{large}\}$, where $u\in V_{small}$ and $v\in V_{large}$.
alpar@2
   568
\end{notation}
alpar@2
   569
alpar@3
   570
$M(s)\cup \{(u,v)\}$ is a consistent mapping by $IND$ $\Leftrightarrow
alpar@3
   571
(\forall \tilde{u}\in M_{small}: (u,\tilde{u})\in E_{small}
Madarasi@15
   572
\Leftrightarrow (v,Pair(M(s),\tilde{u}))\in E_{large})$. The
alpar@3
   573
following formulation gives an efficient way of calculating
alpar@3
   574
$Cons_{IND}$.
alpar@2
   575
\begin{claim}
alpar@3
   576
$Cons_{IND}((u,v),M(s)):=(\forall \tilde{v}\in \Gamma_{large}(v)
alpar@3
   577
  \ \cap\ M_{large}(s):\\(Pair(M(s),\tilde{v}),u)\in E_{small})\wedge
alpar@3
   578
  (\forall \tilde{u}\in \Gamma_{small}(u)
alpar@3
   579
  \ \cap\ M_{small}(s):(v,Pair(M(s),\tilde{u}))\in E_{large})$ is a
alpar@3
   580
  consistency function in the case of $IND$.
alpar@2
   581
\end{claim}
alpar@2
   582
alpar@2
   583
\subsection{Cutting rules}
alpar@3
   584
$Cut_{PT}(p,M(s))$ is defined by a collection of efficiently
alpar@3
   585
verifiable conditions. The requirement is that $Cut_{PT}(p,M(s))$ can
alpar@3
   586
be true only if it is impossible to extended $M(s)\cup \{p\}$ to a
alpar@3
   587
whole mapping.
Madarasi@15
   588
Madarasi@15
   589
As an example, the cutting function of induced subgraph isomorphism is presented.
alpar@2
   590
\begin{notation}
alpar@3
   591
Let $\mathbf{\tilde{T}_{small}}(s):=(V_{small}\backslash
alpar@3
   592
M_{small}(s))\backslash T_{small}(s)$, and
alpar@3
   593
\\ $\mathbf{\tilde{T}_{large}}(s):=(V_{large}\backslash
alpar@3
   594
M_{large}(s))\backslash T_{large}(s)$.
alpar@2
   595
\end{notation}
Madarasi@15
   596
alpar@2
   597
\begin{claim}
alpar@3
   598
$Cut_{IND}((u,v),M(s)):= |\Gamma_{large} (v)\ \cap\ T_{large}(s)| <
alpar@3
   599
  |\Gamma_{small} (u)\ \cap\ T_{small}(s)| \vee |\Gamma_{large}(v)\cap
alpar@3
   600
  \tilde{T}_{large}(s)| < |\Gamma_{small}(u)\cap
alpar@3
   601
  \tilde{T}_{small}(s)|$ is a cutting function by $IND$.
alpar@2
   602
\end{claim}
alpar@2
   603
alpar@2
   604
alpar@2
   605
\section{The VF2++ Algorithm}
alpar@3
   606
Although any total ordering relation makes the search space of VF2 a
alpar@3
   607
tree, its choice turns out to dramatically influence the number of
alpar@3
   608
visited states. The goal is to determine an efficient one as quickly
alpar@3
   609
as possible.
alpar@2
   610
alpar@3
   611
The main reason for VF2++' superiority over VF2 is twofold. Firstly,
alpar@3
   612
taking into account the structure and the node labeling of the graph,
alpar@3
   613
VF2++ determines a state order in which most of the unfruitful
alpar@3
   614
branches of the search space can be pruned immediately. Secondly,
alpar@3
   615
introducing more efficient --- nevertheless still easier to compute
alpar@3
   616
--- cutting rules reduces the chance of going astray even further.
alpar@2
   617
alpar@3
   618
In addition to the usual subgraph isomorphism, specialized versions
alpar@3
   619
for induced subgraph isomorphism and for graph isomorphism have been
alpar@3
   620
designed. VF2++ has gained a runtime improvement of one order of
alpar@3
   621
magnitude respecting induced subgraph isomorphism and a better
alpar@3
   622
asymptotical behaviour in the case of graph isomorphism problem.
alpar@2
   623
alpar@3
   624
Note that a weaker version of the cutting rules and the more efficient
alpar@3
   625
candidate set calculating were described in \cite{VF2Plus}, too.
alpar@2
   626
alpar@3
   627
It should be noted that all the methods described in this section are
alpar@3
   628
extendable to handle directed graphs and edge labels as well.
alpar@2
   629
alpar@3
   630
The basic ideas and the detailed description of VF2++ are provided in
alpar@3
   631
the following.
alpar@2
   632
alpar@2
   633
\subsection{Preparations}
alpar@2
   634
\begin{claim}
alpar@2
   635
\label{claim:claimCoverFromLeft}
alpar@3
   636
The total ordering relation uniquely determines a node order, in which
alpar@3
   637
the nodes of $V_{small}$ will be covered by VF2. From the point of
alpar@3
   638
view of the matching procedure, this means, that always the same node
alpar@3
   639
of $G_{small}$ will be covered on the d-th level.
alpar@2
   640
\end{claim}
alpar@2
   641
alpar@2
   642
\begin{definition}
alpar@3
   643
An order $(u_{\sigma(1)},u_{\sigma(2)},..,u_{\sigma(|V_{small}|)})$ of
Madarasi@17
   644
$V_{small}$ is \textbf{matching order} if exists $\prec$ total
alpar@3
   645
ordering relation, s.t. the VF2 with $\prec$ on the d-th level finds
alpar@3
   646
pair for $u_{\sigma(d)}$ for all $d\in\{1,..,|V_{small}|\}$.
alpar@2
   647
\end{definition}
alpar@2
   648
alpar@2
   649
\begin{claim}\label{claim:MOclaim}
Madarasi@17
   650
A total ordering is matching order iff the nodes of every component
alpar@3
   651
form an interval in the node sequence, and every node connects to a
Madarasi@17
   652
previous node in its component except the first node of each component.
alpar@2
   653
\end{claim}
alpar@2
   654
alpar@3
   655
To summing up, a total ordering always uniquely determines a matching
alpar@3
   656
order, and every matching order can be determined by a total ordering,
alpar@3
   657
however, more than one different total orderings may determine the
alpar@3
   658
same matching order.
alpar@2
   659
\subsection{Idea behind the algorithm}
alpar@3
   660
The goal is to find a matching order in which the algorithm is able to
alpar@3
   661
recognize inconsistency or prune the infeasible branches on the
alpar@3
   662
highest levels and goes deep only if it is needed.
alpar@2
   663
alpar@2
   664
\begin{notation}
alpar@3
   665
Let $\mathbf{Conn_{H}(u)}:=|\Gamma_{small}(u)\cap H\}|$, that is the
alpar@3
   666
number of neighbours of u which are in H, where $u\in V_{small} $ and
alpar@3
   667
$H\subseteq V_{small}$.
alpar@2
   668
\end{notation}
alpar@2
   669
alpar@3
   670
The principal question is the following. Suppose a state $s$ is
alpar@3
   671
given. For which node of $T_{small}(s)$ is the hardest to find a
alpar@3
   672
consistent pair in $G_{large}$? The more covered neighbours a node in
alpar@3
   673
$T_{small}(s)$ has --- i.e. the largest $Conn_{M_{small}(s)}$ it has
alpar@3
   674
---, the more rarely satisfiable consistency constraints for its pair
alpar@3
   675
are given.
alpar@2
   676
alpar@3
   677
In biology, most of the graphs are sparse, thus several nodes in
alpar@3
   678
$T_{small}(s)$ may have the same $Conn_{M_{small}(s)}$, which makes
alpar@3
   679
reasonable to define a secondary and a tertiary order between them.
alpar@3
   680
The observation above proves itself to be as determining, that the
alpar@3
   681
secondary ordering prefers nodes with the most uncovered neighbours
alpar@3
   682
among which have the same $Conn_{M_{small}(s)}$ to increase
alpar@3
   683
$Conn_{M_{small}(s)}$ of uncovered nodes so much, as possible.  The
alpar@3
   684
tertiary ordering prefers nodes having the rarest uncovered labels.
alpar@2
   685
alpar@3
   686
Note that the secondary ordering is the same as the ordering by $deg$,
alpar@3
   687
which is a static data in front of the above used.
alpar@2
   688
alpar@3
   689
These rules can easily result in a matching order which contains the
alpar@3
   690
nodes of a long path successively, whose nodes may have low $Conn$ and
alpar@3
   691
is easily matchable into $G_{large}$. To avoid that, a BFS order is
alpar@3
   692
used, which provides the shortest possible paths.
alpar@2
   693
\newline
alpar@2
   694
alpar@3
   695
In the following, some examples on which the VF2 may be slow are
alpar@3
   696
described, although they are easily solvable by using a proper
alpar@3
   697
matching order.
alpar@2
   698
alpar@2
   699
\begin{example}
alpar@3
   700
Suppose $G_{small}$ can be mapped into $G_{large}$ in many ways
alpar@3
   701
without node labels. Let $u\in V_{small}$ and $v\in V_{large}$.
alpar@2
   702
\newline
alpar@2
   703
$lab(u):=black$
alpar@2
   704
\newline
alpar@2
   705
$lab(v):=black$
alpar@2
   706
\newline
alpar@3
   707
$lab(\tilde{u}):=red \ \forall \tilde{u}\in (V_{small}\backslash
alpar@3
   708
\{u\})$
alpar@2
   709
\newline
alpar@3
   710
$lab(\tilde{v}):=red \ \forall \tilde{v}\in (V_{large}\backslash
alpar@3
   711
\{v\})$
alpar@2
   712
\newline
alpar@2
   713
alpar@3
   714
Now, any mapping by the node label $lab$ must contain $(u,v)$, since
alpar@3
   715
$u$ is black and no node in $V_{large}$ has a black label except
alpar@3
   716
$v$. If unfortunately $u$ were the last node which will get covered,
alpar@3
   717
VF2 would check only in the last steps, whether $u$ can be matched to
alpar@3
   718
$v$.
alpar@2
   719
\newline
alpar@3
   720
However, had $u$ been the first matched node, u would have been
alpar@3
   721
matched immediately to v, so all the mappings would have been
alpar@3
   722
precluded in which node labels can not correspond.
alpar@2
   723
\end{example}
alpar@2
   724
alpar@2
   725
\begin{example}
alpar@3
   726
Suppose there is no node label given, $G_{small}$ is a small graph and
alpar@3
   727
can not be mapped into $G_{large}$ and $u\in V_{small}$.
alpar@2
   728
\newline
alpar@3
   729
Let $G'_{small}:=(V_{small}\cup
alpar@3
   730
\{u'_{1},u'_{2},..,u'_{k}\},E_{small}\cup
alpar@3
   731
\{(u,u'_{1}),(u'_{1},u'_{2}),..,(u'_{k-1},u'_{k})\})$, that is,
alpar@3
   732
$G'_{small}$ is $G_{small}\cup \{ a\ k$ long path, which is disjoint
alpar@3
   733
from $G_{small}$ and one of its starting points is connected to $u\in
alpar@3
   734
V_{small}\}$.
alpar@2
   735
\newline
alpar@3
   736
Is there a subgraph of $G_{large}$, which is isomorph with
alpar@3
   737
$G'_{small}$?
alpar@2
   738
\newline
alpar@3
   739
If unfortunately the nodes of the path were the first $k$ nodes in the
alpar@3
   740
matching order, the algorithm would iterate through all the possible k
alpar@3
   741
long paths in $G_{large}$, and it would recognize that no path can be
alpar@3
   742
extended to $G'_{small}$.
alpar@2
   743
\newline
alpar@3
   744
However, had it started by the matching of $G_{small}$, it would not
alpar@3
   745
have matched any nodes of the path.
alpar@2
   746
\end{example}
alpar@2
   747
alpar@3
   748
These examples may look artificial, but the same problems also appear
Madarasi@7
   749
in real-world instances, even though in a less obvious way.
alpar@2
   750
alpar@2
   751
\subsection{Total ordering}
alpar@3
   752
Instead of the total ordering relation, the matching order will be
alpar@3
   753
searched directly.
alpar@2
   754
\begin{notation}
alpar@3
   755
Let \textbf{F$_\mathcal{M}$(l)}$:=|\{v\in V_{large} :
alpar@3
   756
l=lab(v)\}|-|\{u\in V_{small}\backslash \mathcal{M} : l=lab(u)\}|$ ,
alpar@3
   757
where $l$ is a label and $\mathcal{M}\subseteq V_{small}$.
alpar@2
   758
\end{notation}
alpar@2
   759
Madarasi@17
   760
\begin{definition}Let $\mathbf{arg\ max}_{f}(S) :=\{u\in S : f(u)=max_{v\in S}\{f(v)\}\}$ and $\mathbf{arg\ min}_{f}(S) := arg\ max_{-f}(S)$, where $S$ is a finite set and $f:S\longrightarrow \mathbb{R}$.
alpar@2
   761
\end{definition}
alpar@2
   762
alpar@2
   763
\begin{algorithm}
Madarasi@8
   764
\algtext*{EndIf}
Madarasi@8
   765
\algtext*{EndProcedure}
alpar@2
   766
\algtext*{EndWhile}
Madarasi@13
   767
\algtext*{EndFor}
alpar@2
   768
\caption{\hspace{0.5cm}$The\ method\ of\ VF2++\ for\ determining\ the\ node\ order$}\label{alg:VF2PPPseu}
alpar@2
   769
\begin{algorithmic}[1]
alpar@3
   770
\Procedure{VF2++order}{} \State $\mathcal{M}$ := $\emptyset$
alpar@3
   771
\Comment{matching order} \While{$V_{small}\backslash \mathcal{M}
alpar@3
   772
  \neq\emptyset$} \State $r\in$ arg max$_{deg}$ (arg
alpar@3
   773
min$_{F_\mathcal{M}\circ lab}(V_{small}\backslash
alpar@3
   774
\mathcal{M})$)\label{alg:findMin} \State Compute $T$, a BFS tree with
alpar@3
   775
root node $r$.  \For{$d=0,1,...,depth(T)$} \State $V_d$:=nodes of the
alpar@3
   776
$d$-th level \State Process $V_d$ \Comment{See Algorithm
Madarasi@8
   777
  \ref{alg:VF2PPProcess1}} \EndFor
alpar@3
   778
\EndWhile \EndProcedure
alpar@2
   779
\end{algorithmic}
alpar@2
   780
\end{algorithm}
alpar@2
   781
alpar@2
   782
\begin{algorithm}
Madarasi@8
   783
\algtext*{EndIf}
Madarasi@8
   784
\algtext*{EndProcedure}%ne nyomtasson ..
alpar@2
   785
\algtext*{EndWhile}
Madarasi@8
   786
\caption{\hspace{.5cm}$The\ method\ for\ processing\ a\ level\ of\ the\ BFS\ tree$}\label{alg:VF2PPProcess1}
alpar@2
   787
\begin{algorithmic}[1]
Madarasi@17
   788
\Procedure{VF2++ProcessLevel}{$V_{d}$} \While{$V_d\neq\emptyset$}
alpar@3
   789
\State $m\in$ arg min$_{F_\mathcal{M}\circ\ lab}($ arg max$_{deg}($arg
alpar@3
   790
max$_{Conn_{\mathcal{M}}}(V_{d})))$ \State $V_d:=V_d\backslash m$
alpar@3
   791
\State Append node $m$ to the end of $\mathcal{M}$ \State Refresh
alpar@3
   792
$F_\mathcal{M}$ \EndWhile \EndProcedure
alpar@2
   793
\end{algorithmic}
alpar@2
   794
\end{algorithm}
alpar@2
   795
alpar@4
   796
Algorithm~\ref{alg:VF2PPPseu} is a high level description of the
alpar@4
   797
matching order procedure of VF2++. It computes a BFS tree for each
alpar@3
   798
component in ascending order of their rarest $lab$ and largest $deg$,
alpar@4
   799
whose root vertex is the component's minimal
Madarasi@8
   800
node. Algorithm~\ref{alg:VF2PPProcess1} is a method to process a level of the BFS tree, which appends the nodes of the current level in descending
Madarasi@8
   801
lexicographic order by $(Conn_{\mathcal{M}},deg,-F_\mathcal{M})$ separately
Madarasi@8
   802
to $\mathcal{M}$, and refreshes $F_\mathcal{M}$ immediately.
alpar@2
   803
alpar@4
   804
Claim~\ref{claim:MOclaim} shows that Algorithm~\ref{alg:VF2PPPseu}
alpar@4
   805
provides a matching order.
alpar@2
   806
alpar@2
   807
alpar@2
   808
\subsection{Cutting rules}
alpar@2
   809
\label{VF2PPCuttingRules}
Madarasi@16
   810
This section presents the cutting rule of VF2++ in the case of IND, which is improved
Madarasi@16
   811
by using extra information coming from the node labels. For other problem types, the rules can be formulated similarly.
alpar@2
   812
\begin{notation}
alpar@3
   813
Let $\mathbf{\Gamma_{small}^{l}(u)}:=\{\tilde{u} : lab(\tilde{u})=l
alpar@3
   814
\wedge \tilde{u}\in \Gamma_{small} (u)\}$ and
alpar@3
   815
$\mathbf{\Gamma_{large}^{l}(v)}:=\{\tilde{v} : lab(\tilde{v})=l \wedge
alpar@3
   816
\tilde{v}\in \Gamma_{large} (v)\}$, where $u\in V_{small}$, $v\in
alpar@3
   817
V_{large}$ and $l$ is a label.
alpar@2
   818
\end{notation}
alpar@2
   819
alpar@2
   820
\begin{claim}
alpar@2
   821
\[LabCut_{IND}((u,v),M(s))\!:=\!\!\!\!\!\bigvee_{l\ is\ label}\!\!\!\!\!\!\!|\Gamma_{large}^{l} (v) \cap T_{large}(s)|\!<\!|\Gamma_{small}^{l}(u)\cap T_{small}(s)|\ \vee\]\[\bigvee_{l\ is\ label} \newline |\Gamma_{large}^{l}(v)\cap \tilde{T}_{large}(s)| < |\Gamma_{small}^{l}(u)\cap \tilde{T}_{small}(s)|\] is a cutting function by IND.
alpar@2
   822
\end{claim}
Madarasi@13
   823
alpar@2
   824
alpar@2
   825
\subsection{Implementation details}
alpar@3
   826
This section provides a detailed summary of an efficient
alpar@3
   827
implementation of VF2++.
alpar@2
   828
\subsubsection{Storing a mapping}
alpar@3
   829
After fixing an arbitrary node order ($u_0, u_1, ..,
alpar@3
   830
u_{|G_{small}|-1}$) of $G_{small}$, an array $M$ is usable to store
alpar@3
   831
the current mapping in the following way.
alpar@2
   832
\[
alpar@3
   833
 M[i] =
alpar@2
   834
  \begin{cases} 
alpar@3
   835
   v & if\ (u_i,v)\ is\ in\ the\ mapping\\ INVALID &
Madarasi@17
   836
   if\ no\ node\ has\ been\ mapped\ to\ u_i,
alpar@2
   837
  \end{cases}
alpar@2
   838
\]
Madarasi@17
   839
where $i\in\{0,1, ..,|G_{small}|-1\}$, $v\in V_{large}$ and $INVALID$
alpar@3
   840
means "no node".
alpar@2
   841
\subsubsection{Avoiding the recurrence}
alpar@4
   842
The recursion of Algorithm~\ref{alg:VF2Pseu} can be realized
Madarasi@9
   843
as a \textit{while loop}, which has a loop counter $depth$ denoting the
Madarasi@9
   844
all-time depth of the recursion. Fixing a matching order, let $M$
Madarasi@9
   845
denote the array storing the all-time mapping. Based on Claim~\ref{claim:claimCoverFromLeft},
alpar@3
   846
$M$ is $INVALID$ from index $depth$+1 and not $INVALID$ before
Madarasi@9
   847
$depth$. $M[depth]$ changes
alpar@3
   848
while the state is being processed, but the property is held before
alpar@3
   849
both stepping back to a predecessor state and exploring a successor
alpar@3
   850
state.
alpar@2
   851
alpar@3
   852
The necessary part of the candidate set is easily maintainable or
alpar@3
   853
computable by following
alpar@4
   854
Section~\ref{candidateComputingVF2}. A much faster method
alpar@3
   855
has been designed for biological- and sparse graphs, see the next
alpar@3
   856
section for details.
alpar@2
   857
alpar@2
   858
\subsubsection{Calculating the candidates for a node}
alpar@4
   859
Being aware of Claim~\ref{claim:claimCoverFromLeft}, the
alpar@3
   860
task is not to maintain the candidate set, but to generate the
alpar@3
   861
candidate nodes in $G_{large}$ for a given node $u\in V_{small}$.  In
Madarasi@17
   862
case of any of the three problem types and a mapping $M$ if a node $v\in
alpar@3
   863
V_{large}$ is a potential pair of $u\in V_{small}$, then $\forall
alpar@3
   864
u'\in V_{small} : (u,u')\in
alpar@3
   865
E_{small}\ and\ u'\ is\ covered\ by\ M\ \Rightarrow (v,Pair(M,u'))\in
alpar@3
   866
E_{large}$. That is, each covered neighbour of $u$ has to be mapped to
alpar@3
   867
a covered neighbour of $v$.
alpar@2
   868
alpar@3
   869
Having said that, an algorithm running in $\Theta(deg)$ time is
alpar@3
   870
describable if there exists a covered node in the component containing
Madarasi@17
   871
$u$, and a linear one otherwise.
alpar@2
   872
alpar@2
   873
alpar@2
   874
\subsubsection{Determining the node order}
alpar@3
   875
This section describes how the node order preprocessing method of
alpar@3
   876
VF2++ can efficiently be implemented.
alpar@2
   877
alpar@3
   878
For using lookup tables, the node labels are associated with the
alpar@3
   879
numbers $\{0,1,..,|K|-1\}$, where $K$ is the set of the labels. It
Madarasi@9
   880
enables $F_\mathcal{M}$ to be stored in an array. At first, the node order
alpar@3
   881
$\mathcal{M}=\emptyset$, so $F_\mathcal{M}[i]$ is the number of nodes
alpar@3
   882
in $V_{small}$ having label i, which is easy to compute in
alpar@3
   883
$\Theta(|V_{small}|)$ steps.
alpar@2
   884
Madarasi@9
   885
Representing $\mathcal{M}\subseteq V_{small}$ as an array of
Madarasi@9
   886
size $|V_{small}|$, both the computation of the BFS tree, and processing its levels by Algorithm~\ref{alg:VF2PPProcess1} can be done inplace by swapping nodes.
alpar@2
   887
alpar@2
   888
\subsubsection{Cutting rules}
alpar@4
   889
In Section~\ref{VF2PPCuttingRules}, the cutting rules were
alpar@3
   890
described using the sets $T_{small}$, $T_{large}$, $\tilde T_{small}$
alpar@3
   891
and $\tilde T_{large}$, which are dependent on the all-time mapping
alpar@3
   892
(i.e. on the all-time state). The aim is to check the labeled cutting
alpar@3
   893
rules of VF2++ in $\Theta(deg)$ time.
alpar@2
   894
alpar@3
   895
Firstly, suppose that these four sets are given in such a way, that
alpar@3
   896
checking whether a node is in a certain set takes constant time,
alpar@3
   897
e.g. they are given by their 0-1 characteristic vectors. Let $L$ be an
alpar@3
   898
initially zero integer lookup table of size $|K|$. After incrementing
alpar@3
   899
$L[lab(u')]$ for all $u'\in \Gamma_{small}(u) \cap T_{small}(s)$ and
alpar@3
   900
decrementing $L[lab(v')]$ for all $v'\in\Gamma_{large} (v) \cap
alpar@3
   901
T_{large}(s)$, the first part of the cutting rules is checkable in
alpar@3
   902
$\Theta(deg)$ time by considering the proper signs of $L$. Setting $L$
alpar@3
   903
to zero takes $\Theta(deg)$ time again, which makes it possible to use
Madarasi@9
   904
the same table through the whole algorithm. The second part of the
alpar@3
   905
cutting rules can be verified using the same method with $\tilde
alpar@3
   906
T_{small}$ and $\tilde T_{large}$ instead of $T_{small}$ and
alpar@3
   907
$T_{large}$. Thus, the overall complexity is $\Theta(deg)$.
alpar@2
   908
alpar@3
   909
An other integer lookup table storing the number of covered neighbours
alpar@3
   910
of each node in $G_{large}$ gives all the information about the sets
alpar@3
   911
$T_{large}$ and $\tilde T_{large}$, which is maintainable in
alpar@3
   912
$\Theta(deg)$ time when a pair is added or substracted by incrementing
alpar@3
   913
or decrementing the proper indices. A further improvement is that the
alpar@3
   914
values of $L[lab(u')]$ in case of checking $u$ is dependent only on
alpar@3
   915
$u$, i.e. on the size of the mapping, so for each $u\in V_{small}$ an
alpar@3
   916
array of pairs (label, number of such labels) can be stored to skip
alpar@3
   917
the maintaining operations. Note that these arrays are at most of size
alpar@3
   918
$deg$. Skipping this trick, the number of covered neighbours has to be
alpar@3
   919
stored for each node of $G_{small}$ as well to get the sets
alpar@3
   920
$T_{small}$ and $\tilde T_{small}$.
alpar@2
   921
alpar@3
   922
Using similar tricks, the consistency function can be evaluated in
alpar@3
   923
$\Theta(deg)$ steps, as well.
alpar@2
   924
alpar@2
   925
\section{The VF2 Plus Algorithm}
alpar@3
   926
The VF2 Plus algorithm is a recently improved version of VF2. It was
alpar@3
   927
compared with the state of the art algorithms in \cite{VF2Plus} and
Madarasi@17
   928
has proved itself to be competitive with RI, the best algorithm on
alpar@3
   929
biological graphs.  \\ A short summary of VF2 Plus follows, which uses
alpar@3
   930
the notation and the conventions of the original paper.
alpar@2
   931
alpar@2
   932
\subsection{Ordering procedure}
alpar@3
   933
VF2 Plus uses a sorting procedure that prefers nodes in $V_{small}$
alpar@3
   934
with the lowest probability to find a pair in $V_{small}$ and the
alpar@3
   935
highest number of connections with the nodes already sorted by the
alpar@3
   936
algorithm.
alpar@2
   937
alpar@2
   938
\begin{definition}
Madarasi@17
   939
$(u,v)$ is a \textbf{feasible pair} if $lab(u)=lab(v)$ and
alpar@3
   940
  $deg(u)\leq deg(v)$, where $u\in{V_{small}}$ and $ v\in{V_{large}}$.
alpar@2
   941
\end{definition}
alpar@3
   942
$P_{lab}(L):=$ a priori probability to find a node with label $L$ in
alpar@3
   943
$V_{large}$
alpar@2
   944
\newline
alpar@3
   945
$P_{deg}(d):=$ a priori probability to find a node with degree $d$ in
alpar@3
   946
$V_{large}$
alpar@2
   947
\newline
alpar@3
   948
$P(u):=P_{lab}(L)*\bigcup_{d'>d}P_{deg}(d')$\\ $M$ is the set of
alpar@3
   949
already sorted nodes, $T$ is the set of nodes candidate to be
alpar@3
   950
selected, and $degreeM$ of a node is the number of its neighbours in
alpar@3
   951
$M$.
alpar@2
   952
\begin{algorithm}
Madarasi@17
   953
\algtext*{EndIf}%ne nyomtasson end if-et
Madarasi@17
   954
\algtext*{EndFor}%nenyomtasson ..  
Madarasi@17
   955
\algtext*{EndProcedure}%ne nyomtasson ..
alpar@2
   956
\algtext*{EndWhile}
alpar@2
   957
\caption{}\label{alg:VF2PlusPseu}
alpar@2
   958
\begin{algorithmic}[1]
alpar@3
   959
\Procedure{VF2 Plus order}{} \State Select the node with the lowest
alpar@3
   960
$P$.  \If {more nodes share the same $P$} \State select the one with
alpar@3
   961
maximum degree \EndIf \If {more nodes share the same $P$ and have the
alpar@3
   962
  max degree} \State select the first \EndIf \State Put the selected
alpar@3
   963
node in the set $M$. \label{alg:putIn} \State Put all its unsorted
alpar@3
   964
neighbours in the set $T$.  \If {$M\neq V_{small}$} \State From set
alpar@3
   965
$T$ select the node with maximum $degreeM$.  \If {more nodes have
alpar@3
   966
  maximum $degreeM$} \State Select the one with the lowest $P$ \EndIf
alpar@3
   967
\If {more nodes have maximum $degreeM$ and $P$} \State Select the
alpar@3
   968
first.  \EndIf \State \textbf{goto \ref{alg:putIn}.}  \EndIf
alpar@2
   969
\EndProcedure
alpar@2
   970
\end{algorithmic}
alpar@2
   971
\end{algorithm}
alpar@2
   972
alpar@4
   973
Using these notations, Algorithm~\ref{alg:VF2PlusPseu}
alpar@3
   974
provides the description of the sorting procedure.
alpar@2
   975
alpar@3
   976
Note that $P(u)$ is not the exact probability of finding a consistent
alpar@3
   977
pair for $u$ by choosing a node of $V_{large}$ randomly, since
alpar@3
   978
$P_{lab}$ and $P_{deg}$ are not independent, though calculating the
alpar@3
   979
real probability would take quadratic time, which may be reduced by
alpar@3
   980
using fittingly lookup tables.
alpar@2
   981
alpar@2
   982
\section{Experimental results}
alpar@3
   983
This section compares the performance of VF2++ and VF2 Plus. Both
alpar@3
   984
algorithms have run faster with orders of magnitude than VF2, thus its
alpar@3
   985
inclusion was not reasonable.
alpar@2
   986
\subsection{Biological graphs}
alpar@3
   987
The tests have been executed on a recent biological dataset created
alpar@3
   988
for the International Contest on Pattern Search in Biological
Madarasi@7
   989
Databases\cite{Content}, which has been constructed of molecule,
Madarasi@7
   990
protein and contact map graphs extracted from the Protein Data
alpar@3
   991
Bank\cite{ProteinDataBank}.
alpar@2
   992
alpar@3
   993
The molecule dataset contains small graphs with less than 100 nodes
alpar@3
   994
and an average degree of less than 3. The protein dataset contains
alpar@3
   995
graphs having 500-10 000 nodes and an average degree of 4, while the
alpar@3
   996
contact map dataset contains graphs with 150-800 nodes and an average
alpar@3
   997
degree of 20.  \\
alpar@2
   998
alpar@3
   999
In the following, the induced subgraph isomorphism and the graph
alpar@3
  1000
isomorphism will be examined.
alpar@2
  1001
Madarasi@17
  1002
This dataset provides graph pairs, between which all the induced subgraph isomorphisms have to be found. For runtime results, please see Figure~\ref{fig:bioIND}.
Madarasi@7
  1003
Madarasi@7
  1004
In an other experiment, the nodes of each graph in the database had been
Madarasi@7
  1005
shuffled, and an isomorphism between the shuffled and the original
Madarasi@7
  1006
graph was searched. The solution times are shown on Figure~\ref{fig:bioISO}.
Madarasi@7
  1007
Madarasi@7
  1008
Madarasi@17
  1009
\begin{figure}[H]
Madarasi@17
  1010
\vspace*{-2cm}
Madarasi@17
  1011
\hspace*{-1.5cm}
Madarasi@17
  1012
\begin{subfigure}[b]{0.55\textwidth}
Madarasi@17
  1013
\begin{figure}[H]
Madarasi@17
  1014
\begin{tikzpicture}[trim axis left, trim axis right]
Madarasi@17
  1015
\begin{axis}[title=Molecules IND,xlabel={target size},ylabel={time (ms)},legend entries={VF2 Plus,VF2++},grid
Madarasi@17
  1016
=major,mark size=1.2pt, legend style={at={(0,1)},anchor=north
Madarasi@17
  1017
  west},scaled x ticks = false,x tick label style={/pgf/number
Madarasi@17
  1018
  format/1000 sep = \thinspace}]
Madarasi@17
  1019
%\addplot+[only marks] table {proteinsOrig.txt};
Madarasi@17
  1020
\addplot table {Orig/Molecules.32.txt}; \addplot[mark=triangle*,mark
Madarasi@17
  1021
  size=1.8pt,color=red] table {VF2PPLabel/Molecules.32.txt};
Madarasi@17
  1022
\end{axis}
Madarasi@17
  1023
\end{tikzpicture}
Madarasi@17
  1024
\caption{In the case of molecules, the algorithms have
Madarasi@17
  1025
  similar behaviour, but VF2++ is almost two times faster even on such
Madarasi@17
  1026
  small graphs.} \label{fig:INDMolecule}
Madarasi@17
  1027
\end{figure}
Madarasi@17
  1028
\end{subfigure}
Madarasi@17
  1029
\hspace*{1.5cm}
Madarasi@17
  1030
\begin{subfigure}[b]{0.55\textwidth}
Madarasi@17
  1031
\begin{figure}[H]
Madarasi@17
  1032
\begin{tikzpicture}[trim axis left, trim axis right]
Madarasi@17
  1033
\begin{axis}[title=Contact maps IND,xlabel={target size},ylabel={time (ms)},legend entries={VF2 Plus,VF2++},grid
Madarasi@17
  1034
=major,mark size=1.2pt, legend style={at={(0,1)},anchor=north
Madarasi@17
  1035
  west},scaled x ticks = false,x tick label style={/pgf/number
Madarasi@17
  1036
  format/1000 sep = \thinspace}]
Madarasi@17
  1037
%\addplot+[only marks] table {proteinsOrig.txt};
Madarasi@17
  1038
\addplot table {Orig/ContactMaps.128.txt};
Madarasi@17
  1039
\addplot[mark=triangle*,mark size=1.8pt,color=red] table
Madarasi@17
  1040
        {VF2PPLabel/ContactMaps.128.txt};
Madarasi@17
  1041
\end{axis}
Madarasi@17
  1042
\end{tikzpicture}
Madarasi@17
  1043
\caption{On contact maps, VF2++ runs almost in constant time, while VF2
Madarasi@17
  1044
  Plus has a near linear behaviour.} \label{fig:INDContact}
Madarasi@17
  1045
\end{figure}
Madarasi@17
  1046
\end{subfigure}
Madarasi@17
  1047
Madarasi@17
  1048
\begin{center}
Madarasi@17
  1049
\vspace*{-0.5cm}
Madarasi@17
  1050
\begin{subfigure}[b]{0.55\textwidth}
Madarasi@17
  1051
\begin{figure}[H]
Madarasi@17
  1052
\begin{tikzpicture}[trim axis left, trim axis right]
Madarasi@17
  1053
  \begin{axis}[title=Proteins IND,xlabel={target size},ylabel={time (ms)},legend entries={VF2 Plus,VF2++},grid
Madarasi@17
  1054
  =major,mark size=1.2pt, legend style={at={(0,1)},anchor=north
Madarasi@17
  1055
    west},scaled x ticks = false,x tick label style={/pgf/number
Madarasi@17
  1056
    format/1000 sep = \thinspace}] %\addplot+[only marks] table
Madarasi@17
  1057
    {proteinsOrig.txt}; \addplot[mark=*,mark size=1.2pt,color=blue]
Madarasi@17
  1058
    table {Orig/Proteins.256.txt}; \addplot[mark=triangle*,mark
Madarasi@17
  1059
      size=1.8pt,color=red] table {VF2PPLabel/Proteins.256.txt};
Madarasi@17
  1060
  \end{axis}
Madarasi@17
  1061
  \end{tikzpicture}
Madarasi@17
  1062
\caption{Both the algorithms have linear behaviour on protein
Madarasi@17
  1063
  graphs. VF2++ is more than 10 times faster than VF2
Madarasi@17
  1064
  Plus.} \label{fig:INDProt}
Madarasi@17
  1065
\end{figure}
Madarasi@17
  1066
\end{subfigure}
Madarasi@17
  1067
\end{center}
Madarasi@17
  1068
\vspace*{-0.5cm}
Madarasi@17
  1069
\caption{\normalsize{Induced subgraph isomorphism on biological graphs}}\label{fig:bioIND}
Madarasi@17
  1070
\end{figure}
Madarasi@17
  1071
alpar@2
  1072
alpar@2
  1073
\begin{figure}[H]
Madarasi@7
  1074
\vspace*{-2cm}
Madarasi@7
  1075
\hspace*{-1.5cm}
Madarasi@7
  1076
\begin{subfigure}[b]{0.55\textwidth}
Madarasi@7
  1077
\begin{figure}[H]
Madarasi@7
  1078
\begin{tikzpicture}[trim axis left, trim axis right]
Madarasi@7
  1079
\begin{axis}[title=Molecules ISO,xlabel={target size},ylabel={time (ms)},legend entries={VF2 Plus,VF2++},grid
Madarasi@7
  1080
=major,mark size=1.2pt, legend style={at={(0,1)},anchor=north
Madarasi@7
  1081
  west},scaled x ticks = false,x tick label style={/pgf/number
Madarasi@7
  1082
  format/1000 sep = \thinspace}]
Madarasi@7
  1083
%\addplot+[only marks] table {proteinsOrig.txt};
Madarasi@7
  1084
\addplot table {Orig/moleculesIso.txt}; \addplot[mark=triangle*,mark
Madarasi@7
  1085
  size=1.8pt,color=red] table {VF2PPLabel/moleculesIso.txt};
Madarasi@7
  1086
\end{axis}
Madarasi@7
  1087
\end{tikzpicture}
Madarasi@7
  1088
\caption{In the case of molecules, there is not such a significant
Madarasi@7
  1089
  difference, but VF2++ seems to be faster as the number of nodes
Madarasi@7
  1090
  increases.}\label{fig:ISOMolecule}
Madarasi@7
  1091
\end{figure}
Madarasi@7
  1092
\end{subfigure}
Madarasi@7
  1093
\hspace*{1.5cm}
Madarasi@7
  1094
\begin{subfigure}[b]{0.55\textwidth}
Madarasi@7
  1095
\begin{figure}[H]
Madarasi@7
  1096
\begin{tikzpicture}[trim axis left, trim axis right]
Madarasi@7
  1097
\begin{axis}[title=Contact maps ISO,xlabel={target size},ylabel={time (ms)},legend entries={VF2 Plus,VF2++},grid
Madarasi@7
  1098
=major,mark size=1.2pt, legend style={at={(0,1)},anchor=north
Madarasi@7
  1099
  west},scaled x ticks = false,x tick label style={/pgf/number
Madarasi@7
  1100
  format/1000 sep = \thinspace}]
Madarasi@7
  1101
%\addplot+[only marks] table {proteinsOrig.txt};
Madarasi@7
  1102
\addplot table {Orig/contactMapsIso.txt}; \addplot[mark=triangle*,mark
Madarasi@7
  1103
  size=1.8pt,color=red] table {VF2PPLabel/contactMapsIso.txt};
Madarasi@7
  1104
\end{axis}
Madarasi@7
  1105
\end{tikzpicture}
Madarasi@7
  1106
\caption{The results are closer to each other on contact maps, but
Madarasi@7
  1107
  VF2++ still performs consistently better.}\label{fig:ISOContact}
Madarasi@7
  1108
\end{figure}
Madarasi@7
  1109
\end{subfigure}
Madarasi@7
  1110
alpar@2
  1111
\begin{center}
Madarasi@7
  1112
\vspace*{-0.5cm}
Madarasi@7
  1113
\begin{subfigure}[b]{0.55\textwidth}
Madarasi@7
  1114
\begin{figure}[H]
Madarasi@7
  1115
\begin{tikzpicture}[trim axis left, trim axis right]
Madarasi@7
  1116
\begin{axis}[title=Proteins ISO,xlabel={target size},ylabel={time (ms)},legend entries={VF2 Plus,VF2++},grid
Madarasi@7
  1117
=major,mark size=1.2pt, legend style={at={(0,1)},anchor=north
Madarasi@7
  1118
  west},scaled x ticks = false,x tick label style={/pgf/number
Madarasi@7
  1119
  format/1000 sep = \thinspace}]
Madarasi@7
  1120
%\addplot+[only marks] table {proteinsOrig.txt};
Madarasi@7
  1121
\addplot table {Orig/proteinsIso.txt}; \addplot[mark=triangle*,mark
Madarasi@7
  1122
  size=1.8pt,color=red] table {VF2PPLabel/proteinsIso.txt};
Madarasi@7
  1123
\end{axis}
Madarasi@7
  1124
\end{tikzpicture}
Madarasi@7
  1125
\caption{On protein graphs, VF2 Plus has a super linear time
Madarasi@7
  1126
  complexity, while VF2++ runs in near constant time. The difference
Madarasi@7
  1127
  is about two order of magnitude on large graphs.}\label{fig:ISOProt}
Madarasi@7
  1128
\end{figure}
Madarasi@7
  1129
\end{subfigure}
Madarasi@7
  1130
\end{center}
Madarasi@7
  1131
\vspace*{-0.6cm}
Madarasi@17
  1132
\caption{\normalsize{Graph isomorphism on biological graphs}}\label{fig:bioISO}
Madarasi@7
  1133
\end{figure}
Madarasi@7
  1134
Madarasi@7
  1135
alpar@2
  1136
alpar@2
  1137
alpar@2
  1138
\subsection{Random graphs}
alpar@3
  1139
This section compares VF2++ with VF2 Plus on random graphs of a large
alpar@3
  1140
size. The node labels are uniformly distributed.  Let $\delta$ denote
alpar@3
  1141
the average degree.  For the parameters of problems solved in the
alpar@3
  1142
experiments, please see the top of each chart.
alpar@2
  1143
\subsubsection{Graph isomorphism}
alpar@3
  1144
To evaluate the efficiency of the algorithms in the case of graph
Madarasi@17
  1145
isomorphism, random connected graphs of less than 20 000 nodes have been
alpar@3
  1146
considered. Generating a random graph and shuffling its nodes, an
Madarasi@7
  1147
isomorphism had to be found. Figure \ref{fig:randISO} shows the runtime results
alpar@4
  1148
on graph sets of various density.
alpar@2
  1149
Madarasi@7
  1150
Madarasi@7
  1151
Madarasi@7
  1152
Madarasi@12
  1153
\begin{figure}
Madarasi@7
  1154
\vspace*{-1.5cm}
Madarasi@7
  1155
\hspace*{-1.5cm}
Madarasi@7
  1156
\begin{subfigure}[b]{0.55\textwidth}
alpar@2
  1157
\begin{center}
alpar@2
  1158
\begin{tikzpicture}
Madarasi@7
  1159
\begin{axis}[title={Random ISO, $\delta = 5$},width=7.2cm,height=6cm,xlabel={target size},ylabel={time (ms)},ylabel near ticks,legend entries={VF2 Plus,VF2++},grid
alpar@3
  1160
=major,mark size=1.2pt, legend style={at={(0,1)},anchor=north
alpar@3
  1161
  west},scaled x ticks = false,x tick label style={/pgf/number
Madarasi@7
  1162
  format/1000 sep = \space}]
alpar@2
  1163
%\addplot+[only marks] table {proteinsOrig.txt};
alpar@2
  1164
\addplot table {randGraph/iso/vf2pIso5_1.txt};
alpar@3
  1165
\addplot[mark=triangle*,mark size=1.8pt,color=red] table
alpar@3
  1166
        {randGraph/iso/vf2ppIso5_1.txt};
alpar@2
  1167
\end{axis}
alpar@2
  1168
\end{tikzpicture}
alpar@2
  1169
\end{center}
Madarasi@7
  1170
\end{subfigure}
Madarasi@7
  1171
%\hspace{1cm}
Madarasi@7
  1172
\begin{subfigure}[b]{0.55\textwidth}
alpar@2
  1173
\begin{center}
alpar@2
  1174
\begin{tikzpicture}
Madarasi@7
  1175
\begin{axis}[title={Random ISO, $\delta = 10$},width=7.2cm,height=6cm,xlabel={target size},ylabel={time (ms)},ylabel near ticks,legend entries={VF2 Plus,VF2++},grid
alpar@3
  1176
=major,mark size=1.2pt, legend style={at={(0,1)},anchor=north
alpar@3
  1177
  west},scaled x ticks = false,x tick label style={/pgf/number
Madarasi@7
  1178
  format/1000 sep = \space}]
alpar@2
  1179
%\addplot+[only marks] table {proteinsOrig.txt};
alpar@2
  1180
\addplot table {randGraph/iso/vf2pIso10_1.txt};
alpar@3
  1181
\addplot[mark=triangle*,mark size=1.8pt,color=red] table
alpar@3
  1182
        {randGraph/iso/vf2ppIso10_1.txt};
alpar@2
  1183
\end{axis}
alpar@2
  1184
\end{tikzpicture}
alpar@2
  1185
\end{center}
Madarasi@7
  1186
\end{subfigure}
Madarasi@7
  1187
%%\hspace{1cm}
Madarasi@7
  1188
\hspace*{-1.5cm}
Madarasi@7
  1189
\begin{subfigure}[b]{0.55\textwidth}
alpar@2
  1190
\begin{center}
alpar@2
  1191
\begin{tikzpicture}
Madarasi@7
  1192
\begin{axis}[title={Random ISO, $\delta = 15$},width=7.2cm,height=6cm,xlabel={target size},ylabel={time (ms)},ylabel near ticks,legend entries={VF2 Plus,VF2++},grid
alpar@3
  1193
=major,mark size=1.2pt, legend style={at={(0,1)},anchor=north
alpar@3
  1194
  west},scaled x ticks = false,x tick label style={/pgf/number
Madarasi@7
  1195
  format/1000 sep = \space}]
alpar@2
  1196
%\addplot+[only marks] table {proteinsOrig.txt};
alpar@2
  1197
\addplot table {randGraph/iso/vf2pIso15_1.txt};
alpar@3
  1198
\addplot[mark=triangle*,mark size=1.8pt,color=red] table
alpar@3
  1199
        {randGraph/iso/vf2ppIso15_1.txt};
alpar@2
  1200
\end{axis}
alpar@2
  1201
\end{tikzpicture}
alpar@2
  1202
\end{center}
Madarasi@7
  1203
     \end{subfigure}
Madarasi@7
  1204
     \begin{subfigure}[b]{0.55\textwidth}
alpar@2
  1205
\begin{center}
alpar@2
  1206
\begin{tikzpicture}
Madarasi@7
  1207
\begin{axis}[title={Random ISO, $\delta = 35$},width=7.2cm,height=6cm,xlabel={target size},ylabel={time (ms)},ylabel near ticks,legend entries={VF2 Plus,VF2++},grid
alpar@3
  1208
=major,mark size=1.2pt, legend style={at={(0,1)},anchor=north
alpar@3
  1209
  west},scaled x ticks = false,x tick label style={/pgf/number
Madarasi@7
  1210
  format/1000 sep = \space}]
alpar@2
  1211
%\addplot+[only marks] table {proteinsOrig.txt};
alpar@2
  1212
\addplot table {randGraph/iso/vf2pIso35_1.txt};
alpar@3
  1213
\addplot[mark=triangle*,mark size=1.8pt,color=red] table
alpar@3
  1214
        {randGraph/iso/vf2ppIso35_1.txt};
alpar@2
  1215
\end{axis}
alpar@2
  1216
\end{tikzpicture}
alpar@2
  1217
\end{center}
Madarasi@7
  1218
\end{subfigure}
Madarasi@7
  1219
\begin{subfigure}[b]{0.55\textwidth}
Madarasi@7
  1220
\hspace*{-1.5cm}
alpar@2
  1221
\begin{tikzpicture}
Madarasi@7
  1222
\begin{axis}[title={Random ISO, $\delta = 45$},width=7.2cm,height=6cm,xlabel={target size},ylabel={time (ms)},ylabel near ticks,legend entries={VF2 Plus,VF2++},grid
alpar@3
  1223
=major,mark size=1.2pt, legend style={at={(0,1)},anchor=north
alpar@3
  1224
  west},scaled x ticks = false,x tick label style={/pgf/number
Madarasi@7
  1225
  format/1000 sep = \space}]
alpar@2
  1226
%\addplot+[only marks] table {proteinsOrig.txt};
alpar@2
  1227
\addplot table {randGraph/iso/vf2pIso45_1.txt};
alpar@3
  1228
\addplot[mark=triangle*,mark size=1.8pt,color=red] table
alpar@3
  1229
        {randGraph/iso/vf2ppIso45_1.txt};
alpar@2
  1230
\end{axis}
alpar@2
  1231
\end{tikzpicture}
Madarasi@7
  1232
\end{subfigure}
Madarasi@7
  1233
\hspace*{-1.5cm}
Madarasi@7
  1234
\begin{subfigure}[b]{0.55\textwidth}
alpar@2
  1235
\begin{tikzpicture}
Madarasi@7
  1236
\begin{axis}[title={Random ISO, $\delta = 100$},width=7.2cm,height=6cm,xlabel={target size},ylabel={time (ms)},ylabel near ticks,legend entries={VF2 Plus,VF2++},grid
alpar@3
  1237
=major,mark size=1.2pt, legend style={at={(0,1)},anchor=north
alpar@3
  1238
  west},scaled x ticks = false,x tick label style={/pgf/number
alpar@3
  1239
  format/1000 sep = \thinspace}]
alpar@2
  1240
%\addplot+[only marks] table {proteinsOrig.txt};
alpar@2
  1241
\addplot table {randGraph/iso/vf2pIso100_1.txt};
alpar@3
  1242
\addplot[mark=triangle*,mark size=1.8pt,color=red] table
alpar@3
  1243
        {randGraph/iso/vf2ppIso100_1.txt};
alpar@2
  1244
\end{axis}
alpar@2
  1245
\end{tikzpicture}
Madarasi@7
  1246
\end{subfigure}
alpar@2
  1247
\vspace*{-0.8cm}
Madarasi@7
  1248
\caption{IND on graphs having an average degree of
Madarasi@7
  1249
  5.}\label{fig:randISO}
alpar@2
  1250
\end{figure}
alpar@2
  1251
alpar@2
  1252
alpar@2
  1253
\subsubsection{Induced subgraph isomorphism}
Madarasi@17
  1254
This section presents a comparison of VF2++ and VF2 Plus in the case
alpar@3
  1255
of induced subgraph isomorphism. In addition to the size of the large
alpar@3
  1256
graph, that of the small graph dramatically influences the hardness of
alpar@3
  1257
a given problem too, so the overall picture is provided by examining
alpar@3
  1258
small graphs of various size.
alpar@2
  1259
Madarasi@17
  1260
For each chart, a number $0<\rho< 1$ has been fixed, and the following
Madarasi@17
  1261
has been executed 150 times. Generating a large graph $G_{large}$ of an average degree of $\delta$,
alpar@3
  1262
choose 10 of its induced subgraphs having $\rho\ |V_{large}|$ nodes,
alpar@3
  1263
and for all the 10 subgraphs find a mapping by using both the graph
alpar@3
  1264
matching algorithms.  The $\delta = 5, 10, 35$ and $\rho = 0.05, 0.1,
Madarasi@10
  1265
0.3, 0.6, 0.8, 0.95$ cases have been examined, see
alpar@4
  1266
Figure~\ref{fig:randIND5}, \ref{fig:randIND10} and
Madarasi@10
  1267
\ref{fig:randIND35}.
alpar@2
  1268
alpar@2
  1269
alpar@2
  1270
alpar@2
  1271
alpar@2
  1272
Madarasi@12
  1273
\begin{figure}
Madarasi@7
  1274
\vspace*{-1.5cm}
Madarasi@7
  1275
\hspace*{-1.5cm}
alpar@2
  1276
\begin{subfigure}[b]{0.55\textwidth}
alpar@2
  1277
\begin{center}
alpar@2
  1278
\begin{tikzpicture}
alpar@2
  1279
\begin{axis}[title={Random IND, $\delta = 5$, $\rho = 0.05$},width=7.2cm,height=6cm,xlabel={target size},ylabel={time (ms)},ylabel near ticks,legend entries={VF2 Plus,VF2++},grid
alpar@3
  1280
=major,mark size=1.2pt, legend style={at={(0,1)},anchor=north
alpar@3
  1281
  west},scaled x ticks = false,x tick label style={/pgf/number
alpar@3
  1282
  format/1000 sep = \space}]
alpar@2
  1283
%\addplot+[only marks] table {proteinsOrig.txt};
alpar@2
  1284
\addplot table {randGraph/ind/vf2pInd5_0.05.txt};
alpar@3
  1285
\addplot[mark=triangle*,mark size=1.8pt,color=red] table
alpar@3
  1286
        {randGraph/ind/vf2ppInd5_0.05.txt};
alpar@2
  1287
\end{axis}
alpar@2
  1288
\end{tikzpicture}
alpar@2
  1289
\end{center}
alpar@2
  1290
     \end{subfigure}
alpar@2
  1291
     \begin{subfigure}[b]{0.55\textwidth}
alpar@2
  1292
\begin{center}
alpar@2
  1293
\begin{tikzpicture}
alpar@2
  1294
\begin{axis}[title={Random IND, $\delta = 5$, $\rho = 0.1$},width=7.2cm,height=6cm,xlabel={target size},ylabel={time (ms)},ylabel near ticks,legend entries={VF2 Plus,VF2++},grid
alpar@3
  1295
=major,mark size=1.2pt, legend style={at={(0,1)},anchor=north
alpar@3
  1296
  west},scaled x ticks = false,x tick label style={/pgf/number
alpar@3
  1297
  format/1000 sep = \space}]
alpar@2
  1298
%\addplot+[only marks] table {proteinsOrig.txt};
alpar@2
  1299
\addplot table {randGraph/ind/vf2pInd5_0.1.txt};
alpar@3
  1300
\addplot[mark=triangle*,mark size=1.8pt,color=red] table
alpar@3
  1301
        {randGraph/ind/vf2ppInd5_0.1.txt};
alpar@2
  1302
\end{axis}
alpar@2
  1303
\end{tikzpicture}
alpar@2
  1304
\end{center}
alpar@2
  1305
\end{subfigure}
Madarasi@7
  1306
\hspace*{-1.5cm}
alpar@2
  1307
\begin{subfigure}[b]{0.55\textwidth}
alpar@2
  1308
\begin{center}
alpar@2
  1309
\begin{tikzpicture}
alpar@2
  1310
\begin{axis}[title={Random IND, $\delta = 5$, $\rho = 0.3$},width=7.2cm,height=6cm,xlabel={target size},ylabel={time (ms)},ylabel near ticks,legend entries={VF2 Plus,VF2++},grid
alpar@3
  1311
=major,mark size=1.2pt, legend style={at={(0,1)},anchor=north
alpar@3
  1312
  west},scaled x ticks = false,x tick label style={/pgf/number
alpar@3
  1313
  format/1000 sep = \space}]
alpar@2
  1314
%\addplot+[only marks] table {proteinsOrig.txt};
alpar@2
  1315
\addplot table {randGraph/ind/vf2pInd5_0.3.txt};
alpar@3
  1316
\addplot[mark=triangle*,mark size=1.8pt,color=red] table
alpar@3
  1317
        {randGraph/ind/vf2ppInd5_0.3.txt};
alpar@2
  1318
\end{axis}
alpar@2
  1319
\end{tikzpicture}
alpar@2
  1320
\end{center}
alpar@2
  1321
     \end{subfigure}
alpar@2
  1322
     \begin{subfigure}[b]{0.55\textwidth}
alpar@2
  1323
\begin{center}
alpar@2
  1324
\begin{tikzpicture}
alpar@2
  1325
\begin{axis}[title={Random IND, $\delta = 5$, $\rho = 0.6$},width=7.2cm,height=6cm,xlabel={target size},ylabel={time (ms)},ylabel near ticks,legend entries={VF2 Plus,VF2++},grid
alpar@3
  1326
=major,mark size=1.2pt, legend style={at={(0,1)},anchor=north
alpar@3
  1327
  west},scaled x ticks = false,x tick label style={/pgf/number
alpar@3
  1328
  format/1000 sep = \space}]
alpar@2
  1329
%\addplot+[only marks] table {proteinsOrig.txt};
alpar@2
  1330
\addplot table {randGraph/ind/vf2pInd5_0.6.txt};
alpar@3
  1331
\addplot[mark=triangle*,mark size=1.8pt,color=red] table
alpar@3
  1332
        {randGraph/ind/vf2ppInd5_0.6.txt};
alpar@2
  1333
\end{axis}
alpar@2
  1334
\end{tikzpicture}
alpar@2
  1335
\end{center}
alpar@2
  1336
\end{subfigure}
alpar@2
  1337
\begin{subfigure}[b]{0.55\textwidth}
Madarasi@7
  1338
\hspace*{-1.5cm}
alpar@2
  1339
\begin{tikzpicture}
alpar@2
  1340
\begin{axis}[title={Random IND, $\delta = 5$, $\rho = 0.8$},width=7.2cm,height=6cm,xlabel={target size},ylabel={time (ms)},ylabel near ticks,legend entries={VF2 Plus,VF2++},grid
alpar@3
  1341
=major,mark size=1.2pt, legend style={at={(0,1)},anchor=north
alpar@3
  1342
  west},scaled x ticks = false,x tick label style={/pgf/number
alpar@3
  1343
  format/1000 sep = \space}]
alpar@2
  1344
%\addplot+[only marks] table {proteinsOrig.txt};
alpar@2
  1345
\addplot table {randGraph/ind/vf2pInd5_0.8.txt};
alpar@3
  1346
\addplot[mark=triangle*,mark size=1.8pt,color=red] table
alpar@3
  1347
        {randGraph/ind/vf2ppInd5_0.8.txt};
alpar@2
  1348
\end{axis}
alpar@2
  1349
\end{tikzpicture}
alpar@2
  1350
     \end{subfigure}
Madarasi@7
  1351
     \hspace*{-1.5cm}
alpar@2
  1352
     \begin{subfigure}[b]{0.55\textwidth}
alpar@2
  1353
\begin{tikzpicture}
alpar@2
  1354
\begin{axis}[title={Random IND, $\delta = 5$, $\rho = 0.95$},width=7.2cm,height=6cm,xlabel={target size},ylabel={time (ms)},ylabel near ticks,legend entries={VF2 Plus,VF2++},grid
alpar@3
  1355
=major,mark size=1.2pt, legend style={at={(0,1)},anchor=north
alpar@3
  1356
  west},scaled x ticks = false,x tick label style={/pgf/number
alpar@3
  1357
  format/1000 sep = \thinspace}]
alpar@2
  1358
%\addplot+[only marks] table {proteinsOrig.txt};
alpar@2
  1359
\addplot table {randGraph/ind/vf2pInd5_0.95.txt};
alpar@3
  1360
\addplot[mark=triangle*,mark size=1.8pt,color=red] table
alpar@3
  1361
        {randGraph/ind/vf2ppInd5_0.95.txt};
alpar@2
  1362
\end{axis}
alpar@2
  1363
\end{tikzpicture}
alpar@2
  1364
\end{subfigure}
alpar@2
  1365
\vspace*{-0.8cm}
alpar@3
  1366
\caption{IND on graphs having an average degree of
alpar@3
  1367
  5.}\label{fig:randIND5}
alpar@2
  1368
\end{figure}
alpar@2
  1369
alpar@2
  1370
alpar@2
  1371
\begin{figure}[H]
Madarasi@7
  1372
\vspace*{-1.5cm}
Madarasi@7
  1373
\hspace*{-1.5cm}
alpar@2
  1374
\begin{subfigure}[b]{0.55\textwidth}
alpar@2
  1375
\begin{center}
Madarasi@7
  1376
\hspace*{-0.5cm}
alpar@2
  1377
\begin{tikzpicture}
alpar@2
  1378
\begin{axis}[title={Random IND, $\delta = 10$, $\rho = 0.05$},width=7.2cm,height=6cm,xlabel={target size},ylabel={time (ms)},ylabel near ticks,legend entries={VF2 Plus,VF2++},grid
alpar@3
  1379
=major,mark size=1.2pt, legend style={at={(0,1)},anchor=north
alpar@3
  1380
  west},scaled x ticks = false,x tick label style={/pgf/number
alpar@3
  1381
  format/1000 sep = \space}]
alpar@2
  1382
%\addplot+[only marks] table {proteinsOrig.txt};
alpar@2
  1383
\addplot table {randGraph/ind/vf2pInd10_0.05.txt};
alpar@3
  1384
\addplot[mark=triangle*,mark size=1.8pt,color=red] table
alpar@3
  1385
        {randGraph/ind/vf2ppInd10_0.05.txt};
alpar@2
  1386
\end{axis}
alpar@2
  1387
\end{tikzpicture}
alpar@2
  1388
\end{center}
alpar@2
  1389
     \end{subfigure}
alpar@2
  1390
     \begin{subfigure}[b]{0.55\textwidth}
alpar@2
  1391
\begin{center}
Madarasi@7
  1392
     \hspace*{-0.5cm}
alpar@2
  1393
\begin{tikzpicture}
alpar@2
  1394
\begin{axis}[title={Random IND, $\delta = 10$, $\rho = 0.1$},width=7.2cm,height=6cm,xlabel={target size},ylabel={time (ms)},ylabel near ticks,legend entries={VF2 Plus,VF2++},grid
alpar@3
  1395
=major,mark size=1.2pt, legend style={at={(0,1)},anchor=north
alpar@3
  1396
  west},scaled x ticks = false,x tick label style={/pgf/number
alpar@3
  1397
  format/1000 sep = \space}]
alpar@2
  1398
%\addplot+[only marks] table {proteinsOrig.txt};
alpar@2
  1399
\addplot table {randGraph/ind/vf2pInd10_0.1.txt};
alpar@3
  1400
\addplot[mark=triangle*,mark size=1.8pt,color=red] table
alpar@3
  1401
        {randGraph/ind/vf2ppInd10_0.1.txt};
alpar@2
  1402
\end{axis}
alpar@2
  1403
\end{tikzpicture}
alpar@2
  1404
\end{center}
alpar@2
  1405
\end{subfigure}
Madarasi@7
  1406
\hspace*{-1.5cm}
alpar@2
  1407
\begin{subfigure}[b]{0.55\textwidth}
alpar@2
  1408
\begin{center}
alpar@2
  1409
\begin{tikzpicture}
alpar@2
  1410
\begin{axis}[title={Random IND, $\delta = 10$, $\rho = 0.3$},width=7.2cm,height=6cm,xlabel={target size},ylabel={time (ms)},ylabel near ticks,legend entries={VF2 Plus,VF2++},grid
alpar@3
  1411
=major,mark size=1.2pt, legend style={at={(0,1)},anchor=north
alpar@3
  1412
  west},scaled x ticks = false,x tick label style={/pgf/number
alpar@3
  1413
  format/1000 sep = \space}]
alpar@2
  1414
%\addplot+[only marks] table {proteinsOrig.txt};
alpar@2
  1415
\addplot table {randGraph/ind/vf2pInd10_0.3.txt};
alpar@3
  1416
\addplot[mark=triangle*,mark size=1.8pt,color=red] table
alpar@3
  1417
        {randGraph/ind/vf2ppInd10_0.3.txt};
alpar@2
  1418
\end{axis}
alpar@2
  1419
\end{tikzpicture}
alpar@2
  1420
\end{center}
alpar@2
  1421
     \end{subfigure}
alpar@2
  1422
     \begin{subfigure}[b]{0.55\textwidth}
alpar@2
  1423
\begin{center}
alpar@2
  1424
\begin{tikzpicture}
alpar@2
  1425
\begin{axis}[title={Random IND, $\delta = 10$, $\rho = 0.6$},width=7.2cm,height=6cm,xlabel={target size},ylabel={time (ms)},ylabel near ticks,legend entries={VF2 Plus,VF2++},grid
alpar@3
  1426
=major,mark size=1.2pt, legend style={at={(0,1)},anchor=north
alpar@3
  1427
  west},scaled x ticks = false,x tick label style={/pgf/number
alpar@3
  1428
  format/1000 sep = \space}]
alpar@2
  1429
%\addplot+[only marks] table {proteinsOrig.txt};
alpar@2
  1430
\addplot table {randGraph/ind/vf2pInd10_0.6.txt};
alpar@3
  1431
\addplot[mark=triangle*,mark size=1.8pt,color=red] table
alpar@3
  1432
        {randGraph/ind/vf2ppInd10_0.6.txt};
alpar@2
  1433
\end{axis}
alpar@2
  1434
\end{tikzpicture}
alpar@2
  1435
\end{center}
alpar@2
  1436
\end{subfigure}
Madarasi@7
  1437
\hspace*{-1.5cm}
alpar@2
  1438
\begin{subfigure}[b]{0.55\textwidth}
alpar@2
  1439
\begin{tikzpicture}
alpar@2
  1440
\begin{axis}[title={Random IND, $\delta = 10$, $\rho = 0.8$},width=7.2cm,height=6cm,xlabel={target size},ylabel={time (ms)},ylabel near ticks,legend entries={VF2 Plus,VF2++},grid
alpar@3
  1441
=major,mark size=1.2pt, legend style={at={(0,1)},anchor=north
alpar@3
  1442
  west},scaled x ticks = false,x tick label style={/pgf/number
alpar@3
  1443
  format/1000 sep = \space}]
alpar@2
  1444
%\addplot+[only marks] table {proteinsOrig.txt};
alpar@2
  1445
\addplot table {randGraph/ind/vf2pInd10_0.8.txt};
alpar@3
  1446
\addplot[mark=triangle*,mark size=1.8pt,color=red] table
alpar@3
  1447
        {randGraph/ind/vf2ppInd10_0.8.txt};
alpar@2
  1448
\end{axis}
alpar@2
  1449
\end{tikzpicture}
alpar@2
  1450
     \end{subfigure}
alpar@2
  1451
     \begin{subfigure}[b]{0.55\textwidth}
alpar@2
  1452
\begin{tikzpicture}
alpar@2
  1453
\begin{axis}[title={Random IND, $\delta = 10$, $\rho = 0.95$},width=7.2cm,height=6cm,xlabel={target size},ylabel={time (ms)},ylabel near ticks,legend entries={VF2 Plus,VF2++},grid
alpar@3
  1454
=major,mark size=1.2pt, legend style={at={(0,1)},anchor=north
alpar@3
  1455
  west},scaled x ticks = false,x tick label style={/pgf/number
alpar@3
  1456
  format/1000 sep = \thinspace}]
alpar@2
  1457
%\addplot+[only marks] table {proteinsOrig.txt};
alpar@2
  1458
\addplot table {randGraph/ind/vf2pInd10_0.95.txt};
alpar@3
  1459
\addplot[mark=triangle*,mark size=1.8pt,color=red] table
alpar@3
  1460
        {randGraph/ind/vf2ppInd10_0.95.txt};
alpar@2
  1461
\end{axis}
alpar@2
  1462
\end{tikzpicture}
alpar@2
  1463
\end{subfigure}
alpar@2
  1464
\vspace*{-0.8cm}
alpar@3
  1465
\caption{IND on graphs having an average degree of
alpar@3
  1466
  10.}\label{fig:randIND10}
alpar@2
  1467
\end{figure}
alpar@2
  1468
alpar@2
  1469
alpar@2
  1470
alpar@2
  1471
\begin{figure}[H]
Madarasi@7
  1472
\vspace*{-1.5cm}
Madarasi@7
  1473
\hspace*{-1.5cm}
alpar@2
  1474
\begin{subfigure}[b]{0.55\textwidth}
alpar@2
  1475
\begin{center}
alpar@2
  1476
\begin{tikzpicture}
alpar@2
  1477
\begin{axis}[title={Random IND, $\delta = 35$, $\rho = 0.05$},width=7.2cm,height=6cm,xlabel={target size},ylabel={time (ms)},ylabel near ticks,legend entries={VF2 Plus,VF2++},grid
alpar@3
  1478
=major,mark size=1.2pt, legend style={at={(0,1)},anchor=north
alpar@3
  1479
  west},scaled x ticks = false,x tick label style={/pgf/number
alpar@3
  1480
  format/1000 sep = \space}]
alpar@2
  1481
%\addplot+[only marks] table {proteinsOrig.txt};
alpar@2
  1482
\addplot table {randGraph/ind/vf2pInd35_0.05.txt};
alpar@3
  1483
\addplot[mark=triangle*,mark size=1.8pt,color=red] table
alpar@3
  1484
        {randGraph/ind/vf2ppInd35_0.05.txt};
alpar@2
  1485
\end{axis}
alpar@2
  1486
\end{tikzpicture}
alpar@2
  1487
\end{center}
alpar@2
  1488
     \end{subfigure}
alpar@2
  1489
     \begin{subfigure}[b]{0.55\textwidth}
alpar@2
  1490
\begin{center}
alpar@2
  1491
\begin{tikzpicture}
alpar@2
  1492
\begin{axis}[title={Random IND, $\delta = 35$, $\rho = 0.1$},width=7.2cm,height=6cm,xlabel={target size},ylabel={time (ms)},ylabel near ticks,legend entries={VF2 Plus,VF2++},grid
alpar@3
  1493
=major,mark size=1.2pt, legend style={at={(0,1)},anchor=north
alpar@3
  1494
  west},scaled x ticks = false,x tick label style={/pgf/number
alpar@3
  1495
  format/1000 sep = \space}]
alpar@2
  1496
%\addplot+[only marks] table {proteinsOrig.txt};
alpar@2
  1497
\addplot table {randGraph/ind/vf2pInd35_0.1.txt};
alpar@3
  1498
\addplot[mark=triangle*,mark size=1.8pt,color=red] table
alpar@3
  1499
        {randGraph/ind/vf2ppInd35_0.1.txt};
alpar@2
  1500
\end{axis}
alpar@2
  1501
\end{tikzpicture}
alpar@2
  1502
\end{center}
alpar@2
  1503
\end{subfigure}
Madarasi@7
  1504
\hspace*{-1.5cm}
alpar@2
  1505
\begin{subfigure}[b]{0.55\textwidth}
alpar@2
  1506
\begin{center}
alpar@2
  1507
\begin{tikzpicture}
alpar@2
  1508
\begin{axis}[title={Random IND, $\delta = 35$, $\rho = 0.3$},width=7.2cm,height=6cm,xlabel={target size},ylabel={time (ms)},ylabel near ticks,legend entries={VF2 Plus,VF2++},grid
alpar@3
  1509
=major,mark size=1.2pt, legend style={at={(0,1)},anchor=north
alpar@3
  1510
  west},scaled x ticks = false,x tick label style={/pgf/number
alpar@3
  1511
  format/1000 sep = \space}]
alpar@2
  1512
%\addplot+[only marks] table {proteinsOrig.txt};
alpar@2
  1513
\addplot table {randGraph/ind/vf2pInd35_0.3.txt};
alpar@3
  1514
\addplot[mark=triangle*,mark size=1.8pt,color=red] table
alpar@3
  1515
        {randGraph/ind/vf2ppInd35_0.3.txt};
alpar@2
  1516
\end{axis}
alpar@2
  1517
\end{tikzpicture}
alpar@2
  1518
\end{center}
alpar@2
  1519
     \end{subfigure}
alpar@2
  1520
     \begin{subfigure}[b]{0.55\textwidth}
alpar@2
  1521
\begin{center}
alpar@2
  1522
\begin{tikzpicture}
alpar@2
  1523
\begin{axis}[title={Random IND, $\delta = 35$, $\rho = 0.6$},width=7.2cm,height=6cm,xlabel={target size},ylabel={time (ms)},ylabel near ticks,legend entries={VF2 Plus,VF2++},grid
alpar@3
  1524
=major,mark size=1.2pt, legend style={at={(0,1)},anchor=north
alpar@3
  1525
  west},scaled x ticks = false,x tick label style={/pgf/number
alpar@3
  1526
  format/1000 sep = \space}]
alpar@2
  1527
%\addplot+[only marks] table {proteinsOrig.txt};
alpar@2
  1528
\addplot table {randGraph/ind/vf2pInd35_0.6.txt};
alpar@3
  1529
\addplot[mark=triangle*,mark size=1.8pt,color=red] table
alpar@3
  1530
        {randGraph/ind/vf2ppInd35_0.6.txt};
alpar@2
  1531
\end{axis}
alpar@2
  1532
\end{tikzpicture}
alpar@2
  1533
\end{center}
alpar@2
  1534
\end{subfigure}
Madarasi@7
  1535
\hspace*{-1.5cm}
alpar@2
  1536
\begin{subfigure}[b]{0.55\textwidth}
alpar@2
  1537
\begin{tikzpicture}
alpar@2
  1538
\begin{axis}[title={Random IND, $\delta = 35$, $\rho = 0.8$},width=7.2cm,height=6cm,xlabel={target size},ylabel={time (ms)},ylabel near ticks,legend entries={VF2 Plus,VF2++},grid
alpar@3
  1539
=major,mark size=1.2pt, legend style={at={(0,1)},anchor=north
alpar@3
  1540
  west},scaled x ticks = false,x tick label style={/pgf/number
alpar@3
  1541
  format/1000 sep = \space}]
alpar@2
  1542
%\addplot+[only marks] table {proteinsOrig.txt};
alpar@2
  1543
\addplot table {randGraph/ind/vf2pInd35_0.8.txt};
alpar@3
  1544
\addplot[mark=triangle*,mark size=1.8pt,color=red] table
alpar@3
  1545
        {randGraph/ind/vf2ppInd35_0.8.txt};
alpar@2
  1546
\end{axis}
alpar@2
  1547
\end{tikzpicture}
alpar@2
  1548
     \end{subfigure}
alpar@2
  1549
     \begin{subfigure}[b]{0.55\textwidth}
alpar@2
  1550
\begin{tikzpicture}
alpar@2
  1551
\begin{axis}[title={Random IND, $\delta = 35$, $\rho = 0.95$},width=7.2cm,height=6cm,xlabel={target size},ylabel={time (ms)},ylabel near ticks,legend entries={VF2 Plus,VF2++},grid
alpar@3
  1552
=major,mark size=1.2pt, legend style={at={(0,1)},anchor=north
alpar@3
  1553
  west},scaled x ticks = false,x tick label style={/pgf/number
alpar@3
  1554
  format/1000 sep = \thinspace}]
alpar@2
  1555
%\addplot+[only marks] table {proteinsOrig.txt};
alpar@2
  1556
\addplot table {randGraph/ind/vf2pInd35_0.95.txt};
alpar@3
  1557
\addplot[mark=triangle*,mark size=1.8pt,color=red] table
alpar@3
  1558
        {randGraph/ind/vf2ppInd35_0.95.txt};
alpar@2
  1559
\end{axis}
alpar@2
  1560
\end{tikzpicture}
alpar@2
  1561
\end{subfigure}
alpar@2
  1562
\vspace*{-0.8cm}
alpar@3
  1563
\caption{IND on graphs having an average degree of
alpar@3
  1564
  35.}\label{fig:randIND35}
alpar@2
  1565
\end{figure}
alpar@2
  1566
alpar@2
  1567
alpar@3
  1568
Based on these experiments, VF2++ is faster than VF2 Plus and able to
alpar@3
  1569
handle really large graphs in milliseconds. Note that when $IND$ was
alpar@3
  1570
considered and the small graphs had proportionally few nodes ($\rho =
alpar@3
  1571
0.05$, or $\rho = 0.1$), then VF2 Plus produced some inefficient node
alpar@4
  1572
orders (e.g. see the $\delta=10$ case on
Madarasi@17
  1573
Figure~\ref{fig:randIND10}). If these instances had been excluded, the
alpar@3
  1574
charts would have seemed to be similar to the other ones.
alpar@3
  1575
Unsurprisingly, as denser graphs are considered, both VF2++ and VF2
alpar@3
  1576
Plus slow slightly down, but remain practically usable even on graphs
alpar@3
  1577
having 10 000 nodes.
alpar@2
  1578
alpar@2
  1579
alpar@2
  1580
alpar@2
  1581
alpar@3
  1582
alpar@2
  1583
\section{Conclusion}
alpar@3
  1584
In this paper, after providing a short summary of the recent
alpar@3
  1585
algorithms, a new graph matching algorithm based on VF2, called VF2++,
alpar@3
  1586
has been presented and analyzed from a practical viewpoint.
alpar@2
  1587
alpar@3
  1588
Recognizing the importance of the node order and determining an
alpar@3
  1589
efficient one, VF2++ is able to match graphs of thousands of nodes in
alpar@3
  1590
near practically linear time including preprocessing. In addition to
alpar@3
  1591
the proper order, VF2++ uses more efficient consistency and cutting
alpar@3
  1592
rules which are easy to compute and make the algorithm able to prune
alpar@3
  1593
most of the unfruitful branches without going astray.
alpar@2
  1594
alpar@3
  1595
In order to show the efficiency of the new method, it has been
alpar@3
  1596
compared to VF2 Plus, which is the best concurrent algorithm based on
alpar@3
  1597
\cite{VF2Plus}.
alpar@2
  1598
alpar@3
  1599
The experiments show that VF2++ consistently outperforms VF2 Plus on
alpar@3
  1600
biological graphs. It seems to be asymptotically faster on protein and
alpar@3
  1601
on contact map graphs in the case of induced subgraph isomorphism,
alpar@3
  1602
while in the case of graph isomorphism, it has definitely better
alpar@3
  1603
asymptotic behaviour on protein graphs.
alpar@2
  1604
alpar@3
  1605
Regarding random sparse graphs, not only has VF2++ proved itself to be
alpar@3
  1606
faster than VF2 Plus, but it has a practically linear behaviour both
alpar@3
  1607
in the case of induced subgraph- and graph isomorphism, as well.
alpar@2
  1608
alpar@2
  1609
alpar@0
  1610
alpar@0
  1611
%% The Appendices part is started with the command \appendix;
alpar@0
  1612
%% appendix sections are then done as normal sections
alpar@0
  1613
%% \appendix
alpar@0
  1614
alpar@0
  1615
%% \section{}
alpar@0
  1616
%% \label{}
alpar@0
  1617
alpar@0
  1618
%% If you have bibdatabase file and want bibtex to generate the
alpar@0
  1619
%% bibitems, please use
alpar@0
  1620
%%
alpar@3
  1621
\bibliographystyle{elsarticle-num} \bibliography{bibliography}
alpar@0
  1622
alpar@0
  1623
%% else use the following coding to input the bibitems directly in the
alpar@0
  1624
%% TeX file.
alpar@0
  1625
alpar@2
  1626
%% \begin{thebibliography}{00}
alpar@0
  1627
alpar@2
  1628
%% %% \bibitem{label}
alpar@2
  1629
%% %% Text of bibliographic item
alpar@0
  1630
alpar@2
  1631
%% \bibitem{}
alpar@0
  1632
alpar@2
  1633
%% \end{thebibliography}
alpar@2
  1634
alpar@0
  1635
\end{document}
alpar@0
  1636
\endinput
alpar@0
  1637
%%
alpar@0
  1638
%% End of file `elsarticle-template-num.tex'.