\documentclass[handout]{beamer}

\usepackage[utf8]{inputenc}
\usepackage{default}
\usepackage{tikz}
\usepackage{color}

\begin{document}
\title{Fast Nearest Neighbour Classification}
\author{Gordon Lesti}
\date{July 17, 2015}

\frame{\titlepage}
\frame{\frametitle{Structure}\tableofcontents}

\section{Introduction}

\subsection{Problem}
\begin{frame}
 \frametitle{Nearest-Neighbour Searching}
 \begin{block}{Input}
   \begin{itemize}
    \item Set $\mathbb{U}$
    \pause
    \item Distance function $d$ on $\mathbb{U}$, with $d: \mathbb{U} \times \mathbb{U} \to \mathbb{R}$
    \pause
    \item Set $S \subset \mathbb{U}$ of size $n$
    \pause
    \item Query item $q \in \mathbb{U}$
  \end{itemize}
 \end{block}
 \pause
 \begin{block}{Output}
    \begin{itemize}
     \item Item $a \in S$, with $d(q, a) \le d(q, x)$ for all $x \in S$
    \end{itemize}
 \end{block}
\end{frame}

\subsection{Use}
\begin{frame}
 \frametitle{Use}
 \begin{itemize}
 \item Pattern recognition
 \item Statistical classification
 \item Image editing
 \item Coding theory
 \item Data compression
 \item Recommender system
 \item $\dots$
\end{itemize}
\end{frame}

\section{Solutions}

\subsection{Full Search}
\begin{frame}
 \frametitle{Full Search}
 \begin{itemize}
  \item Calculate $d(q, x)$ for all $x \in S$
  \pause
  \item Return $a \in S$, with $d(q, a) \le d(q, x)$ for all $x \in S$
 \end{itemize}
\end{frame}

% Beispiel1 Datenpunkte
\begin{frame}<handout:0>{Full Search}{Example}
 \begin{columns}[T]
  \begin{column}{.35\textwidth}
    $\mathbb{U} = \mathbb{R}^2$
    \begin{block}{Items}
      $x_1 = (3, 3)$\\
      $x_2 = (-1, 2)$\\
      $x_3 = (-4, -4)$\\
      $x_4 = (0, -1)$\\
      $x_5 = (4, -3)$
    \end{block}
  \end{column}
  \begin{column}{.6\textwidth}
     \begin{tikzpicture}[%
      scale=0.6,
      ]
      \clip (-5.0,-5.0) rectangle (5.0,5.0);
      \draw [help lines] (0,0) grid (6,5);
      \draw [help lines] (-6,0) grid (0,5);
      \draw [help lines] (0,-6) grid (6,0);
      \draw [help lines] (-6,-6) grid (0,0);
      \draw [color=black,->] (-5.0,0) -- (5.0,0);
      \draw [color=black,->] (0,-5.0) -- (0,5.0);

      \filldraw [color={rgb:red,0;green,0;blue,255}] (3,3) circle (2.5pt );
      \filldraw [color={rgb:red,0;green,0;blue,255}] (-1,2) circle (2.5pt );
      \filldraw [color={rgb:red,0;green,0;blue,255}] (-4,-4) circle (2.5pt );
      \filldraw [color={rgb:red,0;green,0;blue,255}] (0,-1) circle (2.5pt );
      \filldraw [color={rgb:red,0;green,0;blue,255}] (4,-3) circle (2.5pt );

      \node at (3.3,2.7) {$x_1$};
      \node at (-0.7,1.7) {$x_2$};
      \node at (-3.7,-4.3) {$x_3$};
      \node at (0.3,-1.3) {$x_4$};
      \node at (4.3,-3.3) {$x_5$};
      \end{tikzpicture}
  \end{column}
 \end{columns}
\end{frame}

% Beispiel1 Anfragepunkt
\begin{frame}{Full Search}{Example}
 \begin{columns}[T]
  \begin{column}{.35\textwidth}
    $\mathbb{U} = \mathbb{R}^2$
    \begin{block}{Items}
      $x_1 = (3, 3)$\\
      $x_2 = (-1, 2)$\\
      $x_3 = (-4, -4)$\\
      $x_4 = (0, -1)$\\
      $x_5 = (4, -3)$
    \end{block}
    \begin{block}{Query item}
      $q = (2, 1)$
    \end{block}
  \end{column}
  \begin{column}{.6\textwidth}
     \begin{tikzpicture}[%
      scale=0.6,
      ]
      \clip (-5.0,-5.0) rectangle (5.0,5.0);
      \draw [help lines] (0,0) grid (6,5);
      \draw [help lines] (-6,0) grid (0,5);
      \draw [help lines] (0,-6) grid (6,0);
      \draw [help lines] (-6,-6) grid (0,0);
      \draw [color=black,->] (-5.0,0) -- (5.0,0);
      \draw [color=black,->] (0,-5.0) -- (0,5.0);

      \filldraw [color={rgb:red,0;green,0;blue,255}] (3,3) circle (2.5pt );
      \filldraw [color={rgb:red,0;green,0;blue,255}] (-1,2) circle (2.5pt );
      \filldraw [color={rgb:red,0;green,0;blue,255}] (-4,-4) circle (2.5pt );
      \filldraw [color={rgb:red,0;green,0;blue,255}] (0,-1) circle (2.5pt );
      \filldraw [color={rgb:red,0;green,0;blue,255}] (4,-3) circle (2.5pt );

      \filldraw [color={rgb:red,255;green,0;blue,0}] (2,1) circle (2.5pt );

      \node at (3.3,2.7) {$x_1$};
      \node at (-0.7,1.7) {$x_2$};
      \node at (-3.7,-4.3) {$x_3$};
      \node at (0.3,-1.3) {$x_4$};
      \node at (4.3,-3.3) {$x_5$};

      \node at (2.3,0.7) {$q$};
      \end{tikzpicture}
  \end{column}
 \end{columns}
\end{frame}

% Beispiel1 Abstand x1
\begin{frame}<handout:0>{Full Search}{Example}
 \begin{columns}[T]
  \begin{column}{.35\textwidth}
    \begin{block}{Result}
      $d(q, x_1) \approx 2.236$
    \end{block}
  \end{column}
  \begin{column}{.6\textwidth}
     \begin{tikzpicture}[%
      scale=0.6,
      ]
      \clip (-5.0,-5.0) rectangle (5.0,5.0);
      \draw [help lines] (0,0) grid (6,5);
      \draw [help lines] (-6,0) grid (0,5);
      \draw [help lines] (0,-6) grid (6,0);
      \draw [help lines] (-6,-6) grid (0,0);
      \draw [color=black,->] (-5.0,0) -- (5.0,0);
      \draw [color=black,->] (0,-5.0) -- (0,5.0);

      \draw[color=gray, line width=0.5pt, dashed] (2,1) -- (3,3);

      \filldraw [color={rgb:red,0;green,0;blue,255}] (3,3) circle (2.5pt );
      \filldraw [color={rgb:red,0;green,0;blue,255}] (-1,2) circle (2.5pt );
      \filldraw [color={rgb:red,0;green,0;blue,255}] (-4,-4) circle (2.5pt );
      \filldraw [color={rgb:red,0;green,0;blue,255}] (0,-1) circle (2.5pt );
      \filldraw [color={rgb:red,0;green,0;blue,255}] (4,-3) circle (2.5pt );

      \filldraw [color={rgb:red,255;green,0;blue,0}] (2,1) circle (2.5pt );

      \node at (3.3,2.7) {$x_1$};
      \node at (-0.7,1.7) {$x_2$};
      \node at (-3.7,-4.3) {$x_3$};
      \node at (0.3,-1.3) {$x_4$};
      \node at (4.3,-3.3) {$x_5$};

      \node at (2.3,0.7) {$q$};
      \end{tikzpicture}
  \end{column}
 \end{columns}
\end{frame}

% Beispiel1 Abstand x2
\begin{frame}<handout:0>{Full Search}{Example}
 \begin{columns}[T]
  \begin{column}{.35\textwidth}
    \begin{block}{Result}
      $d(q, x_1) \approx 2.236$\\
      $d(q, x_2) \approx 3.162$
    \end{block}
  \end{column}
  \begin{column}{.6\textwidth}
     \begin{tikzpicture}[%
      scale=0.6,
      ]
      \clip (-5.0,-5.0) rectangle (5.0,5.0);
      \draw [help lines] (0,0) grid (6,5);
      \draw [help lines] (-6,0) grid (0,5);
      \draw [help lines] (0,-6) grid (6,0);
      \draw [help lines] (-6,-6) grid (0,0);
      \draw [color=black,->] (-5.0,0) -- (5.0,0);
      \draw [color=black,->] (0,-5.0) -- (0,5.0);

      \draw[color=gray, line width=0.5pt, dashed] (2,1) -- (3,3);
      \draw[color=gray, line width=0.5pt, dashed] (2,1) -- (-1,2);

      \filldraw [color={rgb:red,0;green,0;blue,255}] (3,3) circle (2.5pt );
      \filldraw [color={rgb:red,0;green,0;blue,255}] (-1,2) circle (2.5pt );
      \filldraw [color={rgb:red,0;green,0;blue,255}] (-4,-4) circle (2.5pt );
      \filldraw [color={rgb:red,0;green,0;blue,255}] (0,-1) circle (2.5pt );
      \filldraw [color={rgb:red,0;green,0;blue,255}] (4,-3) circle (2.5pt );

      \filldraw [color={rgb:red,255;green,0;blue,0}] (2,1) circle (2.5pt );

      \node at (3.3,2.7) {$x_1$};
      \node at (-0.7,1.7) {$x_2$};
      \node at (-3.7,-4.3) {$x_3$};
      \node at (0.3,-1.3) {$x_4$};
      \node at (4.3,-3.3) {$x_5$};

      \node at (2.3,0.7) {$q$};
      \end{tikzpicture}
  \end{column}
 \end{columns}
\end{frame}

% Beispiel1 Abstand x3
\begin{frame}<handout:0>{Full Search}{Example}
 \begin{columns}[T]
  \begin{column}{.35\textwidth}
    \begin{block}{Result}
      $d(q, x_1) \approx 2.236$\\
      $d(q, x_2) \approx 3.162$\\
      $d(q, x_3) \approx 7.810$
    \end{block}
  \end{column}
  \begin{column}{.6\textwidth}
     \begin{tikzpicture}[%
      scale=0.6,
      ]
      \clip (-5.0,-5.0) rectangle (5.0,5.0);
      \draw [help lines] (0,0) grid (6,5);
      \draw [help lines] (-6,0) grid (0,5);
      \draw [help lines] (0,-6) grid (6,0);
      \draw [help lines] (-6,-6) grid (0,0);
      \draw [color=black,->] (-5.0,0) -- (5.0,0);
      \draw [color=black,->] (0,-5.0) -- (0,5.0);

      \draw[color=gray, line width=0.5pt, dashed] (2,1) -- (3,3);
      \draw[color=gray, line width=0.5pt, dashed] (2,1) -- (-1,2);
      \draw[color=gray, line width=0.5pt, dashed] (2,1) -- (-4,-4);

      \filldraw [color={rgb:red,0;green,0;blue,255}] (3,3) circle (2.5pt );
      \filldraw [color={rgb:red,0;green,0;blue,255}] (-1,2) circle (2.5pt );
      \filldraw [color={rgb:red,0;green,0;blue,255}] (-4,-4) circle (2.5pt );
      \filldraw [color={rgb:red,0;green,0;blue,255}] (0,-1) circle (2.5pt );
      \filldraw [color={rgb:red,0;green,0;blue,255}] (4,-3) circle (2.5pt );

      \filldraw [color={rgb:red,255;green,0;blue,0}] (2,1) circle (2.5pt );

      \node at (3.3,2.7) {$x_1$};
      \node at (-0.7,1.7) {$x_2$};
      \node at (-3.7,-4.3) {$x_3$};
      \node at (0.3,-1.3) {$x_4$};
      \node at (4.3,-3.3) {$x_5$};

      \node at (2.3,0.7) {$q$};
      \end{tikzpicture}
  \end{column}
 \end{columns}
\end{frame}

% Beispiel1 Abstand x4
\begin{frame}<handout:0>{Full Search}{Example}
 \begin{columns}[T]
  \begin{column}{.35\textwidth}
    \begin{block}{Result}
      $d(q, x_1) \approx 2.236$\\
      $d(q, x_2) \approx 3.162$\\
      $d(q, x_3) \approx 7.810$\\
      $d(q, x_4) \approx 2.828$
    \end{block}
  \end{column}
  \begin{column}{.6\textwidth}
     \begin{tikzpicture}[%
      scale=0.6,
      ]
      \clip (-5.0,-5.0) rectangle (5.0,5.0);
      \draw [help lines] (0,0) grid (6,5);
      \draw [help lines] (-6,0) grid (0,5);
      \draw [help lines] (0,-6) grid (6,0);
      \draw [help lines] (-6,-6) grid (0,0);
      \draw [color=black,->] (-5.0,0) -- (5.0,0);
      \draw [color=black,->] (0,-5.0) -- (0,5.0);

      \draw[color=gray, line width=0.5pt, dashed] (2,1) -- (3,3);
      \draw[color=gray, line width=0.5pt, dashed] (2,1) -- (-1,2);
      \draw[color=gray, line width=0.5pt, dashed] (2,1) -- (-4,-4);
      \draw[color=gray, line width=0.5pt, dashed] (2,1) -- (0,-1);

      \filldraw [color={rgb:red,0;green,0;blue,255}] (3,3) circle (2.5pt );
      \filldraw [color={rgb:red,0;green,0;blue,255}] (-1,2) circle (2.5pt );
      \filldraw [color={rgb:red,0;green,0;blue,255}] (-4,-4) circle (2.5pt );
      \filldraw [color={rgb:red,0;green,0;blue,255}] (0,-1) circle (2.5pt );
      \filldraw [color={rgb:red,0;green,0;blue,255}] (4,-3) circle (2.5pt );

      \filldraw [color={rgb:red,255;green,0;blue,0}] (2,1) circle (2.5pt );

      \node at (3.3,2.7) {$x_1$};
      \node at (-0.7,1.7) {$x_2$};
      \node at (-3.7,-4.3) {$x_3$};
      \node at (0.3,-1.3) {$x_4$};
      \node at (4.3,-3.3) {$x_5$};

      \node at (2.3,0.7) {$q$};
      \end{tikzpicture}
  \end{column}
 \end{columns}
\end{frame}

% Beispiel1 Abstand x5
\begin{frame}<handout:0>{Full Search}{Example}
 \begin{columns}[T]
  \begin{column}{.35\textwidth}
    \begin{block}{Result}
      $d(q, x_1) \approx 2.236$\\
      $d(q, x_2) \approx 3.162$\\
      $d(q, x_3) \approx 7.810$\\
      $d(q, x_4) \approx 2.828$\\
      $d(q, x_5) \approx 4.472$
    \end{block}
  \end{column}
  \begin{column}{.6\textwidth}
     \begin{tikzpicture}[%
      scale=0.6,
      ]
      \clip (-5.0,-5.0) rectangle (5.0,5.0);
      \draw [help lines] (0,0) grid (6,5);
      \draw [help lines] (-6,0) grid (0,5);
      \draw [help lines] (0,-6) grid (6,0);
      \draw [help lines] (-6,-6) grid (0,0);
      \draw [color=black,->] (-5.0,0) -- (5.0,0);
      \draw [color=black,->] (0,-5.0) -- (0,5.0);

      \draw[color=gray, line width=0.5pt, dashed] (2,1) -- (3,3);
      \draw[color=gray, line width=0.5pt, dashed] (2,1) -- (-1,2);
      \draw[color=gray, line width=0.5pt, dashed] (2,1) -- (-4,-4);
      \draw[color=gray, line width=0.5pt, dashed] (2,1) -- (0,-1);
      \draw[color=gray, line width=0.5pt, dashed] (2,1) -- (4,-3);

      \filldraw [color={rgb:red,0;green,0;blue,255}] (3,3) circle (2.5pt );
      \filldraw [color={rgb:red,0;green,0;blue,255}] (-1,2) circle (2.5pt );
      \filldraw [color={rgb:red,0;green,0;blue,255}] (-4,-4) circle (2.5pt );
      \filldraw [color={rgb:red,0;green,0;blue,255}] (0,-1) circle (2.5pt );
      \filldraw [color={rgb:red,0;green,0;blue,255}] (4,-3) circle (2.5pt );

      \filldraw [color={rgb:red,255;green,0;blue,0}] (2,1) circle (2.5pt );

      \node at (3.3,2.7) {$x_1$};
      \node at (-0.7,1.7) {$x_2$};
      \node at (-3.7,-4.3) {$x_3$};
      \node at (0.3,-1.3) {$x_4$};
      \node at (4.3,-3.3) {$x_5$};

      \node at (2.3,0.7) {$q$};
      \end{tikzpicture}
  \end{column}
 \end{columns}
