diff --git a/report/img/refine_haystack_bad.png b/report/img/refine_haystack_bad.png new file mode 100644 index 0000000..af93d38 Binary files /dev/null and b/report/img/refine_haystack_bad.png differ diff --git a/report/img/refine_haystack_ok.png b/report/img/refine_haystack_ok.png new file mode 100644 index 0000000..932e93a Binary files /dev/null and b/report/img/refine_haystack_ok.png differ diff --git a/report/img/refine_needle.png b/report/img/refine_needle.png new file mode 100644 index 0000000..e6a94fd Binary files /dev/null and b/report/img/refine_needle.png differ diff --git a/report/img/ullmann_refine/haystack_bad.dot b/report/img/ullmann_refine/haystack_bad.dot new file mode 100644 index 0000000..e3b7a8d --- /dev/null +++ b/report/img/ullmann_refine/haystack_bad.dot @@ -0,0 +1,7 @@ +digraph haystack_bad { + a [style=filled, label=a’]; + x -> a; + y -> a; + z -> x; + z -> y; +} diff --git a/report/img/ullmann_refine/haystack_ok.dot b/report/img/ullmann_refine/haystack_ok.dot new file mode 100644 index 0000000..0d07431 --- /dev/null +++ b/report/img/ullmann_refine/haystack_ok.dot @@ -0,0 +1,9 @@ +digraph haystack_ok { + a [style=filled, label=a’]; + x -> a; + y -> a; + z -> a; + y -> x; + y -> z; + z -> x; +} diff --git a/report/img/ullmann_refine/needle.dot b/report/img/ullmann_refine/needle.dot new file mode 100644 index 0000000..ef468a1 --- /dev/null +++ b/report/img/ullmann_refine/needle.dot @@ -0,0 +1,6 @@ +digraph G { + a [style=filled]; + b -> a; + c -> a; + b -> c; +} diff --git a/report/report.tex b/report/report.tex index e5b13d9..2c6a3db 100644 --- a/report/report.tex +++ b/report/report.tex @@ -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 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 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 @@ -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}. -\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{algorithmic}