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