\end{frame}

% Beispiel1 Ergebnis
\begin{frame}{Full Search}{Example}
 \begin{columns}[T]
  \begin{column}{.35\textwidth}
    \begin{block}{Result}
      \textcolor{green}{$d(q, x_1) \approx 2.236$}\\
      $d(q, x_2) \approx 3.162$\\
      $d(q, x_3) \approx 7.810$\\
      $d(q, x_4) \approx 2.828$\\
      $d(q, x_5) \approx 4.472$
    \end{block}
  \end{column}
  \begin{column}{.6\textwidth}
     \begin{tikzpicture}[%
      scale=0.6,
      ]
      \clip (-5.0,-5.0) rectangle (5.0,5.0);
      \draw [help lines] (0,0) grid (6,5);
      \draw [help lines] (-6,0) grid (0,5);
      \draw [help lines] (0,-6) grid (6,0);
      \draw [help lines] (-6,-6) grid (0,0);
      \draw [color=black,->] (-5.0,0) -- (5.0,0);
      \draw [color=black,->] (0,-5.0) -- (0,5.0);

      \draw[color=green, line width=0.5pt, solid] (2,1) -- (3,3);
      \draw[color=gray, line width=0.5pt, dashed] (2,1) -- (-1,2);
      \draw[color=gray, line width=0.5pt, dashed] (2,1) -- (-4,-4);
      \draw[color=gray, line width=0.5pt, dashed] (2,1) -- (0,-1);
      \draw[color=gray, line width=0.5pt, dashed] (2,1) -- (4,-3);

      \filldraw [color={rgb:red,0;green,0;blue,255}] (3,3) circle (2.5pt );
      \filldraw [color={rgb:red,0;green,0;blue,255}] (-1,2) circle (2.5pt );
      \filldraw [color={rgb:red,0;green,0;blue,255}] (-4,-4) circle (2.5pt );
      \filldraw [color={rgb:red,0;green,0;blue,255}] (0,-1) circle (2.5pt );
      \filldraw [color={rgb:red,0;green,0;blue,255}] (4,-3) circle (2.5pt );

      \filldraw [color={rgb:red,255;green,0;blue,0}] (2,1) circle (2.5pt );

      \node at (3.3,2.7) {$x_1$};
      \node at (-0.7,1.7) {$x_2$};
      \node at (-3.7,-4.3) {$x_3$};
      \node at (0.3,-1.3) {$x_4$};
      \node at (4.3,-3.3) {$x_5$};

      \node at (2.3,0.7) {$q$};
      \end{tikzpicture}
  \end{column}
 \end{columns}
\end{frame}

% Vor- und Nachteile
\begin{frame}{Full Search}{Advantages and disadvantages}
 \begin{block}{Advantages}
  \begin{itemize}
   \item Easy implementation
   \pause
   \item Works in none metric spaces
  \end{itemize}
 \end{block}
 \pause
 \begin{block}{Disadvantages}
  \begin{itemize}
   \item Large runtime on big data sets and in higher multidimensional spaces
  \end{itemize}
 \end{block}
\end{frame}

\begin{frame}{Metric}
  Given a set $X$. A \textit{Metric} on $X$ is a function\\
  $d:X \times X \to \mathbb{R}$, $(x, y) \mapsto d(x, y)$\\
  with:
 \begin{enumerate}
 \pause
  \item $d(x, y) = 0$ exactly when $x=y$.
  \pause
  \item Symmetry: For all $x, y \in X$ is true $d(x, y) = d(y, x)$.
  \pause
  \item Triangle inequality: For all $x, y, z \in X$ is true $d(x, z) \le d(x, y) + d(y,z)$
 \end{enumerate}
 \flushright{\tiny{[Forster, 2006]}}
\end{frame}

\begin{frame}{Triangle inequality}
  \begin{center}
    \begin{tikzpicture}[%
    scale=1.0,
    ]
    \clip (-4.15325,-0.785024) rectangle (0.889982,2.09932);
    \filldraw [color={rgb:red,0;green,0;blue,255}] (0.387719,-0.137281) circle (2.5pt );
    \filldraw [color={rgb:red,0;green,0;blue,255}] (-3.46333,0.27222) circle (2.5pt );
    \filldraw [color={rgb:red,0;green,0;blue,255}] (-0.413857,1.98864) circle (2.5pt );
    \draw[color={rgb:red,0;green,0;blue,255}, line width=0.5pt, solid] (-3.46333,0.27222) -- (-0.413857,1.98864);
    \draw[color={rgb:red,0;green,0;blue,255}, line width=0.5pt, solid] (-3.46333,0.27222) -- (0.387719,-0.137281);
    \draw[color={rgb:red,0;green,0;blue,255}, line width=0.5pt, solid] (-0.413857,1.98864) -- (0.387719,-0.137281);
    \node at (0.679006,-0.454707) {s};
    \node at (-0.131283,1.69735) {p};
    \node at (-3.18076,-0.163507) {q};
    \end{tikzpicture}
  \end{center}

 \textbf{Lemma} For any $q, s, p \in \mathbb{U}$, $r \in \mathbb{R}$ and $P \subset \mathbb{U}$ is true:
 \begin{enumerate}
 \pause
  \item \label{ineq:1}$|d(p, q) - d(p, s)| \le d(q, s) \le d(p, q) + d(p, s)$
  \pause
  \item \label{ineq:2}$d(q, s) \ge d_P(q, s) := \max_{p \in P}|d(p, q) - d(p, s)|$
  \pause
  \item \label{ineq:3}$d(p, s) > d(p, q) + r \vee d(p, s) < d(p, q) -r \Rightarrow d(q, s) > r$
  \pause
  \item \label{ineq:4}$d(p, s) \ge 2 \cdot d(p, q) \Rightarrow d(q, s) \ge d(q, p)$
 \end{enumerate}
 \flushright{\tiny{[Clarkson, 2005]}}
\end{frame}

\subsection{Orchards Algorithm}
\begin{frame}{Orchards Algorithm}
 \begin{itemize}
  \item Create a list for every item $p \in S$ with all items $x \in S$, ordered ascending to the distance
  \pause
  \item Choose random item $c \in S$ as initial candidate
  \pause
  \item Calculate $d(c, q)$
  \pause
  \item Go along the list of $c$
  \pause
  \item If the current item has smaller distance to $q$ as $c$, choose current item as $c$
  \pause
  \item Abort, if
    \begin{itemize}
      \item at the end of the current list or
      \item $d(c, s) > 2 \cdot d(c, q)$ for the current item of the list (Triangle inequality~\ref{ineq:4})
    \end{itemize}
   \pause
   \item Else $c$ is nearest neighbour
 \end{itemize}
\end{frame}

%Beispiel2
\begin{frame}{Orchards Algorithm}{Example}
 \begin{columns}[T]
  \begin{column}{.35\textwidth}
    $\mathbb{U} = \mathbb{R}^2$
    \begin{block}{Items}
      $x_1 = (3, 3)$\\
      $x_2 = (-1, 2)$\\
      $x_3 = (-4, -4)$\\
      $x_4 = (0, -1)$\\
      $x_5 = (4, -3)$
    \end{block}
    \begin{block}{Query item}
      $q = (2, 1)$
    \end{block}
  \end{column}
  \begin{column}{.60\textwidth}
     \begin{tikzpicture}[%
      scale=0.6,
      ]
      \clip (-5.0,-5.0) rectangle (5.0,5.0);
      \draw [help lines] (0,0) grid (6,5);
      \draw [help lines] (-6,0) grid (0,5);
      \draw [help lines] (0,-6) grid (6,0);
      \draw [help lines] (-6,-6) grid (0,0);
      \draw [color=black,->] (-5.0,0) -- (5.0,0);
      \draw [color=black,->] (0,-5.0) -- (0,5.0);

      \filldraw [color={rgb:red,0;green,0;blue,255}] (3,3) circle (2.5pt );
      \filldraw [color={rgb:red,0;green,0;blue,255}] (-1,2) circle (2.5pt );
      \filldraw [color={rgb:red,0;green,0;blue,255}] (-4,-4) circle (2.5pt );
      \filldraw [color={rgb:red,0;green,0;blue,255}] (0,-1) circle (2.5pt );
      \filldraw [color={rgb:red,0;green,0;blue,255}] (4,-3) circle (2.5pt );

      \filldraw [color={rgb:red,255;green,0;blue,0}] (2,1) circle (2.5pt );

      \node at (3.3,2.7) {$x_1$};
      \node at (-0.7,1.7) {$x_2$};
      \node at (-3.7,-4.3) {$x_3$};
      \node at (0.3,-1.3) {$x_4$};
      \node at (4.3,-3.3) {$x_5$};

      \node at (2.3,0.7) {$q$};
      \end{tikzpicture}
  \end{column}
 \end{columns}
\end{frame}

%Beispiel2 Abstand
\begin{frame}{Orchards Algorithm}{Example}
  \begin{block}{Distances}
  \begin{center}
    \begin{tabular}{r|ccccc}
      & $x_1$ & $x_2$ & $x_3$ & $x_4$ & $x_5$\\
      \hline
      $x_1$ & 0 & $\approx 4.123$ & $\approx 9.899$ & $5$ & $\approx 6.083$\\
      $x_2$ & $\approx 4.123$ & 0 & $\approx 6.708$ & $\approx 3.162$ & $\approx 7.071$\\
      $x_3$ & $\approx 9.899$ & $\approx 6.708$ & 0 & $5$ & $\approx 8.062$\\
      $x_4$ & $5$ & $\approx 3.162$ & $5$ & 0 & $\approx 4.472$\\
      $x_5$ & $\approx 6.083$ & $\approx 7.071$ & $\approx 8.062$ & $\approx 4.472$ & 0\\
    \end{tabular}
  \end{center}
  \end{block}
\end{frame}

%Beispiel2 Listen
\begin{frame}{Orchards Algorithm}{Example}
 \begin{columns}[T]
  \begin{column}{.35\textwidth}
    \begin{block}{Lists}
    $L(x_1) = \{x_2, x_4, x_5, x_3\}$\\
    $L(x_2) = \{x_4, x_1, x_3, x_5\}$\\
    $L(x_3) = \{x_4, x_2, x_5, x_1\}$\\
    $L(x_4) = \{x_2, x_5, x_1, x_3\}$\\
    $L(x_5) = \{x_4, x_1, x_2, x_3\}$\\
    \end{block}
  \end{column}
  \begin{column}{.6\textwidth}
     \begin{tikzpicture}[%
      scale=0.6,
      ]
      \clip (-5.0,-5.0) rectangle (5.0,5.0);
      \draw [help lines] (0,0) grid (6,5);
      \draw [help lines] (-6,0) grid (0,5);
      \draw [help lines] (0,-6) grid (6,0);
      \draw [help lines] (-6,-6) grid (0,0);
      \draw [color=black,->] (-5.0,0) -- (5.0,0);
      \draw [color=black,->] (0,-5.0) -- (0,5.0);

      \draw[color=gray, line width=0.5pt, dashed] (3,3) -- (-1,2);
      \draw[color=gray, line width=0.5pt, dashed] (3,3) -- (-4,-4);
      \draw[color=gray, line width=0.5pt, dashed] (3,3) -- (0,-1);
      \draw[color=gray, line width=0.5pt, dashed] (3,3) -- (4,-3);
      \draw[color=gray, line width=0.5pt, dashed] (-1,2) -- (-4,-4);
      \draw[color=gray, line width=0.5pt, dashed] (-1,2) -- (0,-1);
      \draw[color=gray, line width=0.5pt, dashed] (-1,2) -- (4,-3);
      \draw[color=gray, line width=0.5pt, dashed] (-4,-4) -- (0,-1);
      \draw[color=gray, line width=0.5pt, dashed] (-4,-4) -- (4,-3);
      \draw[color=gray, line width=0.5pt, dashed] (0,-1) -- (4,-3);

      \filldraw [color={rgb:red,0;green,0;blue,255}] (3,3) circle (2.5pt );
      \filldraw [color={rgb:red,0;green,0;blue,255}] (-1,2) circle (2.5pt );
      \filldraw [color={rgb:red,0;green,0;blue,255}] (-4,-4) circle (2.5pt );
      \filldraw [color={rgb:red,0;green,0;blue,255}] (0,-1) circle (2.5pt );
      \filldraw [color={rgb:red,0;green,0;blue,255}] (4,-3) circle (2.5pt );

      \node at (3.3,2.7) {$x_1$};
      \node at (-0.7,1.7) {$x_2$};
      \node at (-3.7,-4.3) {$x_3$};
      \node at (0.3,-1.3) {$x_4$};
      \node at (4.3,-3.3) {$x_5$};
      \end{tikzpicture}
  \end{column}
 \end{columns}
\end{frame}

\begin{frame}<handout:0>{Orchards Algorithm}{Example}
 \begin{columns}[T]
  \begin{column}{.35\textwidth}
    \begin{itemize}
     \item Set $c:=x_3$ and $s:= x_4$
    \end{itemize}
  \end{column}
  \begin{column}{.60\textwidth}
     \begin{tikzpicture}[%
      scale=0.6,
      ]
      \clip (-5.0,-5.0) rectangle (5.0,5.0);
      \draw [help lines] (0,0) grid (6,5);
      \draw [help lines] (-6,0) grid (0,5);
      \draw [help lines] (0,-6) grid (6,0);
      \draw [help lines] (-6,-6) grid (0,0);
      \draw [color=black,->] (-5.0,0) -- (5.0,0);
      \draw [color=black,->] (0,-5.0) -- (0,5.0);

      \draw [color=gray, line width=0.5pt, solid] (-4,-4) circle (5);
      \draw [color=gray, line width=0.5pt, solid] (-4,-4) circle (6.708);
      \draw [color=gray, line width=0.5pt, solid] (-4,-4) circle (8.062);
      \draw [color=gray, line width=0.5pt, solid] (-4,-4) circle (9.899);
      \draw [color=yellow, line width=0.5pt, solid] (-4,-4) circle (15.62);

      \filldraw [color=blue] (3,3) circle (2.5pt );
      \filldraw [color=blue] (-1,2) circle (2.5pt );
      \filldraw [color=blue] (-4,-4) circle (2.5pt );
      \filldraw [color=yellow] (-4,-4) circle (2.1pt );
      \filldraw [color=blue] (0,-1) circle (2.5pt );
      \filldraw [color=white] (0,-1) circle (2.1pt );
      \filldraw [color=blue] (4,-3) circle (2.5pt );

      \filldraw [color=red] (2,1) circle (2.5pt );

      \node at (3.3,2.7) {$x_1$};
      \node at (-0.7,1.7) {$x_2$};
      \node at (-3.7,-4.3) {$x_3$};
      \node at (0.3,-1.3) {$x_4$};
      \node at (4.3,-3.3) {$x_5$};

      \node at (2.3,0.7) {$q$};
      \end{tikzpicture}
  \end{column}
 \end{columns}
