blatt 12
This commit is contained in:
parent
f12c9f3323
commit
d26c08d1a4
15 changed files with 318 additions and 0 deletions
BIN
übung_11/agt_übung_11_korr.pdf
Normal file
BIN
übung_11/agt_übung_11_korr.pdf
Normal file
Binary file not shown.
BIN
übung_12/agt26-blatt12.pdf
Normal file
BIN
übung_12/agt26-blatt12.pdf
Normal file
Binary file not shown.
BIN
übung_12/agt_übung_11_korr.pdf
Normal file
BIN
übung_12/agt_übung_11_korr.pdf
Normal file
Binary file not shown.
BIN
übung_12/agt_übung_12.pdf
Normal file
BIN
übung_12/agt_übung_12.pdf
Normal file
Binary file not shown.
20
übung_12/agt_übung_12.tex
Normal file
20
übung_12/agt_übung_12.tex
Normal file
|
|
@ -0,0 +1,20 @@
|
|||
\documentclass[parskip=half]{ngexrcs}
|
||||
\usepackage{hyperref}
|
||||
\usepackage{subcaption}
|
||||
\setkeys{Gin}{pagebox=artbox, width=0.8\textwidth}
|
||||
|
||||
\subject{Algorithmische Graphentheorie}
|
||||
\title{12. Übungsblatt}
|
||||
\author{Jasper Gude \and Pia Röttgers}
|
||||
|
||||
\begin{document}
|
||||
\maketitle
|
||||
\points[2em]{30}
|
||||
|
||||
\input{aufgabe_1.tex}
|
||||
\input{aufgabe_2.tex}
|
||||
\input{aufgabe_3.tex}
|
||||
\input{aufgabe_4.tex}
|
||||
\input{aufgabe_5.tex}
|
||||
|
||||
\end{document}
|
||||
10
übung_12/aufgabe_1.tex
Normal file
10
übung_12/aufgabe_1.tex
Normal file
|
|
@ -0,0 +1,10 @@
|
|||
\section{Listenfärbung}
|
||||
Siehe \autoref{fig:1}.
|
||||
\points{3}
|
||||
|
||||
\begin{figure}
|
||||
\centering
|
||||
\includegraphics[page=1]{figures.pdf}
|
||||
\caption{Listenfärbung für den Graphen.}
|
||||
\label{fig:1}
|
||||
\end{figure}
|
||||
11
übung_12/aufgabe_2.tex
Normal file
11
übung_12/aufgabe_2.tex
Normal file
|
|
@ -0,0 +1,11 @@
|
|||
\section{Graphenmodellierung}
|
||||
Wir modellieren das Funkmastproblem als Graphenproblem.
|
||||
Dabei sind die Funkmasten die Knoten und zischen zwei
|
||||
Masten existiert eine ungerichtete Kante, wenn sich die Sendegebiete überschneiden.
|
||||
|
||||
Die Zuweisung der Frequenzbänder entspricht der Färbung, da überschneidende
|
||||
Sendegebiete unterschiedliche Frequenzbänder nutzen müssen und bei der Färbung
|
||||
adjazente Knoten unterschiedliche Farben haben müssen.
|
||||
|
||||
Im Allgemeinen gibt es keine effizienten Algorithmen für die Färbung.
|
||||
\points{3}
|
||||
28
übung_12/aufgabe_3.tex
Normal file
28
übung_12/aufgabe_3.tex
Normal file
|
|
@ -0,0 +1,28 @@
|
|||
\section{Separierende Kreise und Störgraphen}
|
||||
Separierender Kreis und die Teilstücke wie in \autoref{fig:3a}
|
||||
und der nicht-bipartite Störgraph in \autoref{fig:3b}.
|
||||
Der Petersengraph ist also nicht planar.
|
||||
\points{4}
|
||||
|
||||
\begin{figure}
|
||||
\centering
|
||||
\begin{subfigure}{0.4\textwidth}
|
||||
\centering
|
||||
\includegraphics[page=2]{figures.pdf}
|
||||
\caption{Im Petersengraph.}
|
||||
\end{subfigure}
|
||||
\begin{subfigure}{0.4\textwidth}
|
||||
\centering
|
||||
\includegraphics[page=3]{figures.pdf}
|
||||
\caption{Etwas anders dargestellt.}
|
||||
\end{subfigure}
|
||||
\caption{Separierender Kreis in rot und dessen Teilstücke in blau, grün und pink.}
|
||||
\label{fig:3a}
|
||||
\end{figure}
|
||||
|
||||
\begin{figure}
|
||||
\centering
|
||||
\includegraphics[page=4]{figures.pdf}
|
||||
\caption{Der Störgraph.}
|
||||
\label{fig:3b}
|
||||
\end{figure}
|
||||
40
übung_12/aufgabe_4.tex
Normal file
40
übung_12/aufgabe_4.tex
Normal file
|
|
@ -0,0 +1,40 @@
|
|||
\section{Planarität}
|
||||
\begin{tasks}
|
||||
\item
|
||||
\begin{itemize}
|
||||
\item[(B1)]
|
||||
Wäre einer der Teilgraphen $C + P$ von $G$ nicht planar, dann könnte
|
||||
auch der Graph $G$ nicht planar sein.
|
||||
|
||||
\item[(B2)]
|
||||
Wenn der Störgraph nicht bipartit ist, dann gäbe es keine Möglichkeit
|
||||
die Teilstücke so innen und außen an den separierenden Kreis zu legen,
|
||||
sodass sich keine Teilstücke überschneiden, da es keine
|
||||
Aufteilung der Teilstücke in zwei disjunkte Mengen gibt, bei der
|
||||
sich Teilstücke nicht schneiden.
|
||||
\end{itemize}
|
||||
\points{3}
|
||||
|
||||
\item
|
||||
Ein zweifach knotenzusammenhängender Graph hat per Definition einen Kreis.
|
||||
|
||||
Aus dem Lemma 1 aus der Vorlesung folgt, dass wenn der Graph einen nicht-separierenden Kreis hat,
|
||||
dann muss ein Teilstück ein Pfad sein, denn wenn es kein Pfad wäre,
|
||||
gäbe es einen separierenden Kreis. Somit besteht der Graph aus einem Kreis und/oder
|
||||
einem Pfadteilstück.
|
||||
|
||||
Ein Kreis mit nur einem Teilstück lässt sich immer
|
||||
Überscheidungsfrei zeichnen.
|
||||
\points{4}
|
||||
|
||||
\item
|
||||
Sei $P$ ein Teilstück eines zweifach knotenzusammenhängenden Graphen $G$
|
||||
bezüglich eines separierenden Kreises $C$.
|
||||
|
||||
Angenommen das Teilstück $p$ hat nur einen Anknüpfpunkt in $C$. Dann
|
||||
könnten wir diesen Knoten auf $C$ entfernen und würden den Graphen in
|
||||
zwei Zusammenhangskomponenten zerlegen. Also muss das Teilstück mindestens
|
||||
zwei Anknüpfpunkte haben und somit ist $C + P$ zweifach knotenzusammenhängend.
|
||||
\points{3}
|
||||
|
||||
\end{tasks}
|
||||
28
übung_12/aufgabe_5.tex
Normal file
28
übung_12/aufgabe_5.tex
Normal file
|
|
@ -0,0 +1,28 @@
|
|||
\section{Leichteste Kreise}
|
||||
\begin{tasks}
|
||||
\item
|
||||
Wir wenden Dijkstra auf den Graphen $G$ mit Startknoten $s$ an (\autoref{fig:edsger}).
|
||||
Das geht in $\Oh(n \log n)$ da Dijkstra in $\Oh(E + V \log V)$ läuft und die Kanten $m$ im planaren Graphen mit $m \leq 3n-6$ beschränkt sind.
|
||||
|
||||
Einen Kreis der $s$ enthält existiert, wenn es in einem Teilbaum von $s$ des
|
||||
Kürzeste-Wege-Baums eine Rückwärtskante zu $s$ gibt.
|
||||
|
||||
Haben wir eine Rückwärtskante in einem Teilbaum gefunden, lesen wir den kürzesten
|
||||
Weg von $s$ zu dem Knoten $a$ von dem die Rückwärtskante ausgeht, aus dem
|
||||
Kürzeste-Wege-Baum ab. Das Gewicht des Kreises erhalten wir, durch $a_d + \abs{as}$, wobei $a_d$ die Länge des kürzesten $s-a$-Weges ist und $\abs{as}$ das Kantengewicht der Kante $as$.
|
||||
|
||||
Es reicht, die erste Rückwärtskante die wir finden zu nehmen.
|
||||
|
||||
Das müssen wir nun für alle Teilbäume machen.
|
||||
Da der durchschnittliche Knotengrad im Graphen
|
||||
|
||||
|
||||
|
||||
\end{tasks}
|
||||
|
||||
\begin{figure}
|
||||
\centering
|
||||
\includegraphics{edsger.png}
|
||||
\caption{Let's go Edsger! Shortest Path!}
|
||||
\label{fig:edsger}
|
||||
\end{figure}
|
||||
BIN
übung_12/edsger.png
Normal file
BIN
übung_12/edsger.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 1.7 MiB |
BIN
übung_12/edsger.xcf
Normal file
BIN
übung_12/edsger.xcf
Normal file
Binary file not shown.
BIN
übung_12/figures.pdf
Normal file
BIN
übung_12/figures.pdf
Normal file
Binary file not shown.
72
übung_12/ngexrcs.cls
Normal file
72
übung_12/ngexrcs.cls
Normal file
|
|
@ -0,0 +1,72 @@
|
|||
% vim: set filetype:tex
|
||||
|
||||
% Identification %
|
||||
\NeedsTeXFormat{LaTeX2e}
|
||||
\ProvidesClass{ngexrcs}[2021/12/21 ADS Exercise class]
|
||||
|
||||
% Handle options %
|
||||
\DeclareOption*{\PassOptionsToClass{\CurrentOption}{scrartcl}}
|
||||
\ProcessOptions\relax
|
||||
|
||||
% More declarations %
|
||||
\LoadClass{scrartcl}
|
||||
|
||||
\KOMAoptions{mpinclude=true}
|
||||
\recalctypearea
|
||||
|
||||
\RequirePackage{ngutils}
|
||||
|
||||
% define fonts
|
||||
\RequirePackage{fontspec}
|
||||
\RequirePackage[math-style=upright]{unicode-math}
|
||||
\setmainfont{TeX Gyre Pagella}
|
||||
\setsansfont{TeX Gyre Heros}
|
||||
\setmonofont{TeX Gyre Cursor}
|
||||
\setmathfont{Euler Math}
|
||||
\mathitalicsmode=1
|
||||
|
||||
\setlength{\marginparwidth}{1.5\marginparwidth}
|
||||
\setlength{\fboxrule}{\heavyrulewidth}
|
||||
|
||||
% Use sansfont for all title elements
|
||||
\addtokomafont{titlehead}{\sffamily}
|
||||
\addtokomafont{subject}{\sffamily}
|
||||
\addtokomafont{title}{\sffamily}
|
||||
\addtokomafont{subtitle}{\sffamily}
|
||||
\addtokomafont{author}{\sffamily}
|
||||
\addtokomafont{date}{\sffamily}
|
||||
\addtokomafont{publishers}{\sffamily}
|
||||
|
||||
% Use serif font for headings
|
||||
\addtokomafont{disposition}{\rmfamily}
|
||||
|
||||
% Let sections be formated as in: Aufgabe 1 -- Section title
|
||||
\renewcommand*{\sectionformat}{Aufgabe \thesection\autodot\enskip--\enskip}
|
||||
|
||||
% Let points of an exercise be printed as in: [__ / 2]
|
||||
\newkomafont{points}{\sffamily}
|
||||
\newcommand\points[2][1em]{\marginline{\framebox{{\usekomafont{points}\hspace{#1} \textbf{/} #2}}}}
|
||||
|
||||
\newcounter{task}
|
||||
\renewcommand{\thetask}{\@alph\c@task)}
|
||||
\newenvironment{tasks}
|
||||
{
|
||||
\begin{list}{\thetask}
|
||||
{
|
||||
\usecounter{task}
|
||||
\setlength{\leftmargin}{1.6em}
|
||||
}
|
||||
}{%
|
||||
\end{list}
|
||||
}
|
||||
|
||||
\DeclareNewTOC
|
||||
[
|
||||
type=algorithm,
|
||||
types=algorithms,
|
||||
float,
|
||||
floattype=4,
|
||||
name=Algorithmus,
|
||||
listname={Algorithmenverzeichnis}
|
||||
]
|
||||
{loa}
|
||||
109
übung_12/ngutils.sty
Normal file
109
übung_12/ngutils.sty
Normal file
|
|
@ -0,0 +1,109 @@
|
|||
\NeedsTeXFormat{LaTeX2e}
|
||||
\ProvidesPackage{ngutils}[2026/06/05 Never's LaTeX utils]
|
||||
|
||||
\RequirePackage[ngerman]{babel}
|
||||
\RequirePackage{graphicx}
|
||||
\RequirePackage{tabularx}
|
||||
\RequirePackage{booktabs}
|
||||
\RequirePackage{listings}
|
||||
|
||||
\lstnewenvironment{pseudocode}[1][] %defines the algorithm listing environment
|
||||
{
|
||||
\renewcommand{\lstlistingname}{Algorithmus}
|
||||
\lstset{ %this is the stype
|
||||
mathescape=true,
|
||||
columns=fullflexible,
|
||||
basicstyle=\normalfont,
|
||||
identifierstyle=\scshape,
|
||||
keywordstyle=\bfseries,
|
||||
keywords={, and, or, not, new, if, then, else, while, for, in, to, up, down, foreach, do, return},
|
||||
commentstyle=\itshape,
|
||||
comment=[l]//,
|
||||
delim=[is][\normalfont]{|}{|},
|
||||
tabsize=3,
|
||||
frame=tb,
|
||||
framerule=1pt,
|
||||
#1 % this is to add specific settings to an usage of this environment (for instnce, the caption and referable label)
|
||||
}
|
||||
}
|
||||
{}
|
||||
|
||||
\newcommand{\argmax}{\mathop{\mathrm{arg\,max}}}
|
||||
\newcommand{\argmin}{\mathop{\mathrm{arg\,min}}}
|
||||
\newcommand{\seilpmi}{\Longleftarrow}
|
||||
|
||||
\newcommand{\NN}{\mathbb{N}}
|
||||
\newcommand{\ZZ}{\mathbb{Z}}
|
||||
\newcommand{\QQ}{\mathbb{Q}}
|
||||
\newcommand{\RR}{\mathbb{R}}
|
||||
\newcommand{\CC}{\mathbb{C}}
|
||||
\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{\NPe}{\mathrm{NP}}
|
||||
|
||||
\newcommand{\Oh}{\mathcal{O}}
|
||||
\newcommand{\oh}{\mathcal{o}}
|
||||
|
||||
\newcommand{\indeg}{\mathrm{indeg}}
|
||||
\newcommand{\outdeg}{\mathrm{outdeg}}
|
||||
|
||||
\newcommand{\Eh}{\mathrm{E}}
|
||||
\newcommand{\Var}{\mathrm{Var}}
|
||||
|
||||
\newcommand{\parens}[1]{\left(#1\right)}
|
||||
\newcommand{\brackets}[1]{\left[#1\right]}
|
||||
\newcommand{\braces}[1]{\left\{#1\right\}}
|
||||
\newcommand{\angled}[1]{\left\langle#1\right\rangle}
|
||||
|
||||
\newcommand{\suchthat}{\;\middle\vert\;}
|
||||
\newcommand{\set}[1]{\braces{#1}}
|
||||
\newcommand{\tup}[1]{\parens{#1}}
|
||||
\newcommand{\interval}[2][b]{
|
||||
\if\detokenize{a}\detokenize{#1}%
|
||||
\left[#2\right[
|
||||
\fi
|
||||
\if\detokenize{b}\detokenize{#1}%
|
||||
\left[#2\right]
|
||||
\fi
|
||||
\if\detokenize{c}\detokenize{#1}%
|
||||
\left]#2\right[
|
||||
\fi
|
||||
\if\detokenize{d}\detokenize{#1}%
|
||||
\left]#2\right]
|
||||
\fi
|
||||
}
|
||||
\newcommand{\arr}[1]{\angled{#1}}
|
||||
\newcommand{\abs}[1]{\left\vert#1\right\vert}
|
||||
\newcommand{\norm}[1]{\left\Vert#1\right\Vert}
|
||||
\newcommand{\ceil}[1]{\left\lceil#1\right\rceil}
|
||||
\newcommand{\floor}[1]{\left\lfloor#1\right\rfloor}
|
||||
|
||||
\newcommand{\algt}[1]{{\normalfont\scshape#1}}
|
||||
|
||||
\makeatletter
|
||||
\newcommand*{\alg@unstarred}[2]{{\normalfont\scshape#1}{\normalfont(#2)}}
|
||||
\newcommand*{\alg@starred}[1]{{\normalfont\scshape#1}}
|
||||
\newcommand*{\alg}{\@ifstar{\alg@starred}{\alg@unstarred}}
|
||||
\makeatother
|
||||
|
||||
\newcommand{\com}[1]{{\normalfont\itshape/\!\!/ #1}}
|
||||
|
||||
\newenvironment{algorithmic}[1][1em]{
|
||||
\begin{minipage}[t]{\dimexpr\linewidth}
|
||||
\bfseries
|
||||
\begin{tabbing}
|
||||
\hspace{#1}\=\hspace{#1}\=\hspace{#1}\=\hspace{#1}\=\hspace{#1}\=\hspace{#1}\=\hspace{#1}\=\hspace{#1}\=\kill
|
||||
}{%
|
||||
\end{tabbing}
|
||||
\end{minipage}
|
||||
}
|
||||
|
||||
Loading…
Add table
Add a link
Reference in a new issue