### Thesis: NP Stuff

parent 001b6d80
 ... ... @@ -59,3 +59,9 @@ %% [REC] Nicer tables. Read the excellent documentation. \usepackage{booktabs} %% [OPT] Added by kelmich. Allows drawing of graphs + other fancy things \usepackage{tikz} %% [OPT] Added by kelmich. Allows for text immediately after figures. \usepackage{placeins} \ No newline at end of file
 \chapter{Gradient Descent} \ No newline at end of file
 ... ... @@ -54,8 +54,75 @@ and $C$ for the pixel farming decision problem. We are asked to solve the hamiltonian path decision problem in polynomial time in relation to the size of $G$. In polynomial time we build the following pixel farming decision problem. Our crops are as follows: \begin{displaymath} \Cps = V \cup \{ \abs{V} + 1, \dots, \abs{V} + 1 + l + \} \end{displaymath} \ No newline at end of file Let us first look at a simple case, when $l = \abs{V}$. The core idea is that we translate vertices to crops and edges to crops liking each other. Then, a pixel farming decision problem with a score that means every pixel likes both of its neighbors must imply that there exists a hamiltonian path in the graph $G$. Formally we build the following pixel farming decision problem: \begin{align*} X &= \abs{V} && Y = 1\\ \Cps &= V && R(a, b) = \begin{cases} 1 & \{a, b\} \in E\\ 0 & otherwise. \end{cases}\\ s &= 2 \cdot (\abs{V} - 1) && D(c) = \frac{1}{\abs{V}} \quad \forall c \in \Cps \end{align*} The following example illustrates this: \begin{figure}[h] \centering \begin{minipage}{0.45\textwidth} \centering \begin{tikzpicture}[node distance={15mm}, main/.style = {draw, circle}] \node[main] (1) {$v_1$}; \node[main] (2) [right of=1] {$v_2$}; \node[main] (3) [below of=2] {$v_3$}; \node[main] (4) [below of=1] {$v_4$}; \draw (1) -- (2); \draw (2) -- (4); \draw (3) -- (1); \draw (4) -- (3); \end{tikzpicture} \caption{example graph} \end{minipage}\hfill \begin{minipage}{0.45\textwidth} \centering \begin{tikzpicture}[node distance={0.75cm}, main/.style = {draw, minimum size=0.75cm}] \node[main] (1) {$v_1$}; \node[main] (2) [right of=1] {$v_2$}; \node[main] (3) [right of=2] {$v_4$}; \node[main] (4) [right of=3] {$v_3$}; \end{tikzpicture} \hfill \caption{corresponding solution field} \end{minipage} \end{figure} \FloatBarrier What about the case where $l < \abs{V}$? For this we need to resort to a trick. Say for example we are looking for a path of length at least $\abs{V} - 2$. We can't simply change $s$ to be $4$ less than before, because we have no guarantees as to where these cuts'' will be. We could end up in a situation where our pixel farming algorithm gives us 3 paths that are all not of sufficient length. \begin{figure}[h] \centering \begin{tikzpicture}[node distance={0.5cm}, main/.style = {draw, minimum size=0.5cm}] \node[main] (1) {}; \node[main] (13) [below of =1] {}; \foreach \x in {2,...,12} { \pgfmathtruncatemacro{\prev}{\x - 1} \pgfmathtruncatemacro{\below}{\x + 11} \node[main] (\x) [right of=\prev] {}; \node[main] (\below) [below of=\x] {}; } \node[main] (26) [below of=20] {}; \node[main] (27) [below of=22] {}; \end{tikzpicture} \hfill \caption{example structure} \end{figure} \FloatBarrier \ No newline at end of file
 \chapter{Helpful Statements} \section{Growing solutions} \section{Creating integer solutions from fractional solutions} \ No newline at end of file
 \chapter{The Linear Programming Method} \ No newline at end of file
 ... ... @@ -6,6 +6,11 @@ \BOOKMARK [-]{section.4.1}{\376\377\000T\000h\000e\000\040\000d\000e\000c\000i\000s\000i\000o\000n\000\040\000v\000e\000r\000s\000i\000o\000n\000\040\000o\000f\000\040\000p\000i\000x\000e\000l\000\040\000f\000a\000r\000m\000i\000n\000g}{chapter.4}% 6 \BOOKMARK [-]{section.4.2}{\376\377\000P\000i\000x\000e\000l\000\040\000F\000a\000r\000m\000i\000n\000g\000\040\000i\000s\000\040\000i\000n\000\040\000N\000P}{chapter.4}% 7 \BOOKMARK [-]{section.4.3}{\376\377\000P\000i\000x\000e\000l\000\040\000F\000a\000r\000m\000i\000n\000g\000\040\000f\000i\000n\000d\000s\000\040\000H\000a\000m\000i\000l\000t\000o\000n\000i\000a\000n\000\040\000P\000a\000t\000h\000s}{chapter.4}% 8 \BOOKMARK [-]{chapter.5}{\376\377\000C\000o\000n\000c\000l\000u\000s\000i\000o\000n}{}% 9 \BOOKMARK [-]{appendix.A}{\376\377\000C\000a\000l\000c\000u\000l\000a\000t\000i\000o\000n\000s\000\040\000A\000p\000p\000e\000n\000d\000i\000x}{}% 10 \BOOKMARK [-]{appendix*.4}{\376\377\000B\000i\000b\000l\000i\000o\000g\000r\000a\000p\000h\000y}{}% 11 \BOOKMARK [-]{chapter.5}{\376\377\000H\000e\000l\000p\000f\000u\000l\000\040\000S\000t\000a\000t\000e\000m\000e\000n\000t\000s}{}% 9 \BOOKMARK [-]{section.5.1}{\376\377\000G\000r\000o\000w\000i\000n\000g\000\040\000s\000o\000l\000u\000t\000i\000o\000n\000s}{chapter.5}% 10 \BOOKMARK [-]{section.5.2}{\376\377\000C\000r\000e\000a\000t\000i\000n\000g\000\040\000i\000n\000t\000e\000g\000e\000r\000\040\000s\000o\000l\000u\000t\000i\000o\000n\000s\000\040\000f\000r\000o\000m\000\040\000f\000r\000a\000c\000t\000i\000o\000n\000a\000l\000\040\000s\000o\000l\000u\000t\000i\000o\000n\000s}{chapter.5}% 11 \BOOKMARK [-]{chapter.6}{\376\377\000T\000h\000e\000\040\000L\000i\000n\000e\000a\000r\000\040\000P\000r\000o\000g\000r\000a\000m\000m\000i\000n\000g\000\040\000M\000e\000t\000h\000o\000d}{}% 12 \BOOKMARK [-]{chapter.7}{\376\377\000G\000r\000a\000d\000i\000e\000n\000t\000\040\000D\000e\000s\000c\000e\000n\000t}{}% 13 \BOOKMARK [-]{chapter.8}{\376\377\000C\000o\000n\000c\000l\000u\000s\000i\000o\000n}{}% 14 \BOOKMARK [-]{appendix.A}{\376\377\000C\000a\000l\000c\000u\000l\000a\000t\000i\000o\000n\000s\000\040\000A\000p\000p\000e\000n\000d\000i\000x}{}% 15 \BOOKMARK [-]{appendix*.4}{\376\377\000B\000i\000b\000l\000i\000o\000g\000r\000a\000p\000h\000y}{}% 16