\end{frame}

%Beispiel2 Wähle c=x_3 und s=x_4
\begin{frame}{Orchards Algorithm}{Example}
 \begin{columns}[T]
  \begin{column}{.35\textwidth}
    \begin{itemize}
     \item Set $c:=x_3$ and $s:= x_4$
     \item As $7.810 \approx d(c, q) > d(s, q) \approx 2.828$, set $c:=s$
    \end{itemize}
  \end{column}
  \begin{column}{.60\textwidth}
     \begin{tikzpicture}[%
      scale=0.6,
      ]
      \clip (-5.0,-5.0) rectangle (5.0,5.0);
      \draw [help lines] (0,0) grid (6,5);
      \draw [help lines] (-6,0) grid (0,5);
      \draw [help lines] (0,-6) grid (6,0);
      \draw [help lines] (-6,-6) grid (0,0);
      \draw [color=black,->] (-5.0,0) -- (5.0,0);
      \draw [color=black,->] (0,-5.0) -- (0,5.0);

      \draw [color=gray, line width=0.5pt, solid] (-4,-4) circle (5);
      \draw [color=gray, line width=0.5pt, solid] (-4,-4) circle (6.708);
      \draw [color=gray, line width=0.5pt, solid] (-4,-4) circle (8.062);
      \draw [color=gray, line width=0.5pt, solid] (-4,-4) circle (9.899);
      \draw [color=yellow, line width=0.5pt, solid] (-4,-4) circle (15.62);
      \draw [color=yellow, line width=0.5pt, solid] (-4,-4) circle (15.62);

      \draw[color=gray, line width=0.5pt, dashed] (2,1) -- (-4,-4);
      \draw[color=gray, line width=0.5pt, dashed] (2,1) -- (0,-1);

      \filldraw [color=blue] (3,3) circle (2.5pt );
      \filldraw [color=blue] (-1,2) circle (2.5pt );
      \filldraw [color=blue] (-4,-4) circle (2.5pt );
      \filldraw [color=yellow] (-4,-4) circle (2.1pt );
      \filldraw [color=blue] (0,-1) circle (2.5pt );
      \filldraw [color=white] (0,-1) circle (2.1pt );
      \filldraw [color=blue] (4,-3) circle (2.5pt );

      \filldraw [color=red] (2,1) circle (2.5pt );

      \node at (3.3,2.7) {$x_1$};
      \node at (-0.7,1.7) {$x_2$};
      \node at (-3.7,-4.3) {$x_3$};
      \node at (0.3,-1.3) {$x_4$};
      \node at (4.3,-3.3) {$x_5$};

      \node at (2.3,0.7) {$q$};
      \end{tikzpicture}
  \end{column}
 \end{columns}
\end{frame}

%Beispiel2 Wähle c=x_4 und s=x_2
\begin{frame}<handout:0>{Orchards Algorithm}{Example}
 \begin{columns}[T]
  \begin{column}{.35\textwidth}
    \begin{itemize}
     \item Set $c:=x_4$ and $s:= x_2$
    \end{itemize}
  \end{column}
  \begin{column}{.60\textwidth}
     \begin{tikzpicture}[%
      scale=0.6,
      ]
      \clip (-5.0,-5.0) rectangle (5.0,5.0);
      \draw [help lines] (0,0) grid (6,5);
      \draw [help lines] (-6,0) grid (0,5);
      \draw [help lines] (0,-6) grid (6,0);
      \draw [help lines] (-6,-6) grid (0,0);
      \draw [color=black,->] (-5.0,0) -- (5.0,0);
      \draw [color=black,->] (0,-5.0) -- (0,5.0);

      \draw [color=gray, line width=0.5pt, solid] (0,-1) circle (3.162);
      \draw [color=gray, line width=0.5pt, solid] (0,-1) circle (4.472);
      \draw [color=gray, line width=0.5pt, solid] (0,-1) circle (5);
      \draw [color=yellow, line width=0.5pt, solid] (0,-1) circle (5.656);
      \draw [color=yellow, line width=0.5pt, solid] (0,-1) circle (5.656);

      \filldraw [color=blue] (3,3) circle (2.5pt );
      \filldraw [color=blue] (-1,2) circle (2.5pt );
      \filldraw [color=white] (-1,2) circle (2.1pt );
      \filldraw [color=blue] (-4,-4) circle (2.5pt );
      \filldraw [color=blue] (0,-1) circle (2.5pt );
      \filldraw [color=yellow] (0,-1) circle (2.1pt );
      \filldraw [color=blue] (4,-3) circle (2.5pt );

      \filldraw [color=red] (2,1) circle (2.5pt );

      \node at (3.3,2.7) {$x_1$};
      \node at (-0.7,1.7) {$x_2$};
      \node at (-3.7,-4.3) {$x_3$};
      \node at (0.3,-1.3) {$x_4$};
      \node at (4.3,-3.3) {$x_5$};

      \node at (2.3,0.7) {$q$};
      \end{tikzpicture}
  \end{column}
 \end{columns}
\end{frame}

%Beispiel2 Wähle c=x_4 und s=x_2
\begin{frame}<handout:0>{Orchards Algorithm}{Example}
 \begin{columns}[T]
  \begin{column}{.35\textwidth}
    \begin{itemize}
     \item Set $c:=x_4$ and $s:= x_2$
     \item As $2.828 \approx d(c, q) < d(s, q) \approx 3.162$, no new $c$
    \end{itemize}
  \end{column}
  \begin{column}{.60\textwidth}
     \begin{tikzpicture}[%
      scale=0.6,
      ]
      \clip (-5.0,-5.0) rectangle (5.0,5.0);
      \draw [help lines] (0,0) grid (6,5);
      \draw [help lines] (-6,0) grid (0,5);
      \draw [help lines] (0,-6) grid (6,0);
      \draw [help lines] (-6,-6) grid (0,0);
      \draw [color=black,->] (-5.0,0) -- (5.0,0);
      \draw [color=black,->] (0,-5.0) -- (0,5.0);

      \draw [color=gray, line width=0.5pt, solid] (0,-1) circle (3.162);
      \draw [color=gray, line width=0.5pt, solid] (0,-1) circle (4.472);
      \draw [color=gray, line width=0.5pt, solid] (0,-1) circle (5);
      \draw [color=yellow, line width=0.5pt, solid] (0,-1) circle (5.656);

      \draw[color=gray, line width=0.5pt, dashed] (2,1) -- (-1,2);
      \draw[color=gray, line width=0.5pt, dashed] (2,1) -- (0,-1);

      \filldraw [color=blue] (3,3) circle (2.5pt );
      \filldraw [color=blue] (-1,2) circle (2.5pt );
      \filldraw [color=white] (-1,2) circle (2.1pt );
      \filldraw [color=blue] (-4,-4) circle (2.5pt );
      \filldraw [color=blue] (0,-1) circle (2.5pt );
      \filldraw [color=yellow] (0,-1) circle (2.1pt );
      \filldraw [color=blue] (4,-3) circle (2.5pt );

      \filldraw [color=red] (2,1) circle (2.5pt );

      \node at (3.3,2.7) {$x_1$};
      \node at (-0.7,1.7) {$x_2$};
      \node at (-3.7,-4.3) {$x_3$};
      \node at (0.3,-1.3) {$x_4$};
      \node at (4.3,-3.3) {$x_5$};

      \node at (2.3,0.7) {$q$};
      \end{tikzpicture}
  \end{column}
 \end{columns}
\end{frame}

%Beispiel2 Wähle c=x_4 und s=x_2
\begin{frame}{Orchards Algorithm}{Example}
 \begin{columns}[T]
  \begin{column}{.35\textwidth}
    \begin{itemize}
     \item Set $c:=x_4$ and $s:= x_2$
     \item As $2.828 \approx d(c, q) < d(s, q) \approx 3.162$, no new $c$
     \item As $3.162 \approx d(c, s) < 2 \cdot d(c, q) \approx 5.656$, no abort
    \end{itemize}
  \end{column}
  \begin{column}{.60\textwidth}
     \begin{tikzpicture}[%
      scale=0.6,
      ]
      \clip (-5.0,-5.0) rectangle (5.0,5.0);
      \draw [help lines] (0,0) grid (6,5);
      \draw [help lines] (-6,0) grid (0,5);
      \draw [help lines] (0,-6) grid (6,0);
      \draw [help lines] (-6,-6) grid (0,0);
      \draw [color=black,->] (-5.0,0) -- (5.0,0);
      \draw [color=black,->] (0,-5.0) -- (0,5.0);

      \draw [color=gray, line width=0.5pt, solid] (0,-1) circle (3.162);
      \draw [color=gray, line width=0.5pt, solid] (0,-1) circle (4.472);
      \draw [color=gray, line width=0.5pt, solid] (0,-1) circle (5);
      \draw [color=yellow, line width=0.5pt, solid] (0,-1) circle (5.656);

      \draw[color=gray, line width=0.5pt, dashed] (2,1) -- (-1,2);
      \draw[color=gray, line width=0.5pt, dashed] (2,1) -- (0,-1);
      \draw[color=gray, line width=0.5pt, dashed] (-1,2) -- (0,-1);

      \filldraw [color=blue] (3,3) circle (2.5pt );
      \filldraw [color=blue] (-1,2) circle (2.5pt );
      \filldraw [color=white] (-1,2) circle (2.1pt );
      \filldraw [color=blue] (-4,-4) circle (2.5pt );
      \filldraw [color=blue] (0,-1) circle (2.5pt );
      \filldraw [color=yellow] (0,-1) circle (2.1pt );
      \filldraw [color=blue] (4,-3) circle (2.5pt );

      \filldraw [color=red] (2,1) circle (2.5pt );

      \node at (3.3,2.7) {$x_1$};
      \node at (-0.7,1.7) {$x_2$};
      \node at (-3.7,-4.3) {$x_3$};
      \node at (0.3,-1.3) {$x_4$};
      \node at (4.3,-3.3) {$x_5$};

      \node at (2.3,0.7) {$q$};
      \end{tikzpicture}
  \end{column}
 \end{columns}
\end{frame}

%Beispiel2 Wähle c=x_4 und s=x_5
\begin{frame}<handout:0>{Orchards Algorithm}{Example}
 \begin{columns}[T]
  \begin{column}{.35\textwidth}
    \begin{itemize}
     \item Set $s:= x_5$
    \end{itemize}
  \end{column}
  \begin{column}{.60\textwidth}
     \begin{tikzpicture}[%
      scale=0.6,
      ]
      \clip (-5.0,-5.0) rectangle (5.0,5.0);
      \draw [help lines] (0,0) grid (6,5);
      \draw [help lines] (-6,0) grid (0,5);
      \draw [help lines] (0,-6) grid (6,0);
      \draw [help lines] (-6,-6) grid (0,0);
      \draw [color=black,->] (-5.0,0) -- (5.0,0);
      \draw [color=black,->] (0,-5.0) -- (0,5.0);

      \draw [color=gray, line width=0.5pt, solid] (0,-1) circle (3.162);
      \draw [color=gray, line width=0.5pt, solid] (0,-1) circle (4.472);
      \draw [color=gray, line width=0.5pt, solid] (0,-1) circle (5);
      \draw [color=yellow, line width=0.5pt, solid] (0,-1) circle (5.656);

      \filldraw [color=blue] (3,3) circle (2.5pt );
      \filldraw [color=blue] (-1,2) circle (2.5pt );
      \filldraw [color=blue] (-4,-4) circle (2.5pt );
      \filldraw [color=blue] (0,-1) circle (2.5pt );
      \filldraw [color=yellow] (0,-1) circle (2.1pt );
      \filldraw [color=blue] (4,-3) circle (2.5pt );
      \filldraw [color=white] (4,-3) circle (2.1pt );

      \filldraw [color=red] (2,1) circle (2.5pt );

      \node at (3.3,2.7) {$x_1$};
      \node at (-0.7,1.7) {$x_2$};
      \node at (-3.7,-4.3) {$x_3$};
      \node at (0.3,-1.3) {$x_4$};
      \node at (4.3,-3.3) {$x_5$};

      \node at (2.3,0.7) {$q$};
      \end{tikzpicture}
  \end{column}
 \end{columns}
\end{frame}

%Beispiel2 Wähle c=x_4 und s=x_5
\begin{frame}<handout:0>{Orchards Algorithm}{Example}
 \begin{columns}[T]
  \begin{column}{.35\textwidth}
    \begin{itemize}
     \item Set $s:= x_5$
     \item As $2.828 \approx d(c, q) < d(s, q) \approx 4.472$, no new $c$
    \end{itemize}
  \end{column}
  \begin{column}{.60\textwidth}
     \begin{tikzpicture}[%
      scale=0.6,
      ]
      \clip (-5.0,-5.0) rectangle (5.0,5.0);
      \draw [help lines] (0,0) grid (6,5);
      \draw [help lines] (-6,0) grid (0,5);
      \draw [help lines] (0,-6) grid (6,0);
      \draw [help lines] (-6,-6) grid (0,0);
      \draw [color=black,->] (-5.0,0) -- (5.0,0);
      \draw [color=black,->] (0,-5.0) -- (0,5.0);

      \draw [color=gray, line width=0.5pt, solid] (0,-1) circle (3.162);
      \draw [color=gray, line width=0.5pt, solid] (0,-1) circle (4.472);
      \draw [color=gray, line width=0.5pt, solid] (0,-1) circle (5);
      \draw [color=yellow, line width=0.5pt, solid] (0,-1) circle (5.656);

      \draw[color=gray, line width=0.5pt, dashed] (2,1) -- (4,-3);
      \draw[color=gray, line width=0.5pt, dashed] (2,1) -- (0,-1);

      \filldraw [color=blue] (3,3) circle (2.5pt );
      \filldraw [color=blue] (-1,2) circle (2.5pt );
      \filldraw [color=blue] (-4,-4) circle (2.5pt );
      \filldraw [color=blue] (0,-1) circle (2.5pt );
      \filldraw [color=yellow] (0,-1) circle (2.1pt );
      \filldraw [color=blue] (4,-3) circle (2.5pt );
      \filldraw [color=white] (4,-3) circle (2.1pt );

      \filldraw [color=red] (2,1) circle (2.5pt );

      \node at (3.3,2.7) {$x_1$};
      \node at (-0.7,1.7) {$x_2$};
      \node at (-3.7,-4.3) {$x_3$};
      \node at (0.3,-1.3) {$x_4$};
      \node at (4.3,-3.3) {$x_5$};

      \node at (2.3,0.7) {$q$};
      \end{tikzpicture}
  \end{column}
 \end{columns}
\end{frame}

%Beispiel2 Wähle c=x_4 und s=x_5
\begin{frame}{Orchards Algorithm}{Example}
 \begin{columns}[T]
  \begin{column}{.35\textwidth}
    \begin{itemize}
     \item Set $s:= x_5$
     \item As $2.828 \approx d(c, q) < d(s, q) \approx 4.472$, no new $c$
     \item As $4.472 \approx d(c, s) < 2 \cdot d(c, q) \approx 5.656$, no abort
    \end{itemize}
  \end{column}
  \begin{column}{.60\textwidth}
     \begin{tikzpicture}[%
      scale=0.6,
      ]
      \clip (-5.0,-5.0) rectangle (5.0,5.0);
      \draw [help lines] (0,0) grid (6,5);
      \draw [help lines] (-6,0) grid (0,5);
      \draw [help lines] (0,-6) grid (6,0);
      \draw [help lines] (-6,-6) grid (0,0);
      \draw [color=black,->] (-5.0,0) -- (5.0,0);
      \draw [color=black,->] (0,-5.0) -- (0,5.0);

      \draw [color=gray, line width=0.5pt, solid] (0,-1) circle (3.162);
      \draw [color=gray, line width=0.5pt, solid] (0,-1) circle (4.472);
      \draw [color=gray, line width=0.5pt, solid] (0,-1) circle (5);
      \draw [color=yellow, line width=0.5pt, solid] (0,-1) circle (5.656);

      \draw[color=gray, line width=0.5pt, dashed] (2,1) -- (4,-3);
      \draw[color=gray, line width=0.5pt, dashed] (2,1) -- (0,-1);
      \draw[color=gray, line width=0.5pt, dashed] (4,-3) -- (0,-1);

      \filldraw [color=blue] (3,3) circle (2.5pt );
      \filldraw [color=blue] (-1,2) circle (2.5pt );
      \filldraw [color=blue] (-4,-4) circle (2.5pt );
      \filldraw [color=blue] (0,-1) circle (2.5pt );
      \filldraw [color=yellow] (0,-1) circle (2.1pt );
      \filldraw [color=blue] (4,-3) circle (2.5pt );
      \filldraw [color=white] (4,-3) circle (2.1pt );

      \filldraw [color=red] (2,1) circle (2.5pt );

      \node at (3.3,2.7) {$x_1$};
      \node at (-0.7,1.7) {$x_2$};
      \node at (-3.7,-4.3) {$x_3$};
      \node at (0.3,-1.3) {$x_4$};
      \node at (4.3,-3.3) {$x_5$};

      \node at (2.3,0.7) {$q$};
      \end{tikzpicture}
  \end{column}
 \end{columns}
\end{frame}

%Beispiel2 Wähle c=x_4 und s=x_1
\begin{frame}<handout:0>{Orchards Algorithm}{Example}
 \begin{columns}[T]
  \begin{column}{.35\textwidth}
    \begin{itemize}
     \item Set $s:= x_1$
    \end{itemize}
  \end{column}
  \begin{column}{.60\textwidth}
     \begin{tikzpicture}[%
      scale=0.6,
      ]
      \clip (-5.0,-5.0) rectangle (5.0,5.0);
      \draw [help lines] (0,0) grid (6,5);
      \draw [help lines] (-6,0) grid (0,5);
      \draw [help lines] (0,-6) grid (6,0);
      \draw [help lines] (-6,-6) grid (0,0);
      \draw [color=black,->] (-5.0,0) -- (5.0,0);
      \draw [color=black,->] (0,-5.0) -- (0,5.0);

      \draw [color=gray, line width=0.5pt, solid] (0,-1) circle (3.162);
      \draw [color=gray, line width=0.5pt, solid] (0,-1) circle (4.472);
      \draw [color=gray, line width=0.5pt, solid] (0,-1) circle (5);

      \filldraw [color=blue] (3,3) circle (2.5pt );
      \filldraw [color=white] (3,3) circle (2.1pt );
      \filldraw [color=blue] (-1,2) circle (2.5pt );
      \filldraw [color=blue] (-4,-4) circle (2.5pt );
      \filldraw [color=blue] (0,-1) circle (2.5pt );
      \filldraw [color=yellow] (0,-1) circle (2.1pt );
      \filldraw [color=blue] (4,-3) circle (2.5pt );

      \filldraw [color=red] (2,1) circle (2.5pt );

      \node at (3.3,2.7) {$x_1$};
      \node at (-0.7,1.7) {$x_2$};
      \node at (-3.7,-4.3) {$x_3$};
      \node at (0.3,-1.3) {$x_4$};
      \node at (4.3,-3.3) {$x_5$};

      \node at (2.3,0.7) {$q$};
      \end{tikzpicture}
  \end{column}
 \end{columns}
\end{frame}

%Beispiel2 Wähle c=x_4 und s=x_1
\begin{frame}{Orchards Algorithm}{Example}
 \begin{columns}[T]
  \begin{column}{.35\textwidth}
    \begin{itemize}
     \item Set $s:= x_1$
     \item As $2.828 \approx d(c, q) > d(s, q) \approx 2.236$, set $c:=s$
    \end{itemize}
  \end{column}
  \begin{column}{.60\textwidth}
     \begin{tikzpicture}[%
      scale=0.6,
      ]
      \clip (-5.0,-5.0) rectangle (5.0,5.0);
      \draw [help lines] (0,0) grid (6,5);
      \draw [help lines] (-6,0) grid (0,5);
      \draw [help lines] (0,-6) grid (6,0);
      \draw [help lines] (-6,-6) grid (0,0);
      \draw [color=black,->] (-5.0,0) -- (5.0,0);
      \draw [color=black,->] (0,-5.0) -- (0,5.0);

      \draw [color=gray, line width=0.5pt, solid] (0,-1) circle (3.162);
      \draw [color=gray, line width=0.5pt, solid] (0,-1) circle (4.472);
      \draw [color=gray, line width=0.5pt, solid] (0,-1) circle (5);

      \draw[color=gray, line width=0.5pt, dashed] (2,1) -- (3,3);
      \draw[color=gray, line width=0.5pt, dashed] (2,1) -- (0,-1);

      \filldraw [color=blue] (3,3) circle (2.5pt );
      \filldraw [color=white] (3,3) circle (2.1pt );
      \filldraw [color=blue] (-1,2) circle (2.5pt );
      \filldraw [color=blue] (-4,-4) circle (2.5pt );
      \filldraw [color=blue] (0,-1) circle (2.5pt );
      \filldraw [color=yellow] (0,-1) circle (2.1pt );
      \filldraw [color=blue] (4,-3) circle (2.5pt );

      \filldraw [color=red] (2,1) circle (2.5pt );

      \node at (3.3,2.7) {$x_1$};
      \node at (-0.7,1.7) {$x_2$};
      \node at (-3.7,-4.3) {$x_3$};
      \node at (0.3,-1.3) {$x_4$};
      \node at (4.3,-3.3) {$x_5$};

      \node at (2.3,0.7) {$q$};
      \end{tikzpicture}
  \end{column}
 \end{columns}
\end{frame}

%Beispiel2 Wähle c=x_1 und s=x_2
\begin{frame}<handout:0>{Orchards Algorithm}{Example}
 \begin{columns}[T]
  \begin{column}{.35\textwidth}
    \begin{itemize}
     \item Set $c:= x_1$ and $s:=x_2$
    \end{itemize}
  \end{column}
  \begin{column}{.60\textwidth}
     \begin{tikzpicture}[%
      scale=0.6,
      ]
      \clip (-5.0,-5.0) rectangle (5.0,5.0);
      \draw [help lines] (0,0) grid (6,5);
      \draw [help lines] (-6,0) grid (0,5);
      \draw [help lines] (0,-6) grid (6,0);
      \draw [help lines] (-6,-6) grid (0,0);
      \draw [color=black,->] (-5.0,0) -- (5.0,0);
      \draw [color=black,->] (0,-5.0) -- (0,5.0);

      \draw [color=gray, line width=0.5pt, solid] (3,3) circle (4.123);
      \draw [color=gray, line width=0.5pt, solid] (3,3) circle (5);
      \draw [color=gray, line width=0.5pt, solid] (3,3) circle (6.083);
      \draw [color=gray, line width=0.5pt, solid] (3,3) circle (9.899);
      \draw [color=yellow, line width=0.5pt, solid] (3,3) circle (4.472);

      \filldraw [color=blue] (3,3) circle (2.5pt );
      \filldraw [color=yellow] (3,3) circle (2.1pt );
      \filldraw [color=blue] (-1,2) circle (2.5pt );
      \filldraw [color=white] (-1,2) circle (2.1pt );
      \filldraw [color=blue] (-4,-4) circle (2.5pt );
      \filldraw [color=blue] (0,-1) circle (2.5pt );
      \filldraw [color=blue] (4,-3) circle (2.5pt );

      \filldraw [color=red] (2,1) circle (2.5pt );

      \node at (3.3,2.7) {$x_1$};
      \node at (-0.7,1.7) {$x_2$};
      \node at (-3.7,-4.3) {$x_3$};
      \node at (0.3,-1.3) {$x_4$};
      \node at (4.3,-3.3) {$x_5$};

      \node at (2.3,0.7) {$q$};
      \end{tikzpicture}
  \end{column}
 \end{columns}
\end{frame}

%Beispiel2 Wähle c=x_1 und s=x_2
\begin{frame}<handout:0>{Orchards Algorithm}{Example}
 \begin{columns}[T]
  \begin{column}{.35\textwidth}
    \begin{itemize}
     \item Set $c:= x_1$ and $s:=x_2$
     \item As $2.236 \approx d(c, q) < d(s, q) \approx 3.162$, no new $c$
    \end{itemize}
  \end{column}
  \begin{column}{.60\textwidth}
     \begin{tikzpicture}[%
      scale=0.6,
      ]
      \clip (-5.0,-5.0) rectangle (5.0,5.0);
      \draw [help lines] (0,0) grid (6,5);
      \draw [help lines] (-6,0) grid (0,5);
      \draw [help lines] (0,-6) grid (6,0);
      \draw [help lines] (-6,-6) grid (0,0);
      \draw [color=black,->] (-5.0,0) -- (5.0,0);
      \draw [color=black,->] (0,-5.0) -- (0,5.0);

      \draw [color=gray, line width=0.5pt, solid] (3,3) circle (4.123);
      \draw [color=gray, line width=0.5pt, solid] (3,3) circle (5);
      \draw [color=gray, line width=0.5pt, solid] (3,3) circle (6.083);
      \draw [color=gray, line width=0.5pt, solid] (3,3) circle (9.899);
      \draw [color=yellow, line width=0.5pt, solid] (3,3) circle (4.472);

      \draw[color=gray, line width=0.5pt, dashed] (2,1) -- (3,3);
      \draw[color=gray, line width=0.5pt, dashed] (2,1) -- (-1,2);

      \filldraw [color=blue] (3,3) circle (2.5pt );
      \filldraw [color=yellow] (3,3) circle (2.1pt );
      \filldraw [color=blue] (-1,2) circle (2.5pt );
      \filldraw [color=white] (-1,2) circle (2.1pt );
      \filldraw [color=blue] (-4,-4) circle (2.5pt );
      \filldraw [color=blue] (0,-1) circle (2.5pt );
      \filldraw [color=blue] (4,-3) circle (2.5pt );

      \filldraw [color=red] (2,1) circle (2.5pt );

      \node at (3.3,2.7) {$x_1$};
      \node at (-0.7,1.7) {$x_2$};
      \node at (-3.7,-4.3) {$x_3$};
      \node at (0.3,-1.3) {$x_4$};
      \node at (4.3,-3.3) {$x_5$};

      \node at (2.3,0.7) {$q$};
      \end{tikzpicture}
  \end{column}
 \end{columns}
\end{frame}

%Beispiel2 Wähle c=x_1 und s=x_2
\begin{frame}{Orchards Algorithm}{Example}
 \begin{columns}[T]
  \begin{column}{.35\textwidth}
    \begin{itemize}
     \item Set $c:= x_1$ and $s:=x_2$
     \item As $2.236 \approx d(c, q) < d(s, q) \approx 3.162$, no new $c$
     \item As $4.123 \approx d(c, s) < 2 \cdot d(c, q) \approx 4.472$, no abort
    \end{itemize}
  \end{column}
  \begin{column}{.60\textwidth}
     \begin{tikzpicture}[%
      scale=0.6,
      ]
      \clip (-5.0,-5.0) rectangle (5.0,5.0);
      \draw [help lines] (0,0) grid (6,5);
      \draw [help lines] (-6,0) grid (0,5);
      \draw [help lines] (0,-6) grid (6,0);
      \draw [help lines] (-6,-6) grid (0,0);
      \draw [color=black,->] (-5.0,0) -- (5.0,0);
      \draw [color=black,->] (0,-5.0) -- (0,5.0);

      \draw [color=gray, line width=0.5pt, solid] (3,3) circle (4.123);
      \draw [color=gray, line width=0.5pt, solid] (3,3) circle (5);
      \draw [color=gray, line width=0.5pt, solid] (3,3) circle (6.083);
      \draw [color=gray, line width=0.5pt, solid] (3,3) circle (9.899);
      \draw [color=yellow, line width=0.5pt, solid] (3,3) circle (4.472);

      \draw[color=gray, line width=0.5pt, dashed] (2,1) -- (3,3);
      \draw[color=gray, line width=0.5pt, dashed] (2,1) -- (-1,2);
      \draw[color=gray, line width=0.5pt, dashed] (3,3) -- (-1,2);

      \filldraw [color=blue] (3,3) circle (2.5pt );
      \filldraw [color=yellow] (3,3) circle (2.1pt );
      \filldraw [color=blue] (-1,2) circle (2.5pt );
      \filldraw [color=white] (-1,2) circle (2.1pt );
      \filldraw [color=blue] (-4,-4) circle (2.5pt );
      \filldraw [color=blue] (0,-1) circle (2.5pt );
      \filldraw [color=blue] (4,-3) circle (2.5pt );

      \filldraw [color=red] (2,1) circle (2.5pt );

      \node at (3.3,2.7) {$x_1$};
      \node at (-0.7,1.7) {$x_2$};
      \node at (-3.7,-4.3) {$x_3$};
      \node at (0.3,-1.3) {$x_4$};
      \node at (4.3,-3.3) {$x_5$};

      \node at (2.3,0.7) {$q$};
      \end{tikzpicture}
  \end{column}
 \end{columns}
\end{frame}

%Beispiel2 Wähle c=x_1 und s=x_4
\begin{frame}<handout:0>{Orchards Algorithm}{Example}
 \begin{columns}[T]
  \begin{column}{.35\textwidth}
    \begin{itemize}
     \item Set $s:=x_4$
    \end{itemize}
  \end{column}
  \begin{column}{.60\textwidth}
     \begin{tikzpicture}[%
      scale=0.6,
      ]
      \clip (-5.0,-5.0) rectangle (5.0,5.0);
      \draw [help lines] (0,0) grid (6,5);
      \draw [help lines] (-6,0) grid (0,5);
      \draw [help lines] (0,-6) grid (6,0);
      \draw [help lines] (-6,-6) grid (0,0);
      \draw [color=black,->] (-5.0,0) -- (5.0,0);
      \draw [color=black,->] (0,-5.0) -- (0,5.0);

      \draw [color=gray, line width=0.5pt, solid] (3,3) circle (4.123);
      \draw [color=gray, line width=0.5pt, solid] (3,3) circle (5);
      \draw [color=gray, line width=0.5pt, solid] (3,3) circle (6.083);
      \draw [color=gray, line width=0.5pt, solid] (3,3) circle (9.899);
      \draw [color=yellow, line width=0.5pt, solid] (3,3) circle (4.472);

      \filldraw [color=blue] (3,3) circle (2.5pt );
      \filldraw [color=yellow] (3,3) circle (2.1pt );
      \filldraw [color=blue] (-1,2) circle (2.5pt );
      \filldraw [color=blue] (-4,-4) circle (2.5pt );
      \filldraw [color=blue] (0,-1) circle (2.5pt );
      \filldraw [color=white] (0,-1) circle (2.1pt );
      \filldraw [color=blue] (4,-3) circle (2.5pt );

      \filldraw [color=red] (2,1) circle (2.5pt );

      \node at (3.3,2.7) {$x_1$};
      \node at (-0.7,1.7) {$x_2$};
      \node at (-3.7,-4.3) {$x_3$};
      \node at (0.3,-1.3) {$x_4$};
      \node at (4.3,-3.3) {$x_5$};

      \node at (2.3,0.7) {$q$};
      \end{tikzpicture}
  \end{column}
 \end{columns}
