\prologcode{./src/task12.pl}
\end{listing}
-
\subsubsection{Task 13: Define your data structure}
\begin{listing}[H]
\caption{Hitting set datastructure}
\prologcode{./src/hs.pl}
\end{listing}
-Our datastructure uses the predicate node to signify nodes and leaf for leaves. A node contains a list of edge labels and another list (with the same length as the amound of edge labels) that contains nodes or leaves. The edge label corresponds with its order in the list it is in.
-Examples:
-node([a,b],[leaf,leaf])
-node([a,b], [node([c,d], [leaf,leaf]), node([e,f], [leaf,leaf])])
-node([a,b], [node([c,d], [node([g,h,i], [leaf,leaf,leaf]),leaf]), node([a,f], [leaf,leaf])])
-%insert hittingsettrees.png
+
+\tikzstyle{level 1}=[level distance=1cm, sibling distance=1cm]
+\tikzstyle{level 2}=[level distance=1cm, sibling distance=1cm]
+\tikzstyle{bag} = [text width=4em, text centered]
+\tikzstyle{end} = [minimum width=3pt, inner sep=0pt]
+\begin{figure}[H]
+ \caption{Examples of good hitting set trees}
+ \begin{tikzpicture} [grow=down]
+ \node[bag] {\{$a, b\}$}
+ child {
+ node[end, label=below:$\checkmark$]{}
+ edge from parent
+ node[left] {$a$}
+ }
+ child {
+ node[end, label=below:$\checkmark$]{}
+ edge from parent
+ node[right] {$b$}
+ };
+ \end{tikzpicture}
+ \begin{tikzpicture} [grow=down]
+ \node[bag] {\{$a, b\}$}
+ child {
+ node[bag] {$\{c, d\}$}
+ child {
+ node[end, label=below:$\checkmark$]{}
+ edge from parent
+ node[left] {$c$}
+ }
+ child {
+ node[end, label=below:$\checkmark$]{}
+ edge from parent
+ node[left] {$d$}
+ }
+ edge from parent
+ node[left] {$a$}
+ }
+ child {
+ node[end, label=below:$\checkmark$]{}
+ edge from parent
+ node[right] {$b$}
+ };
+ \end{tikzpicture}
+\end{figure}
+
+\begin{figure}[H]
+ \caption{Examples of bad hitting set trees due to duplicate edge labels}
+ \begin{tikzpicture} [grow=down]
+ \node[bag] {\{$a, b\}$}
+ child {
+ node[bag] {$\{c, a\}$}
+ child {
+ node[end, label=below:$\checkmark$]{}
+ edge from parent
+ node[left] {$c$}
+ }
+ child {
+ node[end, label=below:$\checkmark$]{}
+ edge from parent
+ node[left] {$a$}
+ }
+ edge from parent
+ node[left] {$a$}
+ }
+ child {
+ node[end, label=below:$\checkmark$]{}
+ edge from parent
+ node[right] {$b$}
+ };
+ \end{tikzpicture}
+\end{figure}
+
\subsubsection{Task 14: Implementation}
\begin{listing}[H]
\caption{Code for generating a hitting set tree}
\prologcode{./src/task14.pl}
-\end{listing}
\ No newline at end of file
+\end{listing}
+++ /dev/null
-\BOOKMARK [1][-]{section.1}{Assignment 1-1}{}
-\BOOKMARK [2][-]{subsection.1.1}{Part 1: Modelling Sokoban}{section.1}
-\BOOKMARK [3][-]{subsubsection.1.1.1}{Task 1: Knowledge base}{subsection.1.1}
-\BOOKMARK [3][-]{subsubsection.1.1.2}{Task 2: Actions}{subsection.1.1}
-\BOOKMARK [2][-]{subsection.1.2}{Part 2: Implementation}{section.1}
-\BOOKMARK [3][-]{subsubsection.1.2.1}{Task 3: Translate Axioms}{subsection.1.2}
-\BOOKMARK [3][-]{subsubsection.1.2.2}{Task 4: The Planning Problem in Figure 1}{subsection.1.2}
-\BOOKMARK [3][-]{subsubsection.1.2.3}{Task 5: Crates go to Any Goal Location}{subsection.1.2}
-\BOOKMARK [3][-]{subsubsection.1.2.4}{Task 6: Inverse Problem}{subsection.1.2}
-\BOOKMARK [2][-]{subsection.1.3}{Part 3: Extending the domain}{section.1}
-\BOOKMARK [3][-]{subsubsection.1.3.1}{Task 7: Unlocking the Crates}{subsection.1.3}
-\BOOKMARK [2][-]{subsection.1.4}{Part 4: General questions}{section.1}
-\BOOKMARK [3][-]{subsubsection.1.4.1}{Task 10: Sitcalc expressivity}{subsection.1.4}
-\BOOKMARK [3][-]{subsubsection.1.4.2}{Task 11: Related work}{subsection.1.4}
-\BOOKMARK [1][-]{section.2}{Assignment 1-2}{}
-\BOOKMARK [2][-]{subsection.2.1}{Implementation of the hitting-set algorithm}{section.2}
-\BOOKMARK [3][-]{subsubsection.2.1.1}{Task 12: Generate conflict}{subsection.2.1}
-\BOOKMARK [3][-]{subsubsection.2.1.2}{Task 13: Define your data structure}{subsection.2.1}
-\BOOKMARK [3][-]{subsubsection.2.1.3}{Task 14: Implementation}{subsection.2.1}