No preview for this file type
 ... ... @@ -116,6 +116,9 @@ \input{related-work.tex} \input{problem-statement.tex} \input{hardness.tex} \input{helpers.tex} \input{lp-method.tex} \input{gradient-descent.tex} \input{conclusion.tex} \appendix ... ...
 ... ... @@ -10,6 +10,11 @@ \contentsline {section}{\numberline {4.3}Pixel Farming finds Hamiltonian Paths}{8}{section.4.3}% \contentsline {paragraph}{Hamiltonian Paths}{8}{section*.2}% \contentsline {paragraph}{Reduction}{8}{section*.3}% \contentsline {chapter}{\chapternumberline {5}Conclusion}{9}{chapter.5}% \contentsline {appendix}{\chapternumberline {A}Calculations Appendix}{11}{appendix.A}% \contentsline {chapter}{Bibliography}{13}{appendix*.4}% \contentsline {chapter}{\chapternumberline {5}Helpful Statements}{11}{chapter.5}% \contentsline {section}{\numberline {5.1}Growing solutions}{11}{section.5.1}% \contentsline {section}{\numberline {5.2}Creating integer solutions from fractional solutions}{11}{section.5.2}% \contentsline {chapter}{\chapternumberline {6}The Linear Programming Method}{13}{chapter.6}% \contentsline {chapter}{\chapternumberline {7}Gradient Descent}{15}{chapter.7}% \contentsline {chapter}{\chapternumberline {8}Conclusion}{17}{chapter.8}% \contentsline {appendix}{\chapternumberline {A}Calculations Appendix}{19}{appendix.A}% \contentsline {chapter}{Bibliography}{21}{appendix*.4}%
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!