\end{frame}

%Beispiel2 Wähle c=x_1 und s=x_4
\begin{frame}<handout:0>{Orchards Algorithm}{Example}
 \begin{columns}[T]
  \begin{column}{.35\textwidth}
    \begin{itemize}
     \item Set $s:=x_4$
     \item As $2.236 \approx d(c, q) < d(s, q) \approx 2.828$, no new $c$
    \end{itemize}
  \end{column}
  \begin{column}{.60\textwidth}
     \begin{tikzpicture}[%
      scale=0.6,
      ]
      \clip (-5.0,-5.0) rectangle (5.0,5.0);
      \draw [help lines] (0,0) grid (6,5);
      \draw [help lines] (-6,0) grid (0,5);
      \draw [help lines] (0,-6) grid (6,0);
      \draw [help lines] (-6,-6) grid (0,0);
      \draw [color=black,->] (-5.0,0) -- (5.0,0);
      \draw [color=black,->] (0,-5.0) -- (0,5.0);

      \draw [color=gray, line width=0.5pt, solid] (3,3) circle (4.123);
      \draw [color=gray, line width=0.5pt, solid] (3,3) circle (5);
      \draw [color=gray, line width=0.5pt, solid] (3,3) circle (6.083);
      \draw [color=gray, line width=0.5pt, solid] (3,3) circle (9.899);
      \draw [color=yellow, line width=0.5pt, solid] (3,3) circle (4.472);

      \draw[color=gray, line width=0.5pt, dashed] (2,1) -- (3,3);
      \draw[color=gray, line width=0.5pt, dashed] (2,1) -- (0,-1);

      \filldraw [color=blue] (3,3) circle (2.5pt );
      \filldraw [color=yellow] (3,3) circle (2.1pt );
      \filldraw [color=blue] (-1,2) circle (2.5pt );
      \filldraw [color=blue] (-4,-4) circle (2.5pt );
      \filldraw [color=blue] (0,-1) circle (2.5pt );
      \filldraw [color=white] (0,-1) circle (2.1pt );
      \filldraw [color=blue] (4,-3) circle (2.5pt );

      \filldraw [color=red] (2,1) circle (2.5pt );

      \node at (3.3,2.7) {$x_1$};
      \node at (-0.7,1.7) {$x_2$};
      \node at (-3.7,-4.3) {$x_3$};
      \node at (0.3,-1.3) {$x_4$};
      \node at (4.3,-3.3) {$x_5$};

      \node at (2.3,0.7) {$q$};
      \end{tikzpicture}
  \end{column}
 \end{columns}
\end{frame}

%Beispiel2 Wähle c=x_1 und s=x_4
\begin{frame}{Orchards Algorithm}{Example}
 \begin{columns}[T]
  \begin{column}{.35\textwidth}
    \begin{itemize}
     \item Set $s:=x_4$
     \item As $2.236 \approx d(c, q) < d(s, q) \approx 2.828$, no new $c$
     \item As $5 \approx d(c, s) > 2 \cdot d(c, q) \approx 4.472$, \textcolor{green}{abort}
    \end{itemize}
  \end{column}
  \begin{column}{.60\textwidth}
     \begin{tikzpicture}[%
      scale=0.6,
      ]
      \clip (-5.0,-5.0) rectangle (5.0,5.0);
      \draw [help lines] (0,0) grid (6,5);
      \draw [help lines] (-6,0) grid (0,5);
      \draw [help lines] (0,-6) grid (6,0);
      \draw [help lines] (-6,-6) grid (0,0);
      \draw [color=black,->] (-5.0,0) -- (5.0,0);
      \draw [color=black,->] (0,-5.0) -- (0,5.0);

      \draw [color=gray, line width=0.5pt, solid] (3,3) circle (4.123);
      \draw [color=gray, line width=0.5pt, solid] (3,3) circle (5);
      \draw [color=gray, line width=0.5pt, solid] (3,3) circle (6.083);
      \draw [color=gray, line width=0.5pt, solid] (3,3) circle (9.899);
      \draw [color=yellow, line width=0.5pt, solid] (3,3) circle (4.472);

      \draw[color=gray, line width=0.5pt, dashed] (2,1) -- (3,3);
      \draw[color=gray, line width=0.5pt, dashed] (2,1) -- (0,-1);
      \draw[color=gray, line width=0.5pt, dashed] (3,3) -- (0,-1);

      \filldraw [color=blue] (3,3) circle (2.5pt );
      \filldraw [color=yellow] (3,3) circle (2.1pt );
      \filldraw [color=blue] (-1,2) circle (2.5pt );
      \filldraw [color=blue] (-4,-4) circle (2.5pt );
      \filldraw [color=blue] (0,-1) circle (2.5pt );
      \filldraw [color=white] (0,-1) circle (2.1pt );
      \filldraw [color=blue] (4,-3) circle (2.5pt );

      \filldraw [color=red] (2,1) circle (2.5pt );

      \node at (3.3,2.7) {$x_1$};
      \node at (-0.7,1.7) {$x_2$};
      \node at (-3.7,-4.3) {$x_3$};
      \node at (0.3,-1.3) {$x_4$};
      \node at (4.3,-3.3) {$x_5$};

      \node at (2.3,0.7) {$q$};
      \end{tikzpicture}
  \end{column}
 \end{columns}
\end{frame}

% Vor- und Nachteile
\begin{frame}{Orchards Algorithm}{Advantages and disadvantages}
 \begin{block}{Advantages}
  \begin{itemize}
   \item Faster as Full Search
  \end{itemize}
 \end{block}
 \pause
 \begin{block}{Disadvantages}
  \begin{itemize}
   \item Preprocessing needs large memory and runtime
  \end{itemize}
 \end{block}
 \pause
 \begin{block}{Improvement}
  \begin{itemize}
   \item Use MarkBits to ensure that no distance is calculated twice
  \end{itemize}
 \end{block}
\end{frame}

\subsection{Annulus Method}
\begin{frame}{Annulus Method}
 \begin{itemize}
  \item Create a list for a random item $p^* \in S$ with all items $x \in S$, ordered ascending to the distance
  \pause
  \item Choose random item $c \in S$
  \pause
  \item Walk alternating away from $p^*$ and back to it in the list
  \pause
  \item If current item $s$ has smaller distance to $q$ as $c$, set $c:= s$
  \pause
  \item Current item $s$ is under $c$:
  \begin{itemize}
   \item If $d(p^*, s) < d(p^*, q) - d(c, q)$, ignore all items under $s$ (Triangle inequality~\ref{ineq:3})
  \end{itemize}
  \pause
  \item Current item $s$ is above $c$:
  \begin{itemize}
   \item If $d(p^*, s) > d(p*, q) + d(c, q)$, ignore all items above $s$ (Triangle inequality~\ref{ineq:3})
  \end{itemize}
  \pause
  \item $c$ is the nearest neighbour if the entire list is traversed
 \end{itemize}
\end{frame}

%Beispiel3
\begin{frame}{Annulus Method}{Example}
 \begin{columns}[T]
  \begin{column}{.35\textwidth}
    $\mathbb{U} = \mathbb{R}^2$
    \begin{block}{Items}
      $x_1 = (3, 3)$\\
      $x_2 = (-1, 2)$\\
      $x_3 = (-4, -4)$\\
      $x_4 = (0, -1)$\\
      $x_5 = (4, -3)$
    \end{block}
    \begin{block}{Query item}
      $q = (2, 1)$
    \end{block}
  \end{column}
  \begin{column}{.60\textwidth}
     \begin{tikzpicture}[%
      scale=0.6,
      ]
      \clip (-5.0,-5.0) rectangle (5.0,5.0);
      \draw [help lines] (0,0) grid (6,5);
      \draw [help lines] (-6,0) grid (0,5);
      \draw [help lines] (0,-6) grid (6,0);
      \draw [help lines] (-6,-6) grid (0,0);
      \draw [color=black,->] (-5.0,0) -- (5.0,0);
      \draw [color=black,->] (0,-5.0) -- (0,5.0);

      \filldraw [color={rgb:red,0;green,0;blue,255}] (3,3) circle (2.5pt );
      \filldraw [color={rgb:red,0;green,0;blue,255}] (-1,2) circle (2.5pt );
      \filldraw [color={rgb:red,0;green,0;blue,255}] (-4,-4) circle (2.5pt );
      \filldraw [color={rgb:red,0;green,0;blue,255}] (0,-1) circle (2.5pt );
      \filldraw [color={rgb:red,0;green,0;blue,255}] (4,-3) circle (2.5pt );

      \filldraw [color={rgb:red,255;green,0;blue,0}] (2,1) circle (2.5pt );

      \node at (3.3,2.7) {$x_1$};
      \node at (-0.7,1.7) {$x_2$};
      \node at (-3.7,-4.3) {$x_3$};
      \node at (0.3,-1.3) {$x_4$};
      \node at (4.3,-3.3) {$x_5$};

      \node at (2.3,0.7) {$q$};
      \end{tikzpicture}
  \end{column}
 \end{columns}
\end{frame}

%Beispiel3 Abstand
\begin{frame}{Annulus Method}{Example}
  \begin{block}{Distances}
  \begin{center}
    \begin{tabular}{r|ccccc}
      & $x_1$ & $x_2$ & $x_3$ & $x_4$ & $x_5$\\
      \hline
      $x_5$ & $\approx 6.083$ & $\approx 7.071$ & $\approx 8.062$ & $\approx 4.472$ & 0\\
    \end{tabular}
  \end{center}
  \end{block}
\end{frame}

%Beispiel3 Listen
\begin{frame}{Annulus Method}{Example}
 \begin{columns}[T]
  \begin{column}{.35\textwidth}
    $p^*:=x_5$ with $d(p^*, q) \approx 4.472$
    \begin{block}{List}
    $L(x_5) = \{x_5, x_4, x_1, x_2, x_3\}$\\
    \end{block}
  \end{column}
  \begin{column}{.6\textwidth}
     \begin{tikzpicture}[%
      scale=0.6,
      ]
      \clip (-5.0,-5.0) rectangle (5.0,5.0);
      \draw [help lines] (0,0) grid (6,5);
      \draw [help lines] (-6,0) grid (0,5);
      \draw [help lines] (0,-6) grid (6,0);
      \draw [help lines] (-6,-6) grid (0,0);
      \draw [color=black,->] (-5.0,0) -- (5.0,0);
      \draw [color=black,->] (0,-5.0) -- (0,5.0);

      \draw[color=gray, line width=0.5pt, dashed] (3,3) -- (4,-3);
      \draw[color=gray, line width=0.5pt, dashed] (4,-3) -- (-4,-4);
      \draw[color=gray, line width=0.5pt, dashed] (4,-3) -- (0,-1);
      \draw[color=gray, line width=0.5pt, dashed] (4,-3) -- (-1,2);

      \filldraw [color=blue] (3,3) circle (2.5pt );
      \filldraw [color=blue] (-1,2) circle (2.5pt );
      \filldraw [color=blue] (-4,-4) circle (2.5pt );
      \filldraw [color=blue] (0,-1) circle (2.5pt );
      \filldraw [color=blue] (4,-3) circle (2.5pt );
      \filldraw [color=yellow] (4,-3) circle (2.1pt );

      \node at (3.3,2.7) {$x_1$};
      \node at (-0.7,1.7) {$x_2$};
      \node at (-3.7,-4.3) {$x_3$};
      \node at (0.3,-1.3) {$x_4$};
      \node at (4.3,-3.3) {$x_5$};
      \end{tikzpicture}
  \end{column}
 \end{columns}
\end{frame}

%Beispiel3 c:=x_2
\begin{frame}<handout:0>{Annulus Method}{Example}
 \begin{columns}[T]
  \begin{column}{.35\textwidth}
    \begin{itemize}
     \item Set $c:=x_2$ with $d(c,q) \approx 3.162$
    \end{itemize}
  \end{column}
  \begin{column}{.60\textwidth}
     \begin{tikzpicture}[%
      scale=0.6,
      ]
      \clip (-5.0,-5.0) rectangle (5.0,5.0);
      \draw [help lines] (0,0) grid (6,5);
      \draw [help lines] (-6,0) grid (0,5);
      \draw [help lines] (0,-6) grid (6,0);
      \draw [help lines] (-6,-6) grid (0,0);
      \draw [color=black,->] (-5.0,0) -- (5.0,0);
      \draw [color=black,->] (0,-5.0) -- (0,5.0);

      \draw [color=gray, line width=0.5pt, solid] (4,-3) circle (6.083);
      \draw [color=gray, line width=0.5pt, solid] (4,-3) circle (7.071);
      \draw [color=gray, line width=0.5pt, solid] (4,-3) circle (8.062);
      \draw [color=gray, line width=0.5pt, solid] (4,-3) circle (4.472);

      \filldraw [color=blue] (3,3) circle (2.5pt );
      \filldraw [color=blue] (-1,2) circle (2.5pt );
      \filldraw [color=white] (-1,2) circle (2.1pt );
      \filldraw [color=blue] (-4,-4) circle (2.5pt );
      \filldraw [color=blue] (0,-1) circle (2.5pt );
      \filldraw [color=blue] (4,-3) circle (2.5pt );
      \filldraw [color=yellow] (4,-3) circle (2.1pt );

      \filldraw [color=red] (2,1) circle (2.5pt );

      \node at (3.3,2.7) {$x_1$};
      \node at (-0.7,1.7) {$x_2$};
      \node at (-3.7,-4.3) {$x_3$};
      \node at (0.3,-1.3) {$x_4$};
      \node at (4.3,-3.3) {$x_5$};

      \node at (2.3,0.7) {$q$};
      \end{tikzpicture}
  \end{column}
 \end{columns}
\end{frame}

%Beispiel3 c:=x_2
\begin{frame}<handout:0>{Annulus Method}{Example}
 \begin{columns}[T]
  \begin{column}{.35\textwidth}
    \begin{itemize}
     \item Set $c:=x_2$ with $d(c, q) \approx 3.162$
     \item Set $s:=x_3$ with $d(s, q) \approx 7.810$
    \end{itemize}
  \end{column}
  \begin{column}{.60\textwidth}
     \begin{tikzpicture}[%
      scale=0.6,
      ]
      \clip (-5.0,-5.0) rectangle (5.0,5.0);
      \draw [help lines] (0,0) grid (6,5);
      \draw [help lines] (-6,0) grid (0,5);
      \draw [help lines] (0,-6) grid (6,0);
      \draw [help lines] (-6,-6) grid (0,0);
      \draw [color=black,->] (-5.0,0) -- (5.0,0);
      \draw [color=black,->] (0,-5.0) -- (0,5.0);

      \draw [color=gray, line width=0.5pt, solid] (4,-3) circle (6.083);
      \draw [color=gray, line width=0.5pt, solid] (4,-3) circle (7.071);
      \draw [color=gray, line width=0.5pt, solid] (4,-3) circle (8.062);
      \draw [color=gray, line width=0.5pt, solid] (4,-3) circle (4.472);

      \draw[color=darkgray, line width=1.0pt, dashed, ->] (-1,2) -- (-4,-4);

      \filldraw [color=blue] (3,3) circle (2.5pt );
      \filldraw [color=blue] (-1,2) circle (2.5pt );
      \filldraw [color=white] (-1,2) circle (2.1pt );
      \filldraw [color=blue] (-4,-4) circle (2.5pt );
      \filldraw [color=blue] (0,-1) circle (2.5pt );
      \filldraw [color=blue] (4,-3) circle (2.5pt );
      \filldraw [color=yellow] (4,-3) circle (2.1pt );

      \filldraw [color=red] (2,1) circle (2.5pt );

      \node at (3.3,2.7) {$x_1$};
      \node at (-0.7,1.7) {$x_2$};
      \node at (-3.7,-4.3) {$x_3$};
      \node at (0.3,-1.3) {$x_4$};
      \node at (4.3,-3.3) {$x_5$};

      \node at (2.3,0.7) {$q$};
      \end{tikzpicture}
  \end{column}
 \end{columns}
