Commit 604d166d by Stalin Munoz

Correcciones IDA*

parent a6e92876
This source diff could not be displayed because it is too large. You can view the blob instead.
...@@ -33,10 +33,10 @@ ...@@ -33,10 +33,10 @@
\@writefile{loa}{\contentsline {algocf}{\numberline {}{\ignorespaces $\text {IDA}^*$}}} \@writefile{loa}{\contentsline {algocf}{\numberline {}{\ignorespaces $\text {IDA}^*$}}}
\@writefile{nav}{\headcommand {\slideentry {0}{0}{3}{3/3}{}{0}}} \@writefile{nav}{\headcommand {\slideentry {0}{0}{3}{3/3}{}{0}}}
\@writefile{nav}{\headcommand {\beamer@framepages {3}{3}}} \@writefile{nav}{\headcommand {\beamer@framepages {3}{3}}}
\@writefile{nav}{\headcommand {\beamer@partpages {1}{83}}} \@writefile{nav}{\headcommand {\beamer@partpages {1}{84}}}
\@writefile{nav}{\headcommand {\beamer@subsectionpages {1}{83}}} \@writefile{nav}{\headcommand {\beamer@subsectionpages {1}{84}}}
\@writefile{nav}{\headcommand {\beamer@sectionpages {1}{83}}} \@writefile{nav}{\headcommand {\beamer@sectionpages {1}{84}}}
\@writefile{nav}{\headcommand {\beamer@documentpages {83}}} \@writefile{nav}{\headcommand {\beamer@documentpages {84}}}
\@writefile{nav}{\headcommand {\def \inserttotalframenumber {4}}} \@writefile{nav}{\headcommand {\def \inserttotalframenumber {4}}}
\@writefile{nav}{\headcommand {\slideentry {0}{0}{4}{4/83}{}{0}}} \@writefile{nav}{\headcommand {\slideentry {0}{0}{4}{4/84}{}{0}}}
\@writefile{nav}{\headcommand {\beamer@framepages {4}{83}}} \@writefile{nav}{\headcommand {\beamer@framepages {4}{84}}}
...@@ -5,10 +5,10 @@ ...@@ -5,10 +5,10 @@
\headcommand {\beamer@framepages {2}{2}} \headcommand {\beamer@framepages {2}{2}}
\headcommand {\slideentry {0}{0}{3}{3/3}{}{0}} \headcommand {\slideentry {0}{0}{3}{3/3}{}{0}}
\headcommand {\beamer@framepages {3}{3}} \headcommand {\beamer@framepages {3}{3}}
\headcommand {\beamer@partpages {1}{83}} \headcommand {\beamer@partpages {1}{84}}
\headcommand {\beamer@subsectionpages {1}{83}} \headcommand {\beamer@subsectionpages {1}{84}}
\headcommand {\beamer@sectionpages {1}{83}} \headcommand {\beamer@sectionpages {1}{84}}
\headcommand {\beamer@documentpages {83}} \headcommand {\beamer@documentpages {84}}
\headcommand {\def \inserttotalframenumber {4}} \headcommand {\def \inserttotalframenumber {4}}
\headcommand {\slideentry {0}{0}{4}{4/83}{}{0}} \headcommand {\slideentry {0}{0}{4}{4/84}{}{0}}
\headcommand {\beamer@framepages {4}{83}} \headcommand {\beamer@framepages {4}{84}}
No preview for this file type
...@@ -81,41 +81,44 @@ $parar:S \to \{0,1\}$ \tcp*{funcin de paro}\\ ...@@ -81,41 +81,44 @@ $parar:S \to \{0,1\}$ \tcp*{funcin de paro}\\
$c:S \times S \to \mathbb{R}$ \tcp*{funcin de costo de arista}\\ $c:S \times S \to \mathbb{R}$ \tcp*{funcin de costo de arista}\\
$h:S \to \mathbb{R}$ \tcp*{funcin heurstica}} $h:S \to \mathbb{R}$ \tcp*{funcin heurstica}}
\Output{Ruta del estado inicial al estado meta} \Output{Ruta del estado inicial al estado meta}
$c \leftarrow h(s_0)$ \tcp*{Cota inicial igual a heurstica del estado inicial} $c \leftarrow h(s_0)$ ; $g(s_0) \leftarrow 0$ \tcp*{Cota inicial igual a heurstica del estado inicial}
$g(s_0) \leftarrow 0$ \;
\lIf{parar($s_0$)}{
\KwRet{ruta($s_0$)}
}
\While{true}{ \While{true}{
$\text{Agenda.push}(s_0)$ ; $\text{mnimo} \leftarrow \infty$ \; $\text{Agenda.push}(s_0)$ ; $\text{mnimo} \leftarrow \infty$ ; $R \leftarrow \{\}$ \;
\While{$\mid \text{Agenda} \mid > 0$}{ \While{$\mid \text{Agenda} \mid > 0$}{
$\text{n} \leftarrow \text{Agenda.peek}()$ ; $\text{n} \leftarrow \text{Agenda.peek}()$
$R \leftarrow R \cup \{n\}$ \tcp*{Agenda es una pila, $R$ un \tcp*{Agenda es una pila, $R$ un
conjunto de dispersin} conjunto de dispersin}
\lIf{parar($n$)}{ \lIf{parar($n$)}{
\KwRet{ruta($n$)} \KwRet{ruta($n$)}
} }
\uIf{$n \notin R$}{
$R \leftarrow R \cup \{n\}$ \;
$\text{sucesores} \leftarrow \text{sort}(f,\text{n.expand}())$ $\text{sucesores} \leftarrow \text{sort}(f,\text{n.expand}())$
\tcp*{Ordenamiento ansioso OK, complejidad $O(b \log(b))$} \tcp*{Ordenamiento ansioso OK, $O(b \log(b))$}
\ForEach{$\text{s} \in \text{sucesores}$}{ \ForEach{$\text{s} \in \text{sucesores}$}{
$g(\text{s}) \leftarrow g(\text{n})+c(\text{n},\text{s})$ \; $g(\text{s}) \leftarrow g(\text{n})+c(\text{n},\text{s})$ \;
\If{$\text{s} \not\in R$}{
\lIf{$f(\text{s}) = g(\text{s})+h(\text{s}) \leq c$}{ \uIf{$f(\text{s}) = g(\text{s})+h(\text{s}) \leq c$}{
\lIf{$\text{s} \not\in R$}{
$\text{Agenda.push}(\text{s})$ $\text{Agenda.push}(\text{s})$
} }
\Else{ }
\uElse{
\lIf{$f(\text{s}) < \text{mnimo}$}{ \lIf{$f(\text{s}) < \text{mnimo}$}{
$\text{mnimo} \leftarrow f(\text{s})$ $\text{mnimo} \leftarrow f(\text{s})$
} }
} }
} }
} }
\lIf{$\text{Agenda.peek}()=n$}{ \uElse{
$R \leftarrow R - \{n\}$ ; $\text{Agenda.pop}()$ $\text{Agenda.pop}()$ ; $R \leftarrow R - \{n\}$
} }
} }
$c \leftarrow \text{mnimo}$ $c \leftarrow \text{mnimo}$ \;
\lIf{$c = \infty$}{
\KwRet{None}
}
} }
\caption{$\text{IDA}^*$} \caption{$\text{IDA}^*$}
\end{algorithm*} \end{algorithm*}
...@@ -615,74 +618,81 @@ $h:S \to \mathbb{R}$ \tcp*{funcin heurstica}} ...@@ -615,74 +618,81 @@ $h:S \to \mathbb{R}$ \tcp*{funcin heurstica}}
\only<71>{ \only<71>{
\begin{center} \begin{center}
\includegraphics[scale=0.20]{IDAstar-ejemplo-71.pdf} \includegraphics[scale=0.25]{IDAstar-ejemplo-70-5.pdf}
\end{center} \end{center}
} }
\note<71>{} \note<71>{}
\only<72>{ \only<72>{
\begin{center} \begin{center}
\includegraphics[scale=0.20]{IDAstar-ejemplo-72.pdf} \includegraphics[scale=0.20]{IDAstar-ejemplo-71.pdf}
\end{center} \end{center}
} }
\note<72>{} \note<72>{}
\only<73>{ \only<73>{
\begin{center} \begin{center}
\includegraphics[scale=0.20]{IDAstar-ejemplo-73.pdf} \includegraphics[scale=0.20]{IDAstar-ejemplo-72.pdf}
\end{center} \end{center}
} }
\note<73>{} \note<73>{}
\only<74>{ \only<74>{
\begin{center} \begin{center}
\includegraphics[scale=0.20]{IDAstar-ejemplo-74.pdf} \includegraphics[scale=0.20]{IDAstar-ejemplo-73.pdf}
\end{center} \end{center}
} }
\note<74>{} \note<74>{}
\only<75>{ \only<75>{
\begin{center} \begin{center}
\includegraphics[scale=0.20]{IDAstar-ejemplo-75.pdf} \includegraphics[scale=0.20]{IDAstar-ejemplo-74.pdf}
\end{center} \end{center}
} }
\note<75>{} \note<75>{}
\only<76>{ \only<76>{
\begin{center} \begin{center}
\includegraphics[scale=0.20]{IDAstar-ejemplo-76.pdf} \includegraphics[scale=0.20]{IDAstar-ejemplo-75.pdf}
\end{center} \end{center}
} }
\note<76>{} \note<76>{}
\only<77>{ \only<77>{
\begin{center} \begin{center}
\includegraphics[scale=0.20]{IDAstar-ejemplo-77.pdf} \includegraphics[scale=0.20]{IDAstar-ejemplo-76.pdf}
\end{center} \end{center}
} }
\note<77>{} \note<77>{}
\only<78>{ \only<78>{
\begin{center} \begin{center}
\includegraphics[scale=0.20]{IDAstar-ejemplo-78.pdf} \includegraphics[scale=0.20]{IDAstar-ejemplo-77.pdf}
\end{center} \end{center}
} }
\note<78>{} \note<78>{}
\only<79>{ \only<79>{
\begin{center} \begin{center}
\includegraphics[scale=0.20]{IDAstar-ejemplo-79.pdf} \includegraphics[scale=0.20]{IDAstar-ejemplo-78.pdf}
\end{center} \end{center}
} }
\note<79>{} \note<79>{}
\only<80>{ \only<80>{
\begin{center} \begin{center}
\includegraphics[scale=0.20]{IDAstar-ejemplo-80.pdf} \includegraphics[scale=0.20]{IDAstar-ejemplo-79.pdf}
\end{center} \end{center}
} }
\note<80>{} \note<80>{}
\only<81>{
\begin{center}
\includegraphics[scale=0.20]{IDAstar-ejemplo-80.pdf}
\end{center}
}
\note<81>{}
\end{frame} \end{frame}
......
...@@ -81,41 +81,44 @@ $parar:S \to \{0,1\}$ \tcp*{funcin de paro}\\ ...@@ -81,41 +81,44 @@ $parar:S \to \{0,1\}$ \tcp*{funcin de paro}\\
$c:S \times S \to \mathbb{R}$ \tcp*{funcin de costo de arista}\\ $c:S \times S \to \mathbb{R}$ \tcp*{funcin de costo de arista}\\
$h:S \to \mathbb{R}$ \tcp*{funcin heurstica}} $h:S \to \mathbb{R}$ \tcp*{funcin heurstica}}
\Output{Ruta del estado inicial al estado meta} \Output{Ruta del estado inicial al estado meta}
$c \leftarrow h(s_0)$ \tcp*{Cota inicial igual a heurstica del estado inicial} $c \leftarrow h(s_0)$ ; $g(s_0) \leftarrow 0$ \tcp*{Cota inicial igual a heurstica del estado inicial}
$g(s_0) \leftarrow 0$ \;
\lIf{parar($s_0$)}{
\KwRet{ruta($s_0$)}
}
\While{true}{ \While{true}{
$\text{Agenda.push}(s_0)$ ; $\text{mnimo} \leftarrow \infty$ \; $\text{Agenda.push}(s_0)$ ; $\text{mnimo} \leftarrow \infty$ ; $R \leftarrow \{\}$ \;
\While{$\mid \text{Agenda} \mid > 0$}{ \While{$\mid \text{Agenda} \mid > 0$}{
$\text{n} \leftarrow \text{Agenda.peek}()$ ; $\text{n} \leftarrow \text{Agenda.peek}()$
$R \leftarrow R \cup \{n\}$ \tcp*{Agenda es una pila, $R$ un \tcp*{Agenda es una pila, $R$ un
conjunto de dispersin} conjunto de dispersin}
\lIf{parar($n$)}{ \lIf{parar($n$)}{
\KwRet{ruta($n$)} \KwRet{ruta($n$)}
} }
\uIf{$n \notin R$}{
$R \leftarrow R \cup \{n\}$ \;
$\text{sucesores} \leftarrow \text{sort}(f,\text{n.expand}())$ $\text{sucesores} \leftarrow \text{sort}(f,\text{n.expand}())$
\tcp*{Ordenamiento ansioso OK, complejidad $O(b \log(b))$} \tcp*{Ordenamiento ansioso OK, $O(b \log(b))$}
\ForEach{$\text{s} \in \text{sucesores}$}{ \ForEach{$\text{s} \in \text{sucesores}$}{
$g(\text{s}) \leftarrow g(\text{n})+c(\text{n},\text{s})$ \; $g(\text{s}) \leftarrow g(\text{n})+c(\text{n},\text{s})$ \;
\If{$\text{s} \not\in R$}{
\lIf{$f(\text{s}) = g(\text{s})+h(\text{s}) \leq c$}{ \uIf{$f(\text{s}) = g(\text{s})+h(\text{s}) \leq c$}{
\lIf{$\text{s} \not\in R$}{
$\text{Agenda.push}(\text{s})$ $\text{Agenda.push}(\text{s})$
} }
\Else{ }
\uElse{
\lIf{$f(\text{s}) < \text{mnimo}$}{ \lIf{$f(\text{s}) < \text{mnimo}$}{
$\text{mnimo} \leftarrow f(\text{s})$ $\text{mnimo} \leftarrow f(\text{s})$
} }
} }
} }
} }
\lIf{$\text{Agenda.peek}()=n$}{ \uElse{
$R \leftarrow R - \{n\}$ ; $\text{Agenda.pop}()$ $\text{Agenda.pop}()$ ; $R \leftarrow R - \{n\}$
} }
} }
$c \leftarrow \text{mnimo}$ $c \leftarrow \text{mnimo}$ \;
\lIf{$c = \infty$}{
\KwRet{None}
}
} }
\caption{$\text{IDA}^*$} \caption{$\text{IDA}^*$}
\end{algorithm*} \end{algorithm*}
......
Condición inicial
A_01_W & B_01_R & ....
Meta
A_01_W & B_01_W & C_01_W & D_01_W & ...
Color exclusion
( A_01_W & ~A_01_G & ~A_01_R & ~A_01_B & ~A_01_O & ~A_01_Y) |
(~A_01_W & A_01_G & ~A_01_R & ~A_01_B & ~A_01_O & ~A_01_Y) |
(~A_01_W & ~A_01_G & A_01_R & ~A_01_B & ~A_01_O & ~A_01_Y) |
(~A_01_W & ~A_01_G & ~A_01_R & A_01_B & ~A_01_O & ~A_01_Y) |
(~A_01_W & ~A_01_G & ~A_01_R & ~A_01_B & A_01_O & ~A_01_Y) |
(~A_01_W & ~A_01_G & ~A_01_R & ~A_01_B & ~A_01_O & ~A_01_Y)
( B_01_W & ~B_01_G & ~B_01_R & ~B_01_B & ~B_01_O & ~B_01_Y) |
(~B_01_W & B_01_G & ~B_01_R & ~B_01_B & ~B_01_O & ~B_01_Y) |
(~B_01_W & ~B_01_G & B_01_R & ~B_01_B & ~B_01_O & ~B_01_Y) |
(~B_01_W & ~B_01_G & ~B_01_R & B_01_B & ~B_01_O & ~B_01_Y) |
(~B_01_W & ~B_01_G & ~B_01_R & ~B_01_B & B_01_O & ~B_01_Y) |
(~B_01_W & ~B_01_G & ~B_01_R & ~B_01_B & ~B_01_O & ~B_01_Y)
...
Action exclusion and at least one is applied at every time
( R_W_C & ~R_W_A & ~R_G_C & ~R_G_A & ~R_R_C & ~R_R_A &
~R_B_C & ~R_B_A & ~R_O_C & ~R_O_A & ~R_Y_C & ~R_Y_A) |
(~R_W_C & R_W_A & ~R_G_C & ~R_G_A & ~R_R_C & ~R_R_A &
~R_B_C & ~R_B_A & ~R_O_C & ~R_O_A & ~R_Y_C & ~R_Y_A) |
(~R_W_C & ~R_W_A & R_G_C & ~R_G_A & ~R_R_C & ~R_R_A &
~R_B_C & ~R_B_A & ~R_O_C & ~R_O_A & ~R_Y_C & ~R_Y_A) |
(~R_W_C & ~R_W_A & ~R_G_C & R_G_A & ~R_R_C & ~R_R_A &
~R_B_C & ~R_B_A & ~R_O_C & ~R_O_A & ~R_Y_C & ~R_Y_A) |
...
Action effects
~R_02_W_C V ((J_03_W & M_01_W)|(J_03_G & M_01_G) | ...) &
~R_02_W_A V ((J_01_W & M_03_W)|(J_01_G & M_03_G) | ...) &
...
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment