Add Ullmann refining process example

This commit is contained in:
Théophile Bastian 2017-08-25 01:02:17 +02:00
parent 53ff786f91
commit f30d695832
7 changed files with 53 additions and 1 deletions

Binary file not shown.

After

Width:  |  Height:  |  Size: 10 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 17 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 9.8 KiB

View file

@ -0,0 +1,7 @@
digraph haystack_bad {
a [style=filled, label=a];
x -> a;
y -> a;
z -> x;
z -> y;
}

View file

@ -0,0 +1,9 @@
digraph haystack_ok {
a [style=filled, label=a];
x -> a;
y -> a;
z -> a;
y -> x;
y -> z;
z -> x;
}

View file

@ -0,0 +1,6 @@
digraph G {
a [style=filled];
b -> a;
c -> a;
b -> c;
}

View file

@ -553,6 +553,18 @@ words, a match between $i$ and $j$ is only possible if every neighbour $k$ of
$i$ (in needle) has a possibly matching (\wrt{} $perm$) vertex $k'$ (in $i$ (in needle) has a possibly matching (\wrt{} $perm$) vertex $k'$ (in
haystack) which is a neighbour of $j$. haystack) which is a neighbour of $j$.
For instance, for the needle from Figure~\ref{fig:refine_needle}'s, we can try
to check the ones corresponding to the vertex $a$ (the coloured one). Refining
it while matching it with Figure~\ref{fig:refine_haystack_ok} will leave a $1$
on the match $a-a'$, since every neighbour of $a$ can be matched with a
neighbour of $a'$ (which, hopefully, are a $1$ in the matrix): $b$ matches $y$
and $c$ matches $z$, for instance. It is not the case with the haystack from
Figure~\ref{fig:refine_haystack_bad}: if the process went far enough already,
there should be no corresponding vertex for either $b$ or $c$, since there are
no such two vertices with an edge linking them. If there is indeed no match at
this point for either $w$ or $c$, the $1$ in the cell matching $a - a'$ will be
turned to a $0$.
This condition is checked on every $1$ in the permutation matrix. If it is not This condition is checked on every $1$ in the permutation matrix. If it is not
met, the cell is nulled. This, though, potentially creates new ones not met, the cell is nulled. This, though, potentially creates new ones not
matching the condition: the process must be run again, until no new zeroes matching the condition: the process must be run again, until no new zeroes
@ -565,7 +577,25 @@ of the adjacency of $j$ and the permutation matrix row of $k$.
The refining function is detailed in Figure~\ref{alg:ullmann_refine}. The refining function is detailed in Figure~\ref{alg:ullmann_refine}.
\todo{Insert explaining figure} \begin{figure}[h]
\centering
\begin{minipage}{0.3\textwidth}
\centering
\includegraphics[width=0.5\textwidth]{img/refine_needle.png}
\caption{Needle}\label{fig:refine_needle}
\end{minipage}
\begin{minipage}{0.3\textwidth}
\centering
\includegraphics[width=0.5\textwidth]{img/refine_haystack_ok.png}
\caption{Matching haystack}\label{fig:refine_haystack_ok}
\end{minipage}
\begin{minipage}{0.3\textwidth}
\centering
\includegraphics[width=0.5\textwidth]{img/refine_haystack_bad.png}
\caption{Non-matching haystack}\label{fig:refine_haystack_bad}
\end{minipage}
\caption{Example: Ullmann refining process}
\end{figure}
\begin{figure}[h] \begin{figure}[h]
\begin{algorithmic} \begin{algorithmic}