\end{frame}

%Beispiel3 c:=x_2
\begin{frame}{Annulus Method}{Example}
 \begin{columns}[T]
  \begin{column}{.35\textwidth}
    \begin{itemize}
     \item Set $c:=x_2$ with $d(c, q) \approx 3.162$
     \item Set $s:=x_3$ with $d(s, q) \approx 7.810$
     \item $8.062 \approx d(p^*, s) > d(p^*, q) + d(c,q) \approx 7.634 \Rightarrow$ ignore items above $x_3$
    \end{itemize}
  \end{column}
  \begin{column}{.60\textwidth}
     \begin{tikzpicture}[%
      scale=0.6,
      ]
      \clip (-5.0,-5.0) rectangle (5.0,5.0);
      \draw [help lines] (0,0) grid (6,5);
      \draw [help lines] (-6,0) grid (0,5);
      \draw [help lines] (0,-6) grid (6,0);
      \draw [help lines] (-6,-6) grid (0,0);
      \draw [color=black,->] (-5.0,0) -- (5.0,0);
      \draw [color=black,->] (0,-5.0) -- (0,5.0);

      \draw [color=gray, line width=0.5pt, solid] (4,-3) circle (6.083);
      \draw [color=gray, line width=0.5pt, solid] (4,-3) circle (7.071);
      \draw [color=gray, line width=0.5pt, solid] (4,-3) circle (8.062);
      \draw [color=gray, line width=0.5pt, solid] (4,-3) circle (4.472);

      \draw[color=darkgray, line width=1.0pt, dashed, ->] (-1,2) -- (-4,-4);

      \draw[color=gray, line width=0.5pt, dashed] (4,-3) -- (-4,-4);
      \draw[color=gray, line width=0.5pt, dashed] (4,-3) -- (2,1);
      \draw[color=gray, line width=0.5pt, dashed] (-1,2) -- (2,1);

      \filldraw [color=blue] (3,3) circle (2.5pt );
      \filldraw [color=blue] (-1,2) circle (2.5pt );
      \filldraw [color=white] (-1,2) circle (2.1pt );
      \filldraw [color=blue] (-4,-4) circle (2.5pt );
      \filldraw [color=blue] (0,-1) circle (2.5pt );
      \filldraw [color=blue] (4,-3) circle (2.5pt );
      \filldraw [color=yellow] (4,-3) circle (2.1pt );

      \filldraw [color=red] (2,1) circle (2.5pt );

      \node at (3.3,2.7) {$x_1$};
      \node at (-0.7,1.7) {$x_2$};
      \node at (-3.7,-4.3) {$x_3$};
      \node at (0.3,-1.3) {$x_4$};
      \node at (4.3,-3.3) {$x_5$};

      \node at (2.3,0.7) {$q$};
      \end{tikzpicture}
  \end{column}
 \end{columns}
\end{frame}

%Beispiel3 c:=x_2
\begin{frame}<handout:0>{Annulus Method}{Example}
 \begin{columns}[T]
  \begin{column}{.35\textwidth}
    \begin{itemize}
     \item Set $s:=x_1$ with $d(s, q) \approx 2.236$
    \end{itemize}
  \end{column}
  \begin{column}{.60\textwidth}
     \begin{tikzpicture}[%
      scale=0.6,
      ]
      \clip (-5.0,-5.0) rectangle (5.0,5.0);
      \draw [help lines] (0,0) grid (6,5);
      \draw [help lines] (-6,0) grid (0,5);
      \draw [help lines] (0,-6) grid (6,0);
      \draw [help lines] (-6,-6) grid (0,0);
      \draw [color=black,->] (-5.0,0) -- (5.0,0);
      \draw [color=black,->] (0,-5.0) -- (0,5.0);

      \draw [color=gray, line width=0.5pt, solid] (4,-3) circle (6.083);
      \draw [color=gray, line width=0.5pt, solid] (4,-3) circle (7.071);
      \draw [color=gray, line width=0.5pt, solid] (4,-3) circle (8.062);
      \draw [color=gray, line width=0.5pt, solid] (4,-3) circle (4.472);

      \draw[color=darkgray, line width=1.0pt, dashed, ->] (-1,2) -- (-4,-4);
      \draw[color=darkgray, line width=1.0pt, dashed, ->] (-4,-4) -- (3,3);

      \filldraw [color=blue] (3,3) circle (2.5pt );
      \filldraw [color=blue] (-1,2) circle (2.5pt );
      \filldraw [color=white] (-1,2) circle (2.1pt );
      \filldraw [color=gray] (-4,-4) circle (2.5pt );
      \filldraw [color=blue] (0,-1) circle (2.5pt );
      \filldraw [color=blue] (4,-3) circle (2.5pt );
      \filldraw [color=yellow] (4,-3) circle (2.1pt );

      \filldraw [color=red] (2,1) circle (2.5pt );

      \node at (3.3,2.7) {$x_1$};
      \node at (-0.7,1.7) {$x_2$};
      \node at (-3.7,-4.3) {$x_3$};
      \node at (0.3,-1.3) {$x_4$};
      \node at (4.3,-3.3) {$x_5$};

      \node at (2.3,0.7) {$q$};
      \end{tikzpicture}
  \end{column}
 \end{columns}
\end{frame}

%Beispiel3 c:=x_2
\begin{frame}{Annulus Method}{Example}
 \begin{columns}[T]
  \begin{column}{.35\textwidth}
    \begin{itemize}
     \item Set $s:=x_1$ with $d(s, q) \approx 2.236$
     \item As $d(s, q) < d(c, q)$, set $c:=s$
    \end{itemize}
  \end{column}
  \begin{column}{.60\textwidth}
     \begin{tikzpicture}[%
      scale=0.6,
      ]
      \clip (-5.0,-5.0) rectangle (5.0,5.0);
      \draw [help lines] (0,0) grid (6,5);
      \draw [help lines] (-6,0) grid (0,5);
      \draw [help lines] (0,-6) grid (6,0);
      \draw [help lines] (-6,-6) grid (0,0);
      \draw [color=black,->] (-5.0,0) -- (5.0,0);
      \draw [color=black,->] (0,-5.0) -- (0,5.0);

      \draw [color=gray, line width=0.5pt, solid] (4,-3) circle (6.083);
      \draw [color=gray, line width=0.5pt, solid] (4,-3) circle (7.071);
      \draw [color=gray, line width=0.5pt, solid] (4,-3) circle (8.062);
      \draw [color=gray, line width=0.5pt, solid] (4,-3) circle (4.472);

      \draw[color=darkgray, line width=1.0pt, dashed, ->] (-1,2) -- (-4,-4);
      \draw[color=darkgray, line width=1.0pt, dashed, ->] (-4,-4) -- (3,3);

      \draw[color=gray, line width=0.5pt, dashed] (3,3) -- (2,1);
      \draw[color=gray, line width=0.5pt, dashed] (-1,2) -- (2,1);

      \filldraw [color=blue] (3,3) circle (2.5pt );
      \filldraw [color=blue] (-1,2) circle (2.5pt );
      \filldraw [color=white] (-1,2) circle (2.1pt );
      \filldraw [color=gray] (-4,-4) circle (2.5pt );
      \filldraw [color=blue] (0,-1) circle (2.5pt );
      \filldraw [color=blue] (4,-3) circle (2.5pt );
      \filldraw [color=yellow] (4,-3) circle (2.1pt );

      \filldraw [color=red] (2,1) circle (2.5pt );

      \node at (3.3,2.7) {$x_1$};
      \node at (-0.7,1.7) {$x_2$};
      \node at (-3.7,-4.3) {$x_3$};
      \node at (0.3,-1.3) {$x_4$};
      \node at (4.3,-3.3) {$x_5$};

      \node at (2.3,0.7) {$q$};
      \end{tikzpicture}
  \end{column}
 \end{columns}
\end{frame}

%Beispiel3 c:=x_1
\begin{frame}<handout:0>{Annulus Method}{Example}
 \begin{columns}[T]
  \begin{column}{.35\textwidth}
    \begin{itemize}
     \item Set $c:=x_1$ with $d(c, q) \approx 2.236$
    \end{itemize}
  \end{column}
  \begin{column}{.60\textwidth}
     \begin{tikzpicture}[%
      scale=0.6,
      ]
      \clip (-5.0,-5.0) rectangle (5.0,5.0);
      \draw [help lines] (0,0) grid (6,5);
      \draw [help lines] (-6,0) grid (0,5);
      \draw [help lines] (0,-6) grid (6,0);
      \draw [help lines] (-6,-6) grid (0,0);
      \draw [color=black,->] (-5.0,0) -- (5.0,0);
      \draw [color=black,->] (0,-5.0) -- (0,5.0);

      \draw [color=gray, line width=0.5pt, solid] (4,-3) circle (6.083);
      \draw [color=gray, line width=0.5pt, solid] (4,-3) circle (7.071);
      \draw [color=gray, line width=0.5pt, solid] (4,-3) circle (8.062);
      \draw [color=gray, line width=0.5pt, solid] (4,-3) circle (4.472);

      \filldraw [color=blue] (3,3) circle (2.5pt );
      \filldraw [color=white] (3,3) circle (2.1pt );
      \filldraw [color=gray] (-1,2) circle (2.5pt );
      \filldraw [color=gray] (-4,-4) circle (2.5pt );
      \filldraw [color=blue] (0,-1) circle (2.5pt );
      \filldraw [color=blue] (4,-3) circle (2.5pt );
      \filldraw [color=yellow] (4,-3) circle (2.1pt );

      \filldraw [color=red] (2,1) circle (2.5pt );

      \node at (3.3,2.7) {$x_1$};
      \node at (-0.7,1.7) {$x_2$};
      \node at (-3.7,-4.3) {$x_3$};
      \node at (0.3,-1.3) {$x_4$};
      \node at (4.3,-3.3) {$x_5$};

      \node at (2.3,0.7) {$q$};
      \end{tikzpicture}
  \end{column}
 \end{columns}
\end{frame}

%Beispiel3 c:=x_1
\begin{frame}<handout:0>{Annulus Method}{Example}
 \begin{columns}[T]
  \begin{column}{.35\textwidth}
    \begin{itemize}
     \item Set $c:=x_1$ with $d(c, q) \approx 2.236$
     \item Set $s:=x_4$ with $d(s, q) \approx 2.828$
    \end{itemize}
  \end{column}
  \begin{column}{.60\textwidth}
     \begin{tikzpicture}[%
      scale=0.6,
      ]
      \clip (-5.0,-5.0) rectangle (5.0,5.0);
      \draw [help lines] (0,0) grid (6,5);
      \draw [help lines] (-6,0) grid (0,5);
      \draw [help lines] (0,-6) grid (6,0);
      \draw [help lines] (-6,-6) grid (0,0);
      \draw [color=black,->] (-5.0,0) -- (5.0,0);
      \draw [color=black,->] (0,-5.0) -- (0,5.0);

      \draw [color=gray, line width=0.5pt, solid] (4,-3) circle (6.083);
      \draw [color=gray, line width=0.5pt, solid] (4,-3) circle (7.071);
      \draw [color=gray, line width=0.5pt, solid] (4,-3) circle (8.062);
      \draw [color=gray, line width=0.5pt, solid] (4,-3) circle (4.472);

      \draw[color=darkgray, line width=1.0pt, dashed, ->] (3,3) -- (0,-1);

      \filldraw [color=blue] (3,3) circle (2.5pt );
      \filldraw [color=white] (3,3) circle (2.1pt );
      \filldraw [color=gray] (-1,2) circle (2.5pt );
      \filldraw [color=gray] (-4,-4) circle (2.5pt );
      \filldraw [color=blue] (0,-1) circle (2.5pt );
      \filldraw [color=blue] (4,-3) circle (2.5pt );
      \filldraw [color=yellow] (4,-3) circle (2.1pt );

      \filldraw [color=red] (2,1) circle (2.5pt );

      \node at (3.3,2.7) {$x_1$};
      \node at (-0.7,1.7) {$x_2$};
      \node at (-3.7,-4.3) {$x_3$};
      \node at (0.3,-1.3) {$x_4$};
      \node at (4.3,-3.3) {$x_5$};

      \node at (2.3,0.7) {$q$};
      \end{tikzpicture}
  \end{column}
 \end{columns}
\end{frame}

%Beispiel3 c:=x_1
\begin{frame}{Annulus Method}{Example}
 \begin{columns}[T]
  \begin{column}{.35\textwidth}
    \begin{itemize}
     \item Set $c:=x_1$ with $d(c, q) \approx 2.236$
     \item Set $s:=x_4$ with $d(s, q) \approx 2.828$
     \item $4.472 \approx d(p^*, s) > d(p^*, q) - d(c,q) \approx 2.236 \Rightarrow$ ignore no items
    \end{itemize}
  \end{column}
  \begin{column}{.60\textwidth}
     \begin{tikzpicture}[%
      scale=0.6,
      ]
      \clip (-5.0,-5.0) rectangle (5.0,5.0);
      \draw [help lines] (0,0) grid (6,5);
      \draw [help lines] (-6,0) grid (0,5);
      \draw [help lines] (0,-6) grid (6,0);
      \draw [help lines] (-6,-6) grid (0,0);
      \draw [color=black,->] (-5.0,0) -- (5.0,0);
      \draw [color=black,->] (0,-5.0) -- (0,5.0);

      \draw [color=gray, line width=0.5pt, solid] (4,-3) circle (6.083);
      \draw [color=gray, line width=0.5pt, solid] (4,-3) circle (7.071);
      \draw [color=gray, line width=0.5pt, solid] (4,-3) circle (8.062);
      \draw [color=gray, line width=0.5pt, solid] (4,-3) circle (4.472);

      \draw[color=darkgray, line width=1.0pt, dashed, ->] (3,3) -- (0,-1);

      \draw[color=gray, line width=0.5pt, dashed] (4,-3) -- (0,-1);
      \draw[color=gray, line width=0.5pt, dashed] (4,-3) -- (2,1);
      \draw[color=gray, line width=0.5pt, dashed] (3,3) -- (2,1);

      \filldraw [color=blue] (3,3) circle (2.5pt );
      \filldraw [color=white] (3,3) circle (2.1pt );
      \filldraw [color=gray] (-1,2) circle (2.5pt );
      \filldraw [color=gray] (-4,-4) circle (2.5pt );
      \filldraw [color=blue] (0,-1) circle (2.5pt );
      \filldraw [color=blue] (4,-3) circle (2.5pt );
      \filldraw [color=yellow] (4,-3) circle (2.1pt );

      \filldraw [color=red] (2,1) circle (2.5pt );

      \node at (3.3,2.7) {$x_1$};
      \node at (-0.7,1.7) {$x_2$};
      \node at (-3.7,-4.3) {$x_3$};
      \node at (0.3,-1.3) {$x_4$};
      \node at (4.3,-3.3) {$x_5$};

      \node at (2.3,0.7) {$q$};
      \end{tikzpicture}
  \end{column}
 \end{columns}
\end{frame}

%Beispiel3 c:=x_1
\begin{frame}<handout:0>{Annulus Method}{Example}
 \begin{columns}[T]
  \begin{column}{.35\textwidth}
    \begin{itemize}
     \item Set $s:=x_5$ with $d(s, q) \approx 4.472 < 2.236 \approx d(c, q)$
    \end{itemize}
  \end{column}
  \begin{column}{.60\textwidth}
     \begin{tikzpicture}[%
      scale=0.6,
      ]
      \clip (-5.0,-5.0) rectangle (5.0,5.0);
      \draw [help lines] (0,0) grid (6,5);
      \draw [help lines] (-6,0) grid (0,5);
      \draw [help lines] (0,-6) grid (6,0);
      \draw [help lines] (-6,-6) grid (0,0);
      \draw [color=black,->] (-5.0,0) -- (5.0,0);
      \draw [color=black,->] (0,-5.0) -- (0,5.0);

      \draw [color=gray, line width=0.5pt, solid] (4,-3) circle (6.083);
      \draw [color=gray, line width=0.5pt, solid] (4,-3) circle (7.071);
      \draw [color=gray, line width=0.5pt, solid] (4,-3) circle (8.062);
      \draw [color=gray, line width=0.5pt, solid] (4,-3) circle (4.472);

      \draw[color=darkgray, line width=1.0pt, dashed, ->] (3,3) -- (0,-1);
      \draw[color=darkgray, line width=1.0pt, dashed, ->] (0,-1) -- (4,-3);

      \filldraw [color=blue] (3,3) circle (2.5pt );
      \filldraw [color=white] (3,3) circle (2.1pt );
      \filldraw [color=gray] (-1,2) circle (2.5pt );
      \filldraw [color=gray] (-4,-4) circle (2.5pt );
      \filldraw [color=gray] (0,-1) circle (2.5pt );
      \filldraw [color=blue] (4,-3) circle (2.5pt );
      \filldraw [color=yellow] (4,-3) circle (2.1pt );

      \filldraw [color=red] (2,1) circle (2.5pt );

      \node at (3.3,2.7) {$x_1$};
      \node at (-0.7,1.7) {$x_2$};
      \node at (-3.7,-4.3) {$x_3$};
      \node at (0.3,-1.3) {$x_4$};
      \node at (4.3,-3.3) {$x_5$};

      \node at (2.3,0.7) {$q$};
      \end{tikzpicture}
  \end{column}
 \end{columns}
\end{frame}

%Beispiel3 c:=x_1
\begin{frame}{Annulus Method}{Example}
 \begin{columns}[T]
  \begin{column}{.35\textwidth}
    \begin{itemize}
     \item Set $s:=x_5$ with $d(s, q) \approx 4.472 < 2.236 \approx d(c, q)$
     \item End of list, $c = x_1$ nearest neighbour of $q$
    \end{itemize}
  \end{column}
  \begin{column}{.60\textwidth}
     \begin{tikzpicture}[%
      scale=0.6,
      ]
      \clip (-5.0,-5.0) rectangle (5.0,5.0);
      \draw [help lines] (0,0) grid (6,5);
      \draw [help lines] (-6,0) grid (0,5);
      \draw [help lines] (0,-6) grid (6,0);
      \draw [help lines] (-6,-6) grid (0,0);
      \draw [color=black,->] (-5.0,0) -- (5.0,0);
      \draw [color=black,->] (0,-5.0) -- (0,5.0);

      \draw [color=gray, line width=0.5pt, solid] (4,-3) circle (6.083);
      \draw [color=gray, line width=0.5pt, solid] (4,-3) circle (7.071);
      \draw [color=gray, line width=0.5pt, solid] (4,-3) circle (8.062);
      \draw [color=gray, line width=0.5pt, solid] (4,-3) circle (4.472);

      \draw[color=darkgray, line width=1.0pt, dashed, ->] (3,3) -- (0,-1);
      \draw[color=darkgray, line width=1.0pt, dashed, ->] (0,-1) -- (4,-3);

      \filldraw [color=blue] (3,3) circle (2.5pt );
      \filldraw [color=white] (3,3) circle (2.1pt );
      \filldraw [color=gray] (-1,2) circle (2.5pt );
      \filldraw [color=gray] (-4,-4) circle (2.5pt );
      \filldraw [color=gray] (0,-1) circle (2.5pt );
      \filldraw [color=blue] (4,-3) circle (2.5pt );
      \filldraw [color=yellow] (4,-3) circle (2.1pt );

      \filldraw [color=red] (2,1) circle (2.5pt );

      \node at (3.3,2.7) {$x_1$};
      \node at (-0.7,1.7) {$x_2$};
      \node at (-3.7,-4.3) {$x_3$};
      \node at (0.3,-1.3) {$x_4$};
      \node at (4.3,-3.3) {$x_5$};

      \node at (2.3,0.7) {$q$};
      \end{tikzpicture}
  \end{column}
 \end{columns}
\end{frame}

% Vor- und Nachteile
\begin{frame}{Annulus Method}{Advantages and disadvantages}
 \begin{block}{Advantages}
  \begin{itemize}
   \item Faster as Full Search
   \item Less memory usage than Orchards Algorithm
  \end{itemize}
 \end{block}
\end{frame}

