aufgabe 1 und 2
This commit is contained in:
parent
1dd794d7ad
commit
fb294209ef
7 changed files with 80 additions and 98 deletions
BIN
übung_9/agt_übung_9.pdf
Normal file
BIN
übung_9/agt_übung_9.pdf
Normal file
Binary file not shown.
|
|
@ -4,12 +4,12 @@
|
||||||
\setkeys{Gin}{pagebox=artbox, width=0.8\textwidth}
|
\setkeys{Gin}{pagebox=artbox, width=0.8\textwidth}
|
||||||
|
|
||||||
\subject{Algorithmische Graphentheorie}
|
\subject{Algorithmische Graphentheorie}
|
||||||
\title{8. Übungsblatt}
|
\title{9. Übungsblatt}
|
||||||
\author{Jasper Gude \and Pia Röttgers}
|
\author{Jasper Gude \and Pia Röttgers}
|
||||||
|
|
||||||
\begin{document}
|
\begin{document}
|
||||||
\maketitle
|
\maketitle
|
||||||
\points[2em]{20}
|
\points[2em]{34}
|
||||||
|
|
||||||
\input{aufgabe_1.tex}
|
\input{aufgabe_1.tex}
|
||||||
\input{aufgabe_2.tex}
|
\input{aufgabe_2.tex}
|
||||||
|
|
|
||||||
|
|
@ -1,23 +1,50 @@
|
||||||
\section{Kleinste Schnitte}
|
\section{Dreifärbarkeit}
|
||||||
\begin{tasks}
|
\begin{tasks}
|
||||||
\item
|
\item
|
||||||
Siehe \autoref{fig:1a}.
|
Siehe \autoref{fig:1a}.
|
||||||
\points{2}
|
\points{1}
|
||||||
|
|
||||||
\begin{figure}
|
\begin{figure}
|
||||||
\centering
|
\centering
|
||||||
\includegraphics[page=1, width=0.5\textwidth]{figures.pdf}
|
\includegraphics[page=1, width=0.5\textwidth]{figures.pdf}
|
||||||
\caption{Gegenbeispiel; Minimaler Schnitt $\tup{S, T}$ und nicht minimaler Schnitt $\tup{\set{v}, V \setminus \set{v}}$ in rot.}
|
\caption{Dreifärbung des Sterngraphs.}
|
||||||
\label{fig:1a}
|
\label{fig:1a}
|
||||||
|
|
||||||
\end{figure}
|
\end{figure}
|
||||||
|
|
||||||
\item
|
\item
|
||||||
Die Wahrscheinlichkeit, dass \alg*{Contract} in keiner Iteration
|
Da die Knoten, die zwei Türme miteinander verbinden, die selbe Farbe haben,
|
||||||
eine Kante aus $C = \set{uv \in E \mid u \in S, v \in T}$ mit minimalem Schnitt $\tup{S, T}$ kontrahiert, also immer die falschen Knoten auswählt,
|
kann man zwischen zwei Türme einen weiteren Turm einfügen, der die
|
||||||
ist laut Vorlesung $\frac{2}{n(n-1)}$. Das heißt die Zahl der
|
Färbbarkeitsregeln nicht verletzt.
|
||||||
richtigen Knoten wächst quadratisch, da die Wahrscheinlichkeit quadratisch
|
|
||||||
abnimmt.
|
Die Knoten mit Grad 2 im Sterngraphen sind die Spitzen der Türme.
|
||||||
\points{3}
|
Da die Turmverbindungsknoten alle die selbe Farbe haben müssen und die
|
||||||
|
zu ihnen ajazenten Knoten jeweils unterschiedlich gefärbt sein müssen,
|
||||||
|
da sie selbst adjazent zueinander sind, müssen die Spitzen die letzte
|
||||||
|
freie Farbe bekommen.
|
||||||
|
\points{2}
|
||||||
|
|
||||||
|
\item
|
||||||
|
Um das Problem 3COL auf das Problem 3COL4 zu reduzieren, müssen wir
|
||||||
|
dafür sorgen, dass Knoten mit Grad größer $4$ so aufgelöst werden, dass
|
||||||
|
sie maximal Grad $4$ haben.
|
||||||
|
|
||||||
|
Dazu machen wir uns zu nutze, dass der Sterngraph beliebig erweiterbar
|
||||||
|
ist und somit beliebig viele Knoten mit Grad $2$ hat, die alle die
|
||||||
|
selbe Farbe haben müssen.
|
||||||
|
|
||||||
|
Einen Knoten $v$ mit Grad $m > 4$ ersetzen wir durch einen Stern mit $m$
|
||||||
|
Zacken. Die zu $v$ adjazenten Kanten verbinden wir mit den Spitzen des
|
||||||
|
Sterns.
|
||||||
|
|
||||||
|
Jetzt haben wir einen Graphen mit Maximalgrad $4$ auf dem wir \alg*{Test3COL4}
|
||||||
|
anwenden können.
|
||||||
|
|
||||||
|
Beim Rückübersetzen können wir die Sterne wieder durch einen einzigen Knoten
|
||||||
|
ersetzen, der die Farbe der Spitzen hat. Da diese die selbe Farbe haben,
|
||||||
|
verletzt das nicht die Färbbarkeitsregel.
|
||||||
|
|
||||||
|
Da 3COL NP-vollständig ist, muss also 3COL4 und insbesondere auch \alg*{Test3COL4}
|
||||||
|
auch NP-vollständig sein.
|
||||||
|
\points{4}
|
||||||
|
|
||||||
\end{tasks}
|
\end{tasks}
|
||||||
|
|
|
||||||
|
|
@ -1,25 +1,29 @@
|
||||||
\section{Implementierung von \textsc{Contract}}
|
\section{Chromatische Zahl}
|
||||||
\begin{enumerate}
|
\begin{tasks}
|
||||||
\item $G$ nach $H$ kopieren. \hfill $\Oh(1)$
|
\item
|
||||||
\item Wenn $\abs{V_H} \leq 2$, dann ist die Zerlegung $\tup{S, T}$ von $G$,
|
Angenommen der Graph $G$ ist vollständig. So hat jeder Knoten den maximalen
|
||||||
die den beiden letzen Knoten in $H$ entspricht, das Ergebnis.
|
Knotengrad $\Delta(G)$. Für alle Knoten $v$ gilt, dass jeder adjazente
|
||||||
\label{step2}
|
Knoten und $v$ eine eigene Farbe haben muss. Das sind also $\Delta(G) + 1$
|
||||||
\item Wähle eine Zufallszahl $z$ im Intervall $\interval{1; \abs{V_H}}$. \hfill $\Oh(1)$
|
viele. Jeder Graph (mit weniger Kanten) hat also eine chromatische Zahl
|
||||||
\item Nimm den Knoten $a = V_H[z]$ und wähle eine Zufallszahl $z'$ im Intervall $\interval{1, \abs{Adj[a]}}$.
|
$\chi(G) \leq \Delta(G) + 1$.
|
||||||
|
\points{2}
|
||||||
|
|
||||||
Nimm den Knoten $b = Adj_{z'}[a]$. \hfill $\Oh(1)$
|
\item
|
||||||
\item Bestimme für jeden zu $a$ oder $b$ adjazenten Knoten $c_i$ die Anzahl der Kanten
|
Für alle Anzahlen an Knoten $n \in \NN$ und Maximalgrad $\Delta < n$ existiert ein
|
||||||
zwischen $c_i$ und $a$ oder $b$. \hfill $\Oh(V_H) = \Oh(n)$.
|
Graph $G_{n,\Delta}$ mit $\chi(G_{n,\Delta}) = \Delta + 1$. Dieser Graph
|
||||||
\item Kontrahiere die Kante $ab$. Lösche dazu die Knoten $a, b$ sowie alle zu $a$ oder $b$ inzidenten Kanten. Da Mehrfachkanten als Zahl implementiert sind, sind
|
hat eine Clique der Größe $\Delta$.
|
||||||
nur maximal 2 Einträge pro $c_i$ zu löschen. \hfill $\Oh(n)$
|
\points{2}
|
||||||
|
|
||||||
Füge einen neuen Knoten $d$ ein. Füge für jeden Knoten $c_i$ die vorher bestimmte Anzahl
|
\item
|
||||||
an Kanten zwischen $c_i$ und $a$ oder $b$ als Kanten zwischen $c_i$ und $d$ ein.
|
\begin{align*}
|
||||||
\hfill $\Oh(n)$
|
& \text{Variablen:} & x_1, \dots, x_{n} \in \set{1, \dots, \Delta + 1} \\
|
||||||
\item Gehe zurück zu \autoref{step2}
|
&&\text{Jeder Knoten hat eine Farbe} \\
|
||||||
\end{enumerate}
|
& \text{Zielfunktion:} & \argmin \sum_{i=1}^{n} x_i \\
|
||||||
|
&&\text{Es werden so wenig Farben wie möglich benutzt} \\
|
||||||
|
& \text{Nebenbedingung:} & \forall ab \colon x_a \neq x_b \\
|
||||||
|
&&\text{Die Knoten einer Kante haben nicht die selbe Farbe}
|
||||||
|
\end{align*}
|
||||||
|
\points{2}
|
||||||
|
|
||||||
Da der Knoten $a$ durch eine gleichverteilte Zufallszahl $z$ ausgewählt wird und der
|
|
||||||
Knoten $b$ ebenfalls gleichverteilt ausgewählt wird, ist die Kante $ab$ ebenfalls
|
\end{tasks}
|
||||||
gleichverteilt ausgewählt.
|
|
||||||
\points{6}
|
|
||||||
|
|
|
||||||
Binary file not shown.
|
|
@ -23,6 +23,7 @@
|
||||||
\setsansfont{TeX Gyre Heros}
|
\setsansfont{TeX Gyre Heros}
|
||||||
\setmonofont{TeX Gyre Cursor}
|
\setmonofont{TeX Gyre Cursor}
|
||||||
\setmathfont{Euler Math}
|
\setmathfont{Euler Math}
|
||||||
|
\mathitalicsmode=1
|
||||||
|
|
||||||
\setlength{\marginparwidth}{1.5\marginparwidth}
|
\setlength{\marginparwidth}{1.5\marginparwidth}
|
||||||
\setlength{\fboxrule}{\heavyrulewidth}
|
\setlength{\fboxrule}{\heavyrulewidth}
|
||||||
|
|
|
||||||
|
|
@ -28,6 +28,8 @@
|
||||||
}
|
}
|
||||||
{}
|
{}
|
||||||
|
|
||||||
|
\newcommand{\argmax}{\mathop{\mathrm{arg\,max}}}
|
||||||
|
\newcommand{\argmin}{\mathop{\mathrm{arg\,min}}}
|
||||||
\newcommand{\seilpmi}{\Longleftarrow}
|
\newcommand{\seilpmi}{\Longleftarrow}
|
||||||
|
|
||||||
\newcommand{\NN}{\mathbb{N}}
|
\newcommand{\NN}{\mathbb{N}}
|
||||||
|
|
@ -37,6 +39,14 @@
|
||||||
\newcommand{\CC}{\mathbb{C}}
|
\newcommand{\CC}{\mathbb{C}}
|
||||||
\newcommand{\PP}{\mathbb{P}}
|
\newcommand{\PP}{\mathbb{P}}
|
||||||
|
|
||||||
|
\newcommand{\pot}{\mathcal{P}}
|
||||||
|
|
||||||
|
\newcommand{\REC}{\mathrm{REC}}
|
||||||
|
\newcommand{\RE}{\mathrm{RE}}
|
||||||
|
\newcommand{\EA}{\mathrm{EA}}
|
||||||
|
\newcommand{\DEA}{\mathrm{DEA}}
|
||||||
|
\newcommand{\NEA}{\mathrm{DEA}}
|
||||||
|
|
||||||
\newcommand{\Pe}{\mathrm{P}}
|
\newcommand{\Pe}{\mathrm{P}}
|
||||||
\newcommand{\NPe}{\mathrm{NP}}
|
\newcommand{\NPe}{\mathrm{NP}}
|
||||||
|
|
||||||
|
|
@ -45,11 +55,9 @@
|
||||||
|
|
||||||
\newcommand{\indeg}{\mathrm{indeg}}
|
\newcommand{\indeg}{\mathrm{indeg}}
|
||||||
\newcommand{\outdeg}{\mathrm{outdeg}}
|
\newcommand{\outdeg}{\mathrm{outdeg}}
|
||||||
|
|
||||||
\newcommand{\Eh}{\mathrm{E}}
|
\newcommand{\Eh}{\mathrm{E}}
|
||||||
\newcommand{\Var}{\mathrm{Var}}
|
\newcommand{\Var}{\mathrm{Var}}
|
||||||
\newcommand{\pot}{\mathcal{P}}
|
|
||||||
\newcommand{\argmax}{\mathop{\mathrm{arg\,max}}}
|
|
||||||
\newcommand{\argmin}{\mathop{\mathrm{arg\,min}}}
|
|
||||||
|
|
||||||
\newcommand{\parens}[1]{\left(#1\right)}
|
\newcommand{\parens}[1]{\left(#1\right)}
|
||||||
\newcommand{\brackets}[1]{\left[#1\right]}
|
\newcommand{\brackets}[1]{\left[#1\right]}
|
||||||
|
|
@ -57,7 +65,7 @@
|
||||||
\newcommand{\angled}[1]{\left\langle#1\right\rangle}
|
\newcommand{\angled}[1]{\left\langle#1\right\rangle}
|
||||||
|
|
||||||
\newcommand{\suchthat}{\;\middle\vert\;}
|
\newcommand{\suchthat}{\;\middle\vert\;}
|
||||||
|
\newcommand{\set}[1]{\braces{#1}}
|
||||||
\newcommand{\tup}[1]{\parens{#1}}
|
\newcommand{\tup}[1]{\parens{#1}}
|
||||||
\newcommand{\interval}[2][b]{
|
\newcommand{\interval}[2][b]{
|
||||||
\if\detokenize{a}\detokenize{#1}%
|
\if\detokenize{a}\detokenize{#1}%
|
||||||
|
|
@ -73,20 +81,12 @@
|
||||||
\left]#2\right]
|
\left]#2\right]
|
||||||
\fi
|
\fi
|
||||||
}
|
}
|
||||||
\newcommand{\set}[2][]{
|
|
||||||
\ifx&
|
|
||||||
\braces{#2}
|
|
||||||
\else
|
|
||||||
\braces{#1 \suchthat #2}
|
|
||||||
\fi
|
|
||||||
}
|
|
||||||
\newcommand{\arr}[1]{\angled{#1}}
|
\newcommand{\arr}[1]{\angled{#1}}
|
||||||
\newcommand{\abs}[1]{\left\vert#1\right\vert}
|
\newcommand{\abs}[1]{\left\vert#1\right\vert}
|
||||||
\newcommand{\norm}[1]{\left\Vert#1\right\Vert}
|
\newcommand{\norm}[1]{\left\Vert#1\right\Vert}
|
||||||
\newcommand{\ceil}[1]{\left\lceil#1\right\rceil}
|
\newcommand{\ceil}[1]{\left\lceil#1\right\rceil}
|
||||||
\newcommand{\floor}[1]{\left\lfloor#1\right\rfloor}
|
\newcommand{\floor}[1]{\left\lfloor#1\right\rfloor}
|
||||||
|
|
||||||
% \newcommand{\alg}[2]{{\normalfont\scshape#1}{\normalfont(#2)}}
|
|
||||||
\newcommand{\algt}[1]{{\normalfont\scshape#1}}
|
\newcommand{\algt}[1]{{\normalfont\scshape#1}}
|
||||||
|
|
||||||
\makeatletter
|
\makeatletter
|
||||||
|
|
@ -107,53 +107,3 @@
|
||||||
\end{minipage}
|
\end{minipage}
|
||||||
}
|
}
|
||||||
|
|
||||||
% \newlength{\theoremskip}
|
|
||||||
% \setlength{\theoremskip}{6em}
|
|
||||||
%
|
|
||||||
% \newcommand{\theoremfont}{\normalfont\bfseries}
|
|
||||||
% \newcommand{\definitionfont}{\normalfont\bfseries}
|
|
||||||
%
|
|
||||||
% \newenvironment{theoremic}[3][]{
|
|
||||||
% {#3 #2 #1}
|
|
||||||
% \hfill
|
|
||||||
% \begin{minipage}[t]{\the\dimexpr\linewidth-\theoremskip\relax}
|
|
||||||
% }{
|
|
||||||
% \end{minipage}
|
|
||||||
% }
|
|
||||||
%
|
|
||||||
% \newenvironment{theorem}[1][]{
|
|
||||||
% \begin{theoremic}[#1]{Satz}{\theoremfont}
|
|
||||||
% }{
|
|
||||||
% \end{theoremic}
|
|
||||||
% }
|
|
||||||
%
|
|
||||||
% \newenvironment{lemma}[1][]{
|
|
||||||
% \begin{theoremic}[#1]{Lemma}{\theoremfont}
|
|
||||||
% }{
|
|
||||||
% \end{theoremic}
|
|
||||||
% }
|
|
||||||
%
|
|
||||||
% \newenvironment{corrolary}[1][]{
|
|
||||||
% \begin{theoremic}[#1]{Korall}{\theoremfont}
|
|
||||||
% }{
|
|
||||||
% \end{theoremic}
|
|
||||||
% }
|
|
||||||
%
|
|
||||||
% \newenvironment{proof}[1][]{
|
|
||||||
% \begin{theoremic}[#1]{Beweis}{\theoremfont}
|
|
||||||
% }{
|
|
||||||
% \end{theoremic}
|
|
||||||
% }
|
|
||||||
%
|
|
||||||
% \newenvironment{definition}[1][]{
|
|
||||||
% \begin{theoremic}[#1]{Definition}{\theoremfont}
|
|
||||||
% }{
|
|
||||||
% \end{theoremic}
|
|
||||||
% }
|
|
||||||
%
|
|
||||||
% \newenvironment{example}[1][]{
|
|
||||||
% \begin{theoremic}[#1]{Beispiel}{\theoremfont}
|
|
||||||
% }{
|
|
||||||
% \end{theoremic}
|
|
||||||
% }
|
|
||||||
%
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue