Add algorithms pseudocode in the summary
This commit is contained in:
		
							parent
							
								
									b937b41853
								
							
						
					
					
						commit
						94570601e1
					
				
							
								
								
									
										86
									
								
								docs/Summary.org
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										86
									
								
								docs/Summary.org
									
									
									
									
									
										Normal file
									
								
							@ -0,0 +1,86 @@
 | 
				
			|||||||
 | 
					#+TITLE: Práctica 1
 | 
				
			||||||
 | 
					#+SUBTITLE: Metaheurísticas
 | 
				
			||||||
 | 
					#+AUTHOR: Amin Kasrou Aouam
 | 
				
			||||||
 | 
					#+DATE: 2021-04-19
 | 
				
			||||||
 | 
					#+PANDOC_OPTIONS: template:~/.pandoc/templates/eisvogel.latex
 | 
				
			||||||
 | 
					#+PANDOC_OPTIONS: listings:t
 | 
				
			||||||
 | 
					#+PANDOC_OPTIONS: toc:t
 | 
				
			||||||
 | 
					#+PANDOC_METADATA: lang=es
 | 
				
			||||||
 | 
					#+PANDOC_METADATA: titlepage:t
 | 
				
			||||||
 | 
					#+PANDOC_METADATA: listings-no-page-break:t
 | 
				
			||||||
 | 
					#+PANDOC_METADATA: toc-own-page:t
 | 
				
			||||||
 | 
					#+PANDOC_METADATA: table-use-row-colors:t
 | 
				
			||||||
 | 
					#+PANDOC_METADATA: logo:/home/coolneng/Photos/Logos/UGR.png
 | 
				
			||||||
 | 
					#+LaTeX_HEADER: \usepackage[ruled, lined, linesnumbered, commentsnumbered, longend]{algorithm2e}
 | 
				
			||||||
 | 
					* Práctica 1
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					** Introducción
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					En esta práctica, usaremos distintos algoritmos de búsqueda para resolver el problema de la máxima diversidad (MDP). Implementaremos:
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					- Algoritmo /Greedy/
 | 
				
			||||||
 | 
					- Algoritmo de búsqueda local
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					** Algoritmos
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					*** Greedy
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					El algoritmo /greedy/ añade de forma iterativa un punto, hasta conseguir una solución de tamaño m.
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					En primer lugar, seleccionamos el elemento más lejano de los demás (centroide), y lo añadimos en nuestro conjunto de elementos seleccionados. A éste, añadiremos en cada paso el elemento correspondiente según la medida del /MaxMin/. Ilustramos el algoritmo a continuación:
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					\begin{algorithm}
 | 
				
			||||||
 | 
					    \KwIn{A list $[a_i]$, $i=1, 2, \cdots, m$, that contains the chosen point and the distance}
 | 
				
			||||||
 | 
					    \KwOut{Processed list}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    $Sel = [\ ]$
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    $centroid \leftarrow getFurthestElement()$
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    \For{$i \leftarrow 0$ \KwTo $m$}{
 | 
				
			||||||
 | 
					        \For{$element$ in $Sel$}{
 | 
				
			||||||
 | 
					            $closestElements = [\ ]$
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					            $closestPoint \leftarrow getClosestPoint(element)$
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					            $closestElements.append(closestPoint)$
 | 
				
			||||||
 | 
					        }
 | 
				
			||||||
 | 
					        $maximum \leftarrow max(closestElements)$
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        $Sel.append(maximum)$
 | 
				
			||||||
 | 
					    }
 | 
				
			||||||
 | 
					    \KwRet{$Sel$}
 | 
				
			||||||
 | 
					\end{algorithm}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					*** Búsqueda local
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					El algoritmo de búsqueda local selecciona una solución aleatoria, de tamaño /m/, y explora durante un número máximo de iteraciones soluciones vecinas.
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					Para mejorar la eficiencia del algoritmo, usamos la heurística del primer mejor (selección de la primera solución vecina que mejora la actual). Ilustramos el algoritmo a continuación:
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					\begin{algorithm}
 | 
				
			||||||
 | 
					    \KwIn{A list $[a_i]$, $i=1, 2, \cdots, m$, the solution}
 | 
				
			||||||
 | 
					    \KwOut{Processed list}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    $Solutions = [\ ]$
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    $firstSolution \leftarrow getRandomSolution()$
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    $Solutions.append(firstSolution)$
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    $lastSolution \leftarrow getLastElement(neighbour)$
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    $maxIterations \leftarrow 1000$
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    \For{$i \leftarrow 0$ \KwTo $maxIterations$}{
 | 
				
			||||||
 | 
					        \While{$neighbour \leq lastSolution$}{
 | 
				
			||||||
 | 
					            $neighbour \leftarrow getNeighbouringSolution(lastSolution)$
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					            $Solutions.append(neighbour)$
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					            $lastSolution \leftarrow getLastElement(neighbour)$
 | 
				
			||||||
 | 
					        }
 | 
				
			||||||
 | 
					        $finalSolution \leftarrow getLastElement(Solutions)$
 | 
				
			||||||
 | 
					    }
 | 
				
			||||||
 | 
					    \KwRet{$finalSolution$}
 | 
				
			||||||
 | 
					\end{algorithm}
 | 
				
			||||||
							
								
								
									
										
											BIN
										
									
								
								docs/Summary.pdf
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										
											BIN
										
									
								
								docs/Summary.pdf
									
									
									
									
									
										Normal file
									
								
							
										
											Binary file not shown.
										
									
								
							
							
								
								
									
										
											BIN
										
									
								
								docs/Tablas_MDP_2020-21.xls
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										
											BIN
										
									
								
								docs/Tablas_MDP_2020-21.xls
									
									
									
									
									
										Normal file
									
								
							
										
											Binary file not shown.
										
									
								
							
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user