\subsection{AESA}
\begin{frame}{AESA}{Approximating and Eliminating Search Algorithm}
 \begin{itemize}
  \item Create matrix with all distances $d(x, y)$, with $x, y \in S$
  \pause
  \item Every item is always in one status
  \begin{itemize}
   \item \textit{Known}, $d(x, q)$ is known
   \pause
   \item \textit{Unknown}, only $d_P(x, q)$ is known
   \pause
   \item \textit{Rejected}, $d_P(x, q)$ is bigger as smallest known distance $r$
  \end{itemize}
  \pause
  \item All $x \in S$ are \textit{Unknown} and $d_P(x, q) = -\infty$
  \pause
  \item Repeat until all $x \in S$ \textit{Known} oder \textit{Rejected}
  \begin{enumerate}
   \item Choose \textit{Unknown} item $x \in S$ with smallest $d_P(x, q)$
   \pause
   \item Calculate $d(x,q)$, so that $x$ gets \textit{Known}
   \pause
   \item Refresh the smallest known distance $r$
   \pause
   \item Set $P:= P \cup \{x\}$, refresh $d_P(x', q)$, if $x'$ is \textit{Unknown} mark $x'$ as \textit{Rejected}, if
    $d_P(x', q) > r$
  \end{enumerate}
 \end{itemize}
\end{frame}

\begin{frame}{LAESA}{\textit{Linear} Approximating and Eliminating Search Algorithm}
 \begin{itemize}
  \item Works with a set of \textit{pivot} items instead of a matrix
  \pause
  \item Works best if \textit{pivot} items are strongly separated
 \end{itemize}
\end{frame}

\section{Outlook}
\begin{frame}{Outlook}
 \begin{itemize}
  \item Metric trees
  \item \dots
 \end{itemize}
\end{frame}

\section{Resources}
\begin{frame}
 \frametitle{Resources}
 \begin{itemize}
  \item Otto Forster, 2006, \textit{Analysis 2}, Friedr. Vieweg \& Sohn Verlag
  \item Kenneth L. Clarkson, 2005, \textit{Nearest-Neighbor Searching and Metric Space Dimensions}, http://kenclarkson.org/nn\_survey/p.pdf
  \end{itemize}
\end{frame}

\end{document}


\documentclass[]{article}
\usepackage{amsmath}
\usepackage{graphicx}
\graphicspath{ {.}}
%opening
\title{Algorithmic game theory HW0}
\author{Daniel Campos  \tt {dcampos3@illinois.edu}}
\date{09/01/2020}

\begin{document}

\maketitle

\section{Problem 1}
Let $a_1,a_2,...,a_n$ be fixed real numbers and $X$ be a random variable that takes value $a_i$ with a probability $p_i$.
\subsection{Define the set of probability distributions that maximize $E[X]$}
\section{Problem 2}
Consider throwing $n$ balls into $n$ bins where each ball is thrown independently and uniformly into a bin
\subsection{What is the probability that a given bin(say the first bin) is empty}
\subsection{What is the probability that it contains exactly K balls}
\subsection{What is the expected number of bins that are empty}
\section{Problem 3}
Consider the following linear program \\

\begin{align}
max \; c^Tx \\
s.t \;\; Ax \leq b \\
x \geq 0
\end{align}

\subsection{Write the dual linear program of the above LP}
\subsection{Write the corresponding complementary slackness conditions}
\subsection{Using the complementary slackness conditions, derive the strong duality theorem}.(If $x^*$ is an optimal solution to the primal LP and $y^*$ is an optimal solution to the dual LP then $c^Tx^* = b^Ty^*)$
\section{Problem 4}
A wheel of size $k$ consists of a cycle on $k$ vertices along with an additional vertex connected to every vertex in the cycle. As an example, you can see with a wheel the size 8 in the figure below. \\
\includegraphics{8k}\\
The WHEEL problem is the
following
\subsection{Given an undirected graph $G = (V,E) $ and an integer $k$ does $G$ contain a wheel of size $k$ as a sub graph?}
\subsection{Prove that Wheel is NP-Complete}
reduce from Hamiltonian cycle problem
\end{document}


% Sample LaTeX file for creating a paper in the Morgan Kaufmannn two
% column, 8 1/2 by 11 inch proceedings format.

\documentclass[]{article}
\usepackage{proceed2e}
\usepackage{hyperref}
\usepackage{url}
\usepackage{amsmath}
\usepackage{graphicx}
\usepackage{bm}
\usepackage{hyperref}
\usepackage{natbib}
\usepackage{latexsym,amsbsy,amssymb,color,xspace, booktabs}

\include{macros}
\include{local_macros}

\title{Collaborative Multi-output Gaussian Processes: \\ Supplementary Material}

\author{ {\bf Trung V. Nguyen} \\
ANU \& NICTA \\
Canberra, Australia\\
\And
{\bf Edwin V. Bonilla}  \\
NICTA \& ANU          \\
Sydney, Australia \\
}

\begin{document}

\maketitle

\section{Gaussian Identities}
Let $\g = \{\g_j\}_{j=1}^q$, $\h$, and $\y$ be random variables with multivariate Gaussian distributions:
$p(\y | \g, \h) = \Normal(\y; \sum_{j=1}^Q \W_j \g_j + \W \h, \beta^{-1} \I)$, $p(\g_j) = \Normal(\g_j; \m_j, \S_j)$, and $p(\h) = \Normal(\h; \m, \S)$.
The following identity is important in deriving the evidence lower bound:
\begin{align}
\nonumber
\int& \log p(\y | \g, \h) \prod_{j=1}^q p(\g_j) p(\h) \der \g \der \h \\
\nonumber
=& \log \Normal(\y; \sum_{j=1}^q \W_j \m_j + \W \m, \beta^{-1} \I) \\
& - \frac{1}{2} \beta \trace \W^T \W \S - \frac{1}{2} \beta \trace \sum_{j=1}^q \W_j^T \W_j \S_j.
 \label{eq:identity}
\end{align}
The identity can be proved by using this fact:
\begin{align}
\nonumber
&\int (\W\x - \Mu)^T \BigSigma^{-1} (\W \x - \Mu) \Normal(\x; \m, \S) \der \x \\
&= (\Mu - \W\m)^T \BigSigma^{-1} (\Mu - \W\m) + \trace \W^T \BigSigma^{-1} \W \S.
\end{align}

\section{Derivation of the Variational Lower Bound}
The variational lower bound of the log marginal (eq. 13 in the main text) is given by:
\begin{align}
\nonumber
\log p(\y) \ge& \int q(\u, \v) \log \frac{p(\y | \u, \v) p(\u, \v)}{q(\u, \v)} \der \u \der \v \\
\nonumber
%=& \int q(\u, \v) \log p(\y | \u, \v)  \der \u \der \v  \\
%\nonumber
&+ \int q(\u, \v) \log \frac{p(\u, \v)}{q(\u, \v)} \der \u \der \v \\
\nonumber
=& \int q(\u, \v) \log p(\y | \u, \v)  \der \u \der \v \\
\nonumber
&- \sum_{j=1}^Q \KL[q(\u_j) || p(\u_j)] - \sum_{i=1}^P \KL[q(\v_i) || p(\v_i)],
\end{align}

Since the KL terms are analytically tractable, we compute the first term in the above sum.
This is done first by deriving a lower bound to the likelihood $p(\y | \u, \v)$ (eq. 14 in the main text).
\begin{align}
\nonumber
\log \text{ } p(\y | \u, \v)
&= \log \Eb{p(\y | \g, \h)}_{p(\g,\h | \u, \v)} \\
\nonumber
&\ge \Eb{\log p(\y | \g, \h)}_{p(\g,\h | \u, \v)}  \\
\nonumber
&= \sum_{i=1}^P \sum_{n=1}^N \Eb{\log p(y_{in} | \g_n, h_{in}) }_{p(\g | \u) p(\h_i | \v_i)}
\end{align}
Applying the identity in eq. \ref{eq:identity},
the expectation of an individual likelihood term with respect to the posterior distribution is given by:
\begin{align}
\nonumber
l_{in} =& \int \log p(y_{in} | \g_n, h_{in}) \prod_{j=1}^Q p(g_{jn} | \u_j) p(h_{in} | \u_i) \der \g_n \der h_{in} \\
\nonumber
=& \log \Normal(y_{in}; \sum_{j=1}^Q w_{ij} \mu_{jn}+ \mu^h_{in}, \beta_i^{-1}) \\
&- \frac{1}{2} \beta_i \sum_{j=1}^Q w_{ij}^2 \tilde{k}_{jnn}
- \frac{1}{2} \beta_i \tilde{k}^h_{inn},
\end{align}
where $\tilde{k}_{jnn} = (\tilde{\K}_j)_{nn}$, $\tilde{k}^h_{inn} = (\tilde{\K}^h_i)_{nn}$, $\mu_{jn} = (\Mu_j)_n$, and $\mu^h_{in} = (\Mu^h_i)_n$.

Substituting $l_{in}$ into the expression for the lower bound of $\log p(\y | \u, \v)$ (again, this is eq. 14 in the main text), and applying the identity in eq. \ref{eq:identity} to carry out the integral we obtain the lower bound as given in the main text.

% previous detailed derivation
%\begin{align}
%\nonumber
%l_{in} &= \int \log p(y_{in} | g_n, h_{in}) p(\g | \ug) p(\h_i | \u_i) \der \g \der \h_i \\
%\nonumber
%&= \int \log \Normal(y_{in} ; w_i g_n + h_{in}, \beta_i^{-1})
%\Normal(g_n ; \mu_{gn}, \tilde{k}_{gnn})
%\Normal(h_{in} ; \mu_{in}, (\tilde{k}_{inn}) \der g_n \der h_{in} \\
%\nonumber
%&= -\frac{1}{2} \log 2 \pi \beta_i^{-1} - \frac{1}{2} \int (y_{in} - w_i g_n - h_{in}) \beta_i (y_{in} - w_i g_n - h_{in})
%\Normal(g_n ; \mu_{gn}, \tilde{k}_{gnn})
%\Normal(h_{in} ; \mu_{in}, \tilde{k}_{inn}) \der g_n \der h_{in} \\
%\nonumber
%&= -\frac{1}{2} \log 2 \pi \beta_i^{-1} - \frac{1}{2} \int \left[(y_{in} - h_{in} - w_i \mu_{gn}) \beta_i (y_{in} - h_{in} - w_i \mu_{gn}) + w_i^2 \beta_i \tilde{k}_{gnn} \right]
%\Normal(h_{in} ; \mu_{in}, \tilde{k}_{inn}) \der h_{in} \\
%\nonumber
%&= -\frac{1}{2} \log 2 \pi \beta_i^{-1} - \frac{1}{2} w_i^2 \beta_i \tilde{k}_{gnn}
%- \frac{1}{2} \beta_i \tilde{k}_{inn} - \frac{1}{2} (y_{in} - w_i \mu_{gn} - \mu_{in}) \beta_i (y_{in} - w_i \mu_{gn} - \mu_{in}) \\
%&= \log \Normal(y_{in}; w_i \mu_{gn} + \mu_{in}, \beta_i^{-1})  - \frac{1}{2} \beta_i (w_i^2 \tilde{k}_{gnn} + \tilde{k}_{inn}),
%\end{align}

\section{Derivatives of the ELBO}
For exposition, we derive the gradients of the lower bound for the case of a single GP (i.e. the bound in \citet{hensmangaussian}).
The derivatives of the ELBO of the collaborative multioutput GPs model are typically linear combination of the derivatives here.
The lower bound as a function of all parameters is
\begin{align}
\nonumber
\calL
=& \log \Normal(\y; \K_{NM} \K_{MM}^{-1} \m, \beta^{-1}\I) \\
\nonumber
 &- \frac{1}{2} \beta \trace \tilde{\K}
 - \frac{1}{2} \beta \trace (\S\K_{MM}^{-1} \K_{MN} \K_{NM} \K_{MM}^{-1}) \\  \nonumber
&- \frac{1}{2} \left( \log |\K_{MM}| + \trace(\K_{MM}^{-1}(\m \m^T + \S)) \right) \\ \nonumber
=& \underbrace{\log \Normal(\y; \A \m, \beta^{-1}\I)}_{\calL_1}
 - \underbrace{\frac{1}{2} \beta \trace (\K_{NN} - \A\K_{MN})}_{\calL_2} \\
 \nonumber
&- \underbrace{\frac{1}{2} \left( \log |\K_{MM}| + \trace(\K_{MM}^{-1}(\m \m^T + \S)) \right)}_{\calL_4}\\
 & - \underbrace{\frac{1}{2} \beta \trace (\S\A^T\A)}_{\calL_3},
\end{align}
where $\A = \K_{NM} \K_{MM}^{-1}$.
Here $\K_{NM} = k(\X,\Z)$ is the cross-covariance matrix between the observed inputs and the inducing inputs and $\K_{MM} = k(\Z,\Z)$ is the auto-covariance matrix between the inducing inputs.
Notice that we have re-written the sum of individual terms in matrix form which will make the derivation easier and also the computation faster via vectorization.

\subsection{Derivative of the Noise Hyperparameter}
The derivative of the noise hyperparameter $\beta$ is easily computed as:
\begin{align}
\deriv{\calL}{\beta} = \frac{N}{2\beta} - \frac{1}{2} (\y - \A\m)^T (\y - \A\m) - \frac{\calL_2}{\beta} - \frac{\calL_3}{\beta}.
\end{align}
\subsection{Derivatives of the Covariance Hyperparameters}
To simplify the math, we utilize the matrix $\A$ defined above.
Firstly, the derivative of $\A$ wrt a covariance hyperparameter $t$ is given by:
\begin{align}
\deriv{\A}{t} = \left(\deriv{\K_{NM}}{t} - \A \deriv{\K_{MM}}{t}\right)\K_{MM}^{-1}.
\end{align}
The derivatives of $\calL_1, \calL_2, \calL_3 \text{ and } \calL_4$ are thus given by:
\begin{align}
\deriv{\calL_1}{t} =& \beta (\y - \A\m)^T \deriv{\A}{t} \m \\
\deriv{\calL_2}{t} =& \frac{1}{2}\beta \trace \left(\deriv{\K_{NN}}{t} - \A \deriv{\K_{MN}}{t} - \deriv{\A}{t} \K_{MN}\right)
\end{align}
\begin{align}
\deriv{\calL_3}{t} =& \beta \trace \left(\A \S \deriv{\A^T}{t} \right) \\
\nonumber
\deriv{\calL_4}{t} =& \frac{1}{2}  \trace \left(\K_{MM}^{-1} \deriv{ \K_{MM}}{t}\right) \\
&- \frac{1}{2} \trace \left(\K_{MM}^{-1} \deriv{\K_{MM}}{t} \K_{MM}^{-1} (\m \m^T + \S) \right)
\end{align}
The derivatives are then computed by taking the derivatives of the covariance matrices $\K_{NN} (\text{the diagonal only}), \K_{NM} \text{ and }  \K_{MM}$, hence the covariance function, wrt the hyperparameters.

\subsection{Derivatives of the Inducing Inputs}
To compute the derivatives of $\calL$ wrt the inducing inputs, first notice that $\Z = \{\z_m\}_{m=1}^M$ can also be viewed as parameters of the covariance matrices $\K_{NM}$ and $\K_{MM}$.
Hence the derivative wrt a single dimension of an inducing input, i.e. $z_{mj}$, is the same as that of $\deriv{ \calL}{t}$.

%Since $MD$ parameters are needed for the inducing inputs, it appears that the derivatives of all inducing inputs would require $\calO(MD \times M^3)$ in computation.
%However, this complexity can actually be reduced to $\calO(DM^3)$ using the following lemma. \\
%
%\noindent \textbf{Lemma} Let $A, B$ be two matrices of size $N \times M$ and $M \times N$, respectively. Furthermore, $B$ has the property that only one of its rows or columns is non-zero. The complexity of $\trace(AB)$ is only $\calO(N)$. \\
%
%\noindent \textbf{Proof} Let $m <= M$ be the non-zero row of $B$. We have
%\begin{align}
%\trace (AB) = \sum_{i=1}^N \sum_{j=1}^M A_{ij} B_{ji} = \sum_{i=1}^N A_{im} B_{mi},
%\end{align}
%which clearly takes $\calO(N)$. It is easy to see that the lemma also holds when $B$ is symmetric and only one of its row and the corresponding column is non-zero. \\
%
%\noindent To exploit the property in the Lemma, we re-write $\frac{d \calL_1}{dt}, \frac{d \calL_2}{dt}, \frac{d \calL_3}{dt}, \frac{d \calL_4}{dt}$ by expanding $\frac{d\A}{dt}$ (here $t = z_{mj}$):

\noindent We re-write $\deriv{\calL_1}{t}, \deriv{\calL_2}{t}, \deriv{ \calL_3}{t}, \deriv{\calL_4}{t}$ by expanding $\deriv{\A}{t}$ (here $t = z_{mj}$):
% dL1
\begin{align}
\nonumber
\deriv{\calL_1}{t}
=& \beta \trace (\y - \A\m)^T \left(\deriv{\K_{NM}}{t} -  \A \deriv{ \K_{MM}}{t}\right)\K_{MM}^{-1} \m \\
\nonumber
=& \beta \trace \K_{MM}^{-1} \m (\y - \A\m)^T \deriv{\K_{NM}}{t} \\
&-\beta \trace \K_{MM}^{-1} \m (\y - \A\m)^T \A \deriv{\K_{MM}}{t}
\end{align}
%dL2
\begin{align}
\deriv{\calL_2}{t}
&= - \beta \trace \A^T \deriv{\K_{NM}}{t}
 + \frac{1}{2} \beta \trace \A^T \A \deriv{\K_{MM}}{t}
 \end{align}
% dL3
 \begin{align}
\deriv{\calL_3}{t}
&= \beta \trace \K_{MM}^{-1} \S \A^T \deriv{\K_{NM}}{t}
 - \beta \trace \K_{MM}^{-1} \S \A^T \A \deriv{\K_{MM}}{t}
 \end{align}
 % dL4
 \begin{align}
\deriv{\calL_4}{t}
 =& \frac{1}{2}  \trace \K_{MM}^{-1} \deriv{\K_{MM}}{t} \\
 \nonumber
& - \frac{1}{2} \trace \K_{MM}^{-1} (\m \m^T + \S) \K_{MM}^{-1} \deriv{\K_{MM}}{t}
\end{align}
From the above 4 equations we get,
\begin{align}
\deriv{\calL}{t} = \trace \D_1 \deriv{\K_{NM}}{t} + \trace \D_2 \deriv{ \K_{MM}}{t},
\end{align}
where
\begin{align}
\D_1 =& \beta \K_{MM}^{-1} \m (\y - \A\m)^T
 + \beta \A^T
 - \beta \K_{MM}^{-1} \S \A^T \\ \nonumber
\D_2 =& -\beta \trace \K_{MM}^{-1} \m (\y - \A\m)^T \A
 - \frac{1}{2} \beta \A^T \A -\frac{1}{2} \K_{MM}^{-1} \\
  &+ \beta \K_{MM}^{-1} \S \A^T \A
   + \frac{1}{2} \K_{MM}^{-1} (\m \m^T + \S) \K_{MM}^{-1}
\end{align}
%TODO: give the correct cost
Notice that $\D_1$ and $\D_2$ can be pre-computed with a cost of $\calO(M^3)$ (or $\calO(N_bM^2)$ if the minibatch size $N_b > M$).
The computational cost of taking derivatives of $MD$ inducing parameters is thus $\calO(M^3 + MDM) = \calO(M^3)$ as the cost of the two trace operators is $\calO(M)$ due to the fact that only $\calO(M)$ elements of $\deriv{\K_{MM}}{t}$ or $\deriv{\K_{NM}}{t}$ are non-zero.

For implementation with MATLAB, a loop over $M \times D$ parameters of the inducing inputs can be very slow for even moderate values of $M$ and $D$.
The aforementioned fact about $\deriv{\K_{MM}}{t}$ and $\deriv{\K_{NM}}{t}$ can be used to perform vectorized operations that compute the derivatives of all $M$ parameters given a specific dimension at a cost of $\calO(M^2)$.
The loop is the executed over the input dimension $D$, leading to a complexity of still $\calO(DM^2)$ only.

\bibliographystyle{plainnat}
\bibliography{references}

\end{document}


\subsection{A session on linearity}
\label{sec:session-linearity}

Session typing \cite{Honda1993,DBLP:conf/esop/HondaVK98} is a type
discipline for checking protocols statically. A session type is
ascribed to a communication channel and describes
a sequence of interactions. For instance, the type
\lstinline{int!int!int?end} specifies a protocol
where the program must send two integers, receive an integer, and then
close the channel.
%
In this context, channels must be used linearly, because every use of
a channel ``consumes'' one interaction and  changes the type of the
channel. That is, after sending two integers on the channel,
the remaining channel has type \lstinline{int?end}.
%
Here are some standard type operators for session types \SType:
\begin{center}
  \begin{tabular}[t]{rl}
    $\tau ! \SType$ & Send a value of type $\tau$ then continue with $\SType$.\\
    $\tau ? \SType$& Receive a value of type $\tau$ then continue with $\SType$.\\
    $\SType \oplus \SType'$& Internal choice between protocols $\SType$ and $\SType'$.\\
    $\SType \operatorname{\&} \SType'$
                    & Offer a choice between protocols $\SType$ and $\SType'$.
  \end{tabular}
\end{center}

\citet{DBLP:journals/jfp/Padovani17}  has shown how to encode this
style of session typing in ML-like languages, but his implementation
downgrades linearity to a run-time check for affinity. Building on that
encoding we can provide a safe API in \lang that statically enforces
linear handling of channels:
%
\begin{lstlisting}
type 'S st : lin (*@\label{line:session1}*)
val receive: ('a ? 'S) st -> 'a * 'S st (*@\label{line:session2}*)
val send : ('a ! 'S) st -> 'a -{lin}> 'S st
val create : unit -> 'S st * (dual 'S) st
val close : end st -> unit
\end{lstlisting}
% val send : ('a:'k). 'a -> ('a ! 'S) st -{'k}> 'S st

Line~\ref{line:session1} introduces a parameterized abstract
type \lstinline{st} which is linear as indicated
by its kind \lstinline{lin}. Its low-level implementation would wrap a
handle for a socket, for example. The \lstinline{receive}  operation
in Line~\ref{line:session2} takes a channel that is ready to receive a
value of type \lstinline{'a} and returns a pair of the value a the
channel at its residual type \lstinline{'S}. It does not matter
whether \lstinline{'a} is restricted to be linear, in fact
\lstinline{receive} is polymorphic in the kind of \lstinline{'a}.
This kind polymorphism is the
default if no constraints are specified.
%
The \lstinline{send} operation takes a linear channel and returns a
single-use function that takes a value of type \lstinline{'a} suitable
for sending and returns the channel with updated type.
%
The \lstinline{create} operation returns a pair of channel
endpoints. They follow dual communication protocols, where the
\lstinline{dual} operator swaps sending and receiving operations.
%
Finally, \lstinline{close} closes the channel.

In \cref{fig:sessiontype} we show how to use these primitives to
implement client and server for an addition service.
No linearity annotations are needed in the code, as all linearity
properties can be inferred from the linearity of the \texttt{st} type.

The inferred type of the server, \lstinline{add_service}, is
\lstinline{(int ! int ! int ? end) st -> unit}.
The client operates by sending two messages
and receiving the result.
This code is polymorphic in both argument and return types, so it could
be used with any binary operator.
%
\begin{figure}[!h]
  \begin{subfigure}[t]{0.5\linewidth}
\begin{lstlisting}
let add_service ep =
  let x, ep = receive ep in
  let y, ep = receive ep in
  let ep = send ep (x + y) in
  close ep
# add_service : (int ! int ! int ? end) st -> unit
\end{lstlisting}
    \vspace{-5pt}
    \caption{Addition server}
  \end{subfigure}
  \hfill
  \begin{subfigure}[t]{0.45\linewidth}
\begin{lstlisting}
let op_client ep x y =
  let ep = send ep x in
  let ep = send ep y in
  let result, ep = receive ep in
  close ep;
  result
# op_client :
   ('a_1 ? 'a_2 ? 'b ! end) st -> 'a_1 -{lin}> 'a_2 -{lin}> 'b
\end{lstlisting}
% The actual answer from the typechecker looks like this:
% # ('m2:^k2), ('m1:^k1).
% # (^k1 < ^k) & (lin < ^k) =>
% # ('m1 ?'m2 ? 'result ! end) st -> 'm1 -{lin}> 'm2 -{^k}> 'result
    \vspace{-5pt}
    \caption{Binary operators client}
  \end{subfigure}
  \vspace{-10pt}
  \caption{Corresponding session type programs in \lang}
  \label{fig:sessiontype}
\end{figure}
%
Moreover, the \lstinline/op_client/ function can be partially applied
to a channel. Since the closure returned by such a partial application
captures the channel, it can only be used once.  This restriction is
reflected by the arrow of kind \lstinline{lin}, \lstinline/-{lin}>/,
which is the type of a single-use function.
The general form of
arrow types in \lang is \lstinline/-{k}>/, where \lstinline/kk/ is a
kind that restricts the number of uses of the function.  For
convenience, we shorten \lstinline/-{un}>/ to \lstinline/->/.  \lang
infers the
single-use property of the arrows without any user
annotation. In fact, the only difference between the
code presented here and Padovani's examples
\cite{DBLP:journals/jfp/Padovani17} is the kind annotation on the
type definition of \lstinline/st/.

To run client and server, we can create a channel and apply
\lstinline{add_service} to one end and \lstinline{op_client} to the other.
Failure to consume either channel endpoints (\lstinline/a/ or \lstinline/b/)
would result in a type error.
\begin{lstlisting}
let main () =
  let (a, b) = create () in
  fork add_service a;
  op_client b 1 2
# main : unit -> int
\end{lstlisting}

% \begin{figure}
%   \centering
%   \begin{lstlisting}
% val select : ('S st -{'k}> 'a) -> 'a ot -{'k}> ('S dual) st
% val branch : 'm it -> 'm
%   \end{lstlisting}
%   \caption{Session primitives}
%   \label{api:session}
% \end{figure}

%%% Local Variables:
%%% mode: latex
%%% TeX-master: "main"
%%% End: