exercises/solutions/sol05.tex
author Eugen Sawin <sawine@me73.com>
Sun, 10 Jun 2012 05:35:08 +0200
changeset 20 93fd38efa60f
parent 19 9f72ba296485
permissions -rw-r--r--
Added some solutions.
     1 \documentclass[a4paper, 10pt, pagesize, smallheadings]{article}
     2 \usepackage{graphicx}
     3 %\usepackage[latin1]{inputenc}
     4 \usepackage{amsmath, amsthm, amssymb}
     5 \usepackage{typearea}
     6 \usepackage{algorithm}
     7 \usepackage{algorithmic}
     8 \usepackage{fullpage}
     9 \usepackage{mathtools}
    10 \usepackage[all]{xy}
    11 \usepackage{tikz}
    12 \usepackage{tikz-qtree}
    13 \usetikzlibrary{decorations.pathmorphing} % noisy shapes
    14 \usetikzlibrary{fit}					% fitting shapes to coordinates
    15 \usetikzlibrary{backgrounds}	% drawin
    16 \usetikzlibrary{shapes,snakes}
    17 \addtolength{\voffset}{-20pt}
    18 \title{CSP Exercise 05 Solution}
    19 \author{Eugen Sawin}
    20 \renewcommand{\familydefault}{\sfdefault}
    21 \newcommand{\R}{\mathcal{R}}
    22 \newcommand{\N}{\mathbb{N}}
    23 \newcommand{\C}{\mathcal{C}}
    24 \newcommand{\bo}{\mathcal{O}}
    25 
    26 %\include{pythonlisting}
    27 
    28 \pagestyle{empty}
    29 \begin{document}
    30 \maketitle
    31 %
    32 \section*{Exercise 5.1}
    33 (a) The following table shows the states during the AC3 iterations.\\\\
    34 \begin{tabular}{r l l l}
    35 Iteration & Queue & Revise & Domains\\\hline\\
    36       $0$ & $\{(v_1,v_2),(v_2,v_1),
    37                (v_2,v_3),(v_3,v_2),
    38                (v_1,v_3),(v_3,v_1)\}$
    39           & $$ 
    40           & $(\{1,2,3,4,5\},
    41               \{1,2,3,4,5\},
    42               \{1,2,3,4,5\})$\\
    43       $1$ & $\{(v_1,v_2),(v_2,v_1),
    44                (v_2,v_3),(v_3,v_2),
    45                (v_1,v_3)\}$
    46           & $(v_3,v_1)$
    47           & $(\{1,2,3,4,5\},
    48               \{1,2,3,4,5\},
    49               \{1,2,3,4,5\})$\\
    50       $2$ & $\{(v_1,v_2),(v_2,v_1),
    51                (v_2,v_3),(v_3,v_2)
    52                \}$
    53           & $(v_1,v_3)$
    54           & $(\{1,2,3,4,5\},
    55               \{1,2,3,4,5\},
    56               \{1,2,3,4,5\})$\\
    57       $3$ & $\{(v_1,v_2),(v_2,v_1),
    58             (v_2,v_3)\}\cup\{(v_1,v_3)\}$
    59           & $(v_3,v_2)$
    60           & $(\{1,2,3,4,5\},
    61               \{1,2,3,4,5\},
    62               \{1,2\})$\\
    63       $4$ & $\{(v_1,v_2),(v_2,v_1),
    64             (v_2,v_3)\}\cup\{\}$
    65           & $(v_1,v_3)$
    66           & $(\{1,2\},
    67               \{1,2,3,4,5\},
    68               \{1,2\})$\\
    69       $5$ & $\{(v_1,v_2),(v_2,v_1)\}$
    70           & $(v_2,v_3)$
    71           & $(\{1,2\},
    72               \{1,2\},
    73               \{1,2\})$\\
    74       $6$ & $\{(v_1,v_2)\}$
    75           & $(v_2,v_1)$
    76           & $(\{1,2\},
    77               \{1,2\},
    78               \{1,2\})$\\
    79       $7$ & $\{\}$
    80           & $(v_1,v_2)$
    81           & $(\{1,2\},
    82               \{1,2\},
    83               \{1,2\})$\\
    84 \end{tabular}\\\\\\
    85 (b) The following table shows the states during the PC2 iterations.\\\\
    86 \begin{tabular}{r l l l l l}
    87   Iteration & Queue & Revise-3 & $R_{v_1,v_2}$ & $R_{v_2,v_3}$ & $R_{v_1,v_3}$\\
    88   \hline\\
    89       $0$ & $\{(1,3,2),(1,2,3),(2,1,3)\}$
    90           & $ $ 
    91           & $\{(1,2),(2,1)\}$
    92           & $\{(1,1),(1,2),(2,1)\}$
    93           & $\{(1,1),(1,2),(1,3),$\\
    94       &&&&& $(1,4),(1,5),(2,2),$\\
    95       &&&&& $(2,3),(2,4),(2,5),$\\
    96       &&&&& $(3,3),(3,4),(3,5),$\\
    97       &&&&& $(4,4),(4,5),(5,5)\}$\\
    98       $1$ & $\{(1,3,2),(1,2,3)\}$
    99           & $(\{v_2,v_1\},v_3)$ 
   100           & $\{(1,2),(2,1)\}$
   101           & $\{(1,1),(1,2),(2,1)\}$
   102           & $\{(1,1),(1,2),(1,3),$\\
   103       &&&&& $(1,4),(1,5),(2,2),$\\
   104       &&&&& $(2,3),(2,4),(2,5),$\\
   105       &&&&& $(3,3),(3,4),(3,5),$\\
   106       &&&&& $(4,4),(4,5),(5,5)\}$\\
   107       $2$ & $\{(1,3,2)\}$
   108           & $(\{v_1,v_2\},v_3)$ 
   109           & $\{(1,2),(2,1)\}$
   110           & $\{(1,1),(1,2),(2,1)\}$
   111           & $\{(1,1),(1,2),(1,3),$\\
   112       &&&&& $(1,4),(1,5),(2,2),$\\
   113       &&&&& $(2,3),(2,4),(2,5),$\\
   114       &&&&& $(3,3),(3,4),(3,5),$\\
   115       &&&&& $(4,4),(4,5),(5,5)\}$\\
   116   $3$ & $\{\}\cup\{(2,1,3),(2,3,1)\}$
   117           & $(\{v_1,v_3\},v_2)$ 
   118           & $\{(1,2),(2,1)\}$
   119           & $\{(1,1),(1,2),(2,1)\}$
   120           & $\{(1,1),(2,2)\}$\\
   121   $4$ & $\{(2,1,3)\}\cup\{(1,2,3),(1,3,2)\}$
   122           & $(\{v_2,v_3\},v_1)$ 
   123           & $\{(1,2),(2,1)\}$
   124           & $\{(1,2),(2,1)\}$
   125           & $\{(1,1),(2,2)\}$\\
   126   $5$ & $\{(2,1,3),(1,2,3)\}$
   127           & $(\{v_1,v_3\},v_2)$ 
   128           & $\{(1,2),(2,1)\}$
   129           & $\{(1,2),(2,1)\}$
   130           & $\{(1,1),(2,2)\}$\\
   131   $6$ & $\{(2,1,3)\}$
   132           & $(\{v_1,v_2\},v_3)$ 
   133           & $\{(1,2),(2,1)\}$
   134           & $\{(1,2),(2,1)\}$
   135           & $\{(1,1),(2,2)\}$\\
   136   $7$ & $\{\}$
   137           & $(\{v_2,v_1\},v_3)$ 
   138           & $\{(1,2),(2,1)\}$
   139           & $\{(1,2),(2,1)\}$
   140           & $\{(1,1),(2,2)\}$
   141 \end{tabular}
   142 
   143 \section*{Exercise 5.3}
   144 (a) In a path-consistent network for every pair $(a_i,a_j)\in R_{ij}$, there exists an $a_k\in D_k$, such that $(a_i,a_k)\in R_{ik}$ and $(a_k,a_j)\in R_{kj}$.
   145 
   146 Since all the $R_{ij}$ are non-empty and all our variables $v_i$ share the same domain values, it follows that all $v_i$ are arc-consistent relative to $v_k$ and all $v_k$ are arc-consistent relative to $v_j$, which induces that all $R_{ij}$ are arc-consistent, since otherwise they would be no $a_i\in D_i$, such that $(a_k,a_i)\in R_{ki}$ and $(a_i,a_j)\in R_{ij}$. \qed\\\\
   147 (b) We know that all sets $A_m\subseteq\{0,1\}$ are non-empty, i.e., $1\leq|A_m|\leq2$ for all $1\leq m\leq l$. Therefore it holds that the intersection of two sets $A_q=A_o\cap A_p$ has cardinality $0\leq|A_q|\leq \min\{|A_o|,|A_p|\}\leq 2$.
   148 
   149 WLOG, we know that $A_q$ becomes the empty set, iff $A_o=\{0\}$ and $A_p=\{1\}$ and any combination of $A_o=\{0,1\}$ and $A_p\subset A_o$ yields the set $A_q=A_p$. Therefore it holds that for $\bigcap_{1\leq m\leq l}{A_m}=\emptyset$ to hold, there must be two sets holding the distinct elements $0$ and $1$ respectively, as has been shown. \qed\\\\
   150 (c) We prove by contradiction. Assume that the partial assignment on $v_1,...,v_{k-1}$ can not be extended to $v_k$, i.e., $\bigcap_{2\leq i\leq k-1}{\{a_k\mid (a_i,a_k)\in R_{ik}\}}=\emptyset$. By (b) follows that there must be $2\leq i\neq j\leq k-1$, such that $\{a_k\mid(a_i,a_k)\in R_{ik}\}\cap\{a_k\mid(a_j,a_k)\in R_{jk}\}=\emptyset$.
   151 
   152 WLOG let $\{a_k\mid(a_i,a_k)\in R_{ik}\}=\{0\}$ and $\{a_k\mid(a_j,a_k)\in R_{jk}\}=\{1\}$. We know that we have non-empty constraints on all variable pairs $R_{ij}$ and there is a consistent assignment $(a_i,a_j)\in R_{ij}$. By our assumption there is an assignement $(a_i,0)\in R_{ik}$ but no $(a_j,0)\in R_{jk}$. This contradicts to the definition of path-consistency, where for every pair $(a_i,a_j)\in R_{ij}$, there exists an $a_k\in D_k$, such that $(a_i,a_k)\in R_{ik}$ and $(a_k,a_j)\in R_{kj}$. Therefore there can not be such an assumption in a path-consistent network with given properties and we can extend the assignment to $v_k$. \qed
   153 \end{document}