Übungsblatt 4

This commit is contained in:
Never Gude 2026-05-17 17:15:38 +02:00
parent df171830a8
commit ddd2cf58da
12 changed files with 1284 additions and 0 deletions

BIN
übung_4/agt26-blatt04.pdf Normal file

Binary file not shown.

Binary file not shown.

BIN
übung_4/agt_übung_4.pdf Normal file

Binary file not shown.

17
übung_4/agt_übung_4.tex Normal file
View file

@ -0,0 +1,17 @@
\documentclass{ngexrcs}
\usepackage{hyperref}
\setkeys{Gin}{pagebox=artbox, width=0.2\textwidth}
\title{4. Übungsblatt}
\subject{Algorithmische Graphentheorie}
\author{Jasper Gude \and Pia Röttgers}
\begin{document}
\maketitle
\points[\qquad]{20}
\input{aufgabe_1.tex}
\input{aufgabe_2.tex}
\input{aufgabe_3.tex}
\end{document}

33
übung_4/aufgabe_1.tex Normal file
View file

@ -0,0 +1,33 @@
\section{Knotengrade}
\begin{tasks}
\item
Einen solchen Graph gibt es. Siehe \autoref{fig:task1a}.
\points{3}
\begin{figure}
\centering
\includegraphics[page=1, width=0.8\textwidth]{figures.pdf}
\caption{Ein Graph mit 11 Knoten und Knotengraden 1, 1, 2, 3, 4, 5, 5, 6, 7, 8, 10.}
\label{fig:task1a}
\end{figure}
\item
Das Problem kann als Maximalflussproblem modelliert werden. Dafür haben wir
eine Quelle $s$, eine Senke $t$ und Knoten $v_i$ mit $i \in \NN_{\leq n}$.
Die Eingangskapazität eines Knoten $v_i$ entspricht dem Eingangsgrad $e_i$.
Die Ausgangskapazität entspricht dem Ausgangsgrad $a_i$. Siehe \autoref{fig:task1b}.
Wenn es einen vollständigen Fluss gibt, gibt es eine Lösung für das Problem,
sonst nicht.
\points{4}
\begin{figure}
\centering
\includegraphics[page=2, width=0.5\textwidth]{figures.pdf}
\caption{Das Problem als Maximalflussproblem.}
\label{fig:task1b}
\end{figure}
\item
Die Modellierung ist korrekt, da der Eingangs- und Ausgangsgrad jedes Knotens $v_i$
von oben beschränkt wird von der Eingangskapazität $e_i$ bzw. Ausgangskapazität $a_i$.
Zudem erfüllt die Flusserhaltung den Zweck, dass die Summe der Eingangsgrade gleich der Summe der Ausgangsgrade sind, was in einem Graphen erfüllt sein muss.
\points{2}
\end{tasks}

5
übung_4/aufgabe_2.tex Normal file
View file

@ -0,0 +1,5 @@
\section{b-Flüsse}
\begin{tasks}
\item
\item
\end{tasks}

1
übung_4/aufgabe_3.tex Normal file
View file

@ -0,0 +1 @@
\section{Minimale Schnitte}

38
übung_4/aufgabe_4.tex Normal file
View file

@ -0,0 +1,38 @@
\section{Längste Wege}
\begin{tasks}
\item
Da $s, t$ in $G'$ adjazent zu jedem Knoten in $G$ ist, können wir
einen einfachen $s$-$t$-Weg der Länge $k+2$ erzeugen, indem wir
einen einfachen Weg der Länge $k$ in $G$ nehmen, $s$ an das eine Ende und $t$ an das andere Ende hängen.
Umgekehrt kann man aus einem einfachen $s$-$t$-Weg der Länge $k$
in $G'$ einen einfachen Weg der Länge $k-2$ in $G$ konstruieren,
indem wir $s$ und $t$ entfernen.
\points{2}
\item
Ein Hamiltonweg ist ein Weg der alle Knoten in $G$ beinhaltet
und somit Länge $n-1$ besitzt.
Wie wir oben gezeigt haben, kann ein $s$-$t$-Weg der Länge $n+1$
in $G'$ leicht in einen Weg der Länge $n-1$ in $G$ umgewandelt
werden. Das heißt, dass wir einen Hamiltonweg in $G$ finden,
wenn wir einen $s$-$t$-Weg finden.
Umgekehrt können wir einen Hamiltonweg leicht in einen $s$-$t$-Weg
umwandeln, also finden wir einen $s$-$t$-Weg wenn wir einen
Hamiltonweg finden.
Also finden wir einen Hamiltonweg genau dann, wenn wir einen
$s$-$t$-Weg finden.
\points{1}
\item
Da wir Hamiltonweg auf \algt{Längster $s$-$t$-Weg} reduziert
haben, muss also \algt{Längster $s$-$t$-Weg} $\NPe$-schwer sein, denn
wenn es in $\Pe$ liegen würde, könnten wir auch Hamiltonweg in
polynomieller Zeit lösen. Da wir nicht von $\Pe = \NPe$ ausgehen,
ist das nicht möglich.
\points{2}
\end{tasks}

BIN
übung_4/figures.pdf Normal file

Binary file not shown.

View file

@ -0,0 +1,995 @@
<?xml version="1.0"?>
<!DOCTYPE ipe SYSTEM "ipe.dtd">
<ipe version="70218" creator="Ipe 7.2.30">
<info created="D:20260417131308" modified="D:20260517153402" tex="luatex"/>
<ipestyle name="basic">
<symbol name="arrow/arc(spx)">
<path stroke="sym-stroke" fill="sym-stroke" pen="sym-pen">
0 0 m
-1 0.333 l
-1 -0.333 l
h
</path>
</symbol>
<symbol name="arrow/farc(spx)">
<path stroke="sym-stroke" fill="white" pen="sym-pen">
0 0 m
-1 0.333 l
-1 -0.333 l
h
</path>
</symbol>
<symbol name="arrow/ptarc(spx)">
<path stroke="sym-stroke" fill="sym-stroke" pen="sym-pen">
0 0 m
-1 0.333 l
-0.8 0 l
-1 -0.333 l
h
</path>
</symbol>
<symbol name="arrow/fptarc(spx)">
<path stroke="sym-stroke" fill="white" pen="sym-pen">
0 0 m
-1 0.333 l
-0.8 0 l
-1 -0.333 l
h
</path>
</symbol>
<symbol name="mark/circle(sx)" transformations="translations">
<path fill="sym-stroke">
0.6 0 0 0.6 0 0 e
0.4 0 0 0.4 0 0 e
</path>
</symbol>
<symbol name="mark/disk(sx)" transformations="translations">
<path fill="sym-stroke">
0.6 0 0 0.6 0 0 e
</path>
</symbol>
<symbol name="mark/fdisk(sfx)" transformations="translations">
<group>
<path fill="sym-fill">
0.5 0 0 0.5 0 0 e
</path>
<path fill="sym-stroke" fillrule="eofill">
0.6 0 0 0.6 0 0 e
0.4 0 0 0.4 0 0 e
</path>
</group>
</symbol>
<symbol name="mark/box(sx)" transformations="translations">
<path fill="sym-stroke" fillrule="eofill">
-0.6 -0.6 m
0.6 -0.6 l
0.6 0.6 l
-0.6 0.6 l
h
-0.4 -0.4 m
0.4 -0.4 l
0.4 0.4 l
-0.4 0.4 l
h
</path>
</symbol>
<symbol name="mark/square(sx)" transformations="translations">
<path fill="sym-stroke">
-0.6 -0.6 m
0.6 -0.6 l
0.6 0.6 l
-0.6 0.6 l
h
</path>
</symbol>
<symbol name="mark/fsquare(sfx)" transformations="translations">
<group>
<path fill="sym-fill">
-0.5 -0.5 m
0.5 -0.5 l
0.5 0.5 l
-0.5 0.5 l
h
</path>
<path fill="sym-stroke" fillrule="eofill">
-0.6 -0.6 m
0.6 -0.6 l
0.6 0.6 l
-0.6 0.6 l
h
-0.4 -0.4 m
0.4 -0.4 l
0.4 0.4 l
-0.4 0.4 l
h
</path>
</group>
</symbol>
<symbol name="mark/cross(sx)" transformations="translations">
<group>
<path fill="sym-stroke">
-0.43 -0.57 m
0.57 0.43 l
0.43 0.57 l
-0.57 -0.43 l
h
</path>
<path fill="sym-stroke">
-0.43 0.57 m
0.57 -0.43 l
0.43 -0.57 l
-0.57 0.43 l
h
</path>
</group>
</symbol>
<symbol name="arrow/fnormal(spx)">
<path stroke="sym-stroke" fill="white" pen="sym-pen">
0 0 m
-1 0.333 l
-1 -0.333 l
h
</path>
</symbol>
<symbol name="arrow/pointed(spx)">
<path stroke="sym-stroke" fill="sym-stroke" pen="sym-pen">
0 0 m
-1 0.333 l
-0.8 0 l
-1 -0.333 l
h
</path>
</symbol>
<symbol name="arrow/fpointed(spx)">
<path stroke="sym-stroke" fill="white" pen="sym-pen">
0 0 m
-1 0.333 l
-0.8 0 l
-1 -0.333 l
h
</path>
</symbol>
<symbol name="arrow/linear(spx)">
<path stroke="sym-stroke" pen="sym-pen">
-1 0.333 m
0 0 l
-1 -0.333 l
</path>
</symbol>
<symbol name="arrow/fdouble(spx)">
<path stroke="sym-stroke" fill="white" pen="sym-pen">
0 0 m
-1 0.333 l
-1 -0.333 l
h
-1 0 m
-2 0.333 l
-2 -0.333 l
h
</path>
</symbol>
<symbol name="arrow/double(spx)">
<path stroke="sym-stroke" fill="sym-stroke" pen="sym-pen">
0 0 m
-1 0.333 l
-1 -0.333 l
h
-1 0 m
-2 0.333 l
-2 -0.333 l
h
</path>
</symbol>
<symbol name="arrow/mid-normal(spx)">
<path stroke="sym-stroke" fill="sym-stroke" pen="sym-pen">
0.5 0 m
-0.5 0.333 l
-0.5 -0.333 l
h
</path>
</symbol>
<symbol name="arrow/mid-fnormal(spx)">
<path stroke="sym-stroke" fill="white" pen="sym-pen">
0.5 0 m
-0.5 0.333 l
-0.5 -0.333 l
h
</path>
</symbol>
<symbol name="arrow/mid-pointed(spx)">
<path stroke="sym-stroke" fill="sym-stroke" pen="sym-pen">
0.5 0 m
-0.5 0.333 l
-0.3 0 l
-0.5 -0.333 l
h
</path>
</symbol>
<symbol name="arrow/mid-fpointed(spx)">
<path stroke="sym-stroke" fill="white" pen="sym-pen">
0.5 0 m
-0.5 0.333 l
-0.3 0 l
-0.5 -0.333 l
h
</path>
</symbol>
<symbol name="arrow/mid-double(spx)">
<path stroke="sym-stroke" fill="sym-stroke" pen="sym-pen">
1 0 m
0 0.333 l
0 -0.333 l
h
0 0 m
-1 0.333 l
-1 -0.333 l
h
</path>
</symbol>
<symbol name="arrow/mid-fdouble(spx)">
<path stroke="sym-stroke" fill="white" pen="sym-pen">
1 0 m
0 0.333 l
0 -0.333 l
h
0 0 m
-1 0.333 l
-1 -0.333 l
h
</path>
</symbol>
<anglesize name="22.5 deg" value="22.5"/>
<anglesize name="30 deg" value="30"/>
<anglesize name="45 deg" value="45"/>
<anglesize name="60 deg" value="60"/>
<anglesize name="90 deg" value="90"/>
<arrowsize name="large" value="10"/>
<arrowsize name="small" value="5"/>
<arrowsize name="tiny" value="3"/>
<color name="blue" value="0 0 1"/>
<color name="brown" value="0.647 0.165 0.165"/>
<color name="darkblue" value="0 0 0.545"/>
<color name="darkcyan" value="0 0.545 0.545"/>
<color name="darkgray" value="0.663"/>
<color name="darkgreen" value="0 0.392 0"/>
<color name="darkmagenta" value="0.545 0 0.545"/>
<color name="darkorange" value="1 0.549 0"/>
<color name="darkred" value="0.545 0 0"/>
<color name="gold" value="1 0.843 0"/>
<color name="gray" value="0.745"/>
<color name="green" value="0 1 0"/>
<color name="lightblue" value="0.678 0.847 0.902"/>
<color name="lightcyan" value="0.878 1 1"/>
<color name="lightgray" value="0.827"/>
<color name="lightgreen" value="0.565 0.933 0.565"/>
<color name="lightyellow" value="1 1 0.878"/>
<color name="navy" value="0 0 0.502"/>
<color name="orange" value="1 0.647 0"/>
<color name="pink" value="1 0.753 0.796"/>
<color name="purple" value="0.627 0.125 0.941"/>
<color name="red" value="1 0 0"/>
<color name="seagreen" value="0.18 0.545 0.341"/>
<color name="turquoise" value="0.251 0.878 0.816"/>
<color name="violet" value="0.933 0.51 0.933"/>
<color name="yellow" value="1 1 0"/>
<dashstyle name="dash dot dotted" value="[4 2 1 2 1 2] 0"/>
<dashstyle name="dash dotted" value="[4 2 1 2] 0"/>
<dashstyle name="dashed" value="[4] 0"/>
<dashstyle name="dotted" value="[1 3] 0"/>
<gridsize name="10 pts (~3.5 mm)" value="10"/>
<gridsize name="14 pts (~5 mm)" value="14"/>
<gridsize name="16 pts (~6 mm)" value="16"/>
<gridsize name="20 pts (~7 mm)" value="20"/>
<gridsize name="28 pts (~10 mm)" value="28"/>
<gridsize name="32 pts (~12 mm)" value="32"/>
<gridsize name="4 pts" value="4"/>
<gridsize name="56 pts (~20 mm)" value="56"/>
<gridsize name="8 pts (~3 mm)" value="8"/>
<opacity name="10%" value="0.1"/>
<opacity name="30%" value="0.3"/>
<opacity name="50%" value="0.5"/>
<opacity name="75%" value="0.75"/>
<pen name="fat" value="1.2"/>
<pen name="heavier" value="0.8"/>
<pen name="ultrafat" value="2"/>
<symbolsize name="large" value="5"/>
<symbolsize name="small" value="2"/>
<symbolsize name="tiny" value="1.1"/>
<textsize name="Huge" value="\Huge"/>
<textsize name="LARGE" value="\LARGE"/>
<textsize name="Large" value="\Large"/>
<textsize name="footnote" value="\footnotesize"/>
<textsize name="huge" value="\huge"/>
<textsize name="large" value="\large"/>
<textsize name="script" value="\scriptsize"/>
<textsize name="small" value="\small"/>
<textsize name="tiny" value="\tiny"/>
<textstyle name="center" begin="\begin{center}" end="\end{center}"/>
<textstyle name="item" begin="\begin{itemize}\item{}" end="\end{itemize}"/>
<textstyle name="itemize" begin="\begin{itemize}" end="\end{itemize}"/>
<tiling name="falling" angle="-60" step="4" width="1"/>
<tiling name="rising" angle="30" step="4" width="1"/>
</ipestyle>
<ipestyle name="ngslides">
<symbol name="arrow/ng-fnormal(spx)">
<path stroke="sym-stroke" fill="white" pen="sym-pen">
-0.7 0 m
-1.7 0.333 l
-1.7 -0.333 l
h
</path>
</symbol>
<symbol name="arrow/ng-normal(spx)">
<path stroke="sym-stroke" fill="sym-stroke" pen="sym-pen">
-0.7 0 m
-1.7 0.333 l
-1.7 -0.333 l
h
</path>
</symbol>
<symbol name="arrow/ng-pointed(spx)">
<path stroke="sym-stroke" fill="sym-stroke" pen="sym-pen">
-0.7 0 m
-1.7 0.333 l
-0.8 0 l
-1.7 -0.333 l
h
</path>
</symbol>
<symbol name="arrow/ng-fpointed(spx)">
<path stroke="sym-stroke" fill="white" pen="sym-pen">
-0.7 0 m
-1.7 0.333 l
-0.8 0 l
-1.7 -0.333 l
h
</path>
</symbol>
<symbol name="arrow/ng-linear(spx)">
<path stroke="sym-stroke" pen="sym-pen">
-1.7 0.333 m
-0.7 0 l
-1.7 -0.333 l
</path>
</symbol>
<symbol name="arrow/ng-fdouble(spx)">
<path stroke="sym-stroke" fill="white" pen="sym-pen">
-0.7 0 m
-1.7 0.333 l
-1.7 -0.333 l
h
-1.7 0 m
-2.7 0.333 l
-2.7 -0.333 l
h
</path>
</symbol>
<symbol name="arrow/ng-double(spx)">
<path stroke="sym-stroke" fill="sym-stroke" pen="sym-pen">
-0.7 0 m
-1.7 0.333 l
-1.7 -0.333 l
h
-1.7 0 m
-2.7 0.333 l
-2.7 -0.333 l
h
</path>
</symbol>
<symbol name="decoration/remark">
<path stroke="dark gray" fill="light yellow">
100 204 m
4 0 0 4 100 200 96 200 a
96 100 l
4 0 0 4 100 100 100 96 a
300 96 l
4 0 0 4 300 100 304 100 a
304 200 l
4 0 0 4 300 200 300 204 a
h
</path>
</symbol>
<symbol name="decoration/theorem">
<path stroke="dark blue" fill="light blue">
100 204 m
4 0 0 4 100 200 96 200 a
96 100 l
4 0 0 4 100 100 100 96 a
300 96 l
4 0 0 4 300 100 304 100 a
304 200 l
4 0 0 4 300 200 300 204 a
h
</path>
</symbol>
<symbol name="decoration/problem">
<path stroke="dark green" fill="light green">
100 204 m
4 0 0 4 100 200 96 200 a
96 100 l
4 0 0 4 100 100 100 96 a
300 96 l
4 0 0 4 300 100 304 100 a
304 200 l
4 0 0 4 300 200 300 204 a
h
</path>
</symbol>
<symbol name="decoration/definition">
<path stroke="dark gray" fill="light yellow">
96 96 m
304 96 l
304 204 l
96 204 l
h
</path>
</symbol>
<symbol name="decoration/algorithm">
<path stroke="dark gray" fill="light green" dash="dashed">
96 96 m
304 96 l
304 204 l
96 204 l
h
</path>
</symbol>
<symbol name="decoration/graph">
<path stroke="dark gray">
92 92 m
308 92 l
308 208 l
92 208 l
h
</path>
</symbol>
<symbol name="decoration/comic-bl">
<path stroke="dark gray" fill="light yellow">
100 96 m
110 96 s
110 92
106 88 s
116 92
118 96 s
300 96 l
4 0 0 4 300 100 304 100 a
304 200 l
4 0 0 4 300 200 300 204 a
100 204 l
4 0 0 4 100 200 96 200 a
96 100 l
4 0 0 4 100 100 100 96 a
h
</path>
</symbol>
<symbol name="decoration/comic-bm">
<path stroke="dark gray" fill="light yellow">
100 96 m
186 96 s
186 92
182 88 s
192 92
194 96 s
300 96 l
4 0 0 4 300 100 304 100 a
304 200 l
4 0 0 4 300 200 300 204 a
100 204 l
4 0 0 4 100 200 96 200 a
96 100 l
4 0 0 4 100 100 100 96 a
h
</path>
</symbol>
<symbol name="decoration/comic-br">
<path matrix="-1 0 0 1 400 0" stroke="dark gray" fill="light yellow">
100 96 m
110 96 s
110 92
106 88 s
116 92
118 96 s
300 96 l
4 0 0 4 300 100 304 100 a
304 200 l
4 0 0 4 300 200 300 204 a
100 204 l
4 0 0 4 100 200 96 200 a
96 100 l
4 0 0 4 100 100 100 96 a
h
</path>
</symbol>
<symbol name="decoration/comic-tl">
<path matrix="1 0 0 -1 0 300" stroke="dark gray" fill="light yellow">
100 96 m
110 96 s
110 92
106 88 s
116 92
118 96 s
300 96 l
4 0 0 4 300 100 304 100 a
304 200 l
4 0 0 4 300 200 300 204 a
100 204 l
4 0 0 4 100 200 96 200 a
96 100 l
4 0 0 4 100 100 100 96 a
h
</path>
</symbol>
<symbol name="decoration/comic-tm">
<path matrix="1 0 0 -1 0 300" stroke="dark gray" fill="light yellow">
100 96 m
186 96 s
186 92
182 88 s
192 92
194 96 s
300 96 l
4 0 0 4 300 100 304 100 a
304 200 l
4 0 0 4 300 200 300 204 a
100 204 l
4 0 0 4 100 200 96 200 a
96 100 l
4 0 0 4 100 100 100 96 a
h
</path>
</symbol>
<symbol name="decoration/comic-tr">
<path matrix="-1 0 0 -1 400 300" stroke="dark gray" fill="light yellow">
100 96 m
110 96 s
110 92
106 88 s
116 92
118 96 s
300 96 l
4 0 0 4 300 100 304 100 a
304 200 l
4 0 0 4 300 200 300 204 a
100 204 l
4 0 0 4 100 200 96 200 a
96 100 l
4 0 0 4 100 100 100 96 a
h
</path>
</symbol>
<color name="dark blue" value="0.121 0.47 0.705"/>
<color name="dark brown" value="0.651 0.337 0.157"/>
<color name="dark cyan" value="0.106 0.62 0.467"/>
<color name="dark gray" value="0.5"/>
<color name="dark green" value="0.2 0.627 0.172"/>
<color name="dark orange" value="1 0.498 0"/>
<color name="dark pink" value="0.969 0.506 0.749"/>
<color name="dark purple" value="0.415 0.239 0.603"/>
<color name="dark red" value="0.89 0.102 0.109"/>
<color name="dark yellow" value="1 1 0.2"/>
<color name="light blue" value="0.651 0.807 0.89"/>
<color name="light brown" value="0.898 0.847 0.741"/>
<color name="light cyan" value="0.553 0.827 0.78"/>
<color name="light gray" value="0.8"/>
<color name="light green" value="0.698 0.874 0.541"/>
<color name="light orange" value="0.992 0.749 0.435"/>
<color name="light pink" value="0.992 0.855 0.925"/>
<color name="light purple" value="0.792 0.698 0.839"/>
<color name="light red" value="0.984 0.603 0.6"/>
<color name="light yellow" value="1 1 0.8"/>
<color name="pagenumber" value="0.5"/>
<color name="title" value="0.247 0.282 0.392"/>
<pen name="fat" value="3.6"/>
<pen name="heavier" value="2.4"/>
<pen name="normal" value="1.2"/>
<pen name="ultrafat" value="6"/>
<symbolsize name="large" value="15"/>
<symbolsize name="normal" value="9"/>
<symbolsize name="small" value="6"/>
<symbolsize name="tiny" value="3.3"/>
<textstretch name="Huge" value="2.4"/>
<textstretch name="LARGE" value="2.4"/>
<textstretch name="Large" value="2.4"/>
<textstretch name="footnote" value="2.4"/>
<textstretch name="huge" value="2.4"/>
<textstretch name="large" value="2.4"/>
<textstretch name="normal" value="2.4"/>
<textstretch name="script" value="2.4"/>
<textstretch name="small" value="2.4"/>
<textstretch name="tiny" value="2.4"/>
<textstyle name="algorithmic" begin="\begin{algorithmic}" end="\end{algorithmic}"/>
<textstyle name="definition" begin="\begin{definition}" end="\end{definition}"/>
<textstyle name="enumerate" begin="\begin{enumerate}" end="\end{enumerate}"/>
<textstyle name="example" begin="\begin{example}" end="\end{example}"/>
<textstyle name="lemma" begin="\begin{lemma}" end="\end{lemma}"/>
<textstyle name="proof" begin="\begin{proof}" end="\end{proof}"/>
<textstyle name="theorem" begin="\begin{theorem}" end="\end{theorem}"/>
<preamble>
\usepackage[ngerman]{babel}
\usepackage[sansdefault]{fontsetup}
\usepackage{ngutils}
\renewcommand{\theoremfont}{\normalfont\bfseries\color{dark blue}}
\renewcommand{\definitionfont}{\normalfont\bfseries\color{dark gray}}
\newcommand{\labelfont}{\normalfont\bfseries\color{dark blue}}
%\setlength{\leftmargini}{1.33em}
%\setlength{\leftmarginii}{1.33em}
%\setlength{\leftmarginiii}{1.33em}
%\setlength{\leftmarginvi}{1.33em}
\renewcommand{\labelenumi}{\labelfont\arabic{enumi}.}
\renewcommand{\labelenumii}{\labelfont\alph{enumii})}
\renewcommand{\labelenumiii}{\labelfont\roman{enumiii}.}
\renewcommand{\labelenumiv}{\labelfont\Alph{enumiv}.}
\renewcommand{\labelitemi}{\labelfont $\blockfull$}
\renewcommand{\labelitemii}{\labelfont $\blackpointerright$}
\renewcommand{\labelitemiii}{\labelfont $\bullet$}
\renewcommand{\labelitemiv}{\labelfont $\bullet$}
\setlength{\fboxsep}{1pt}
\newcommand{\bk}{\color{black}}
\newcommand{\wt}{\color{white}}
\newcommand{\bu}{\color{dark blue}}
\newcommand{\bn}{\color{dark brown}}
\newcommand{\cn}{\color{dark cyan}}
\newcommand{\gy}{\color{dark gray}}
\newcommand{\gn}{\color{dark green}}
\newcommand{\og}{\color{dark orange}}
\newcommand{\pk}{\color{dark pink}}
\newcommand{\pl}{\color{dark purple}}
\newcommand{\rd}{\color{dark red}}
\newcommand{\yo}{\color{dark yellow}}
\newcommand{\tl}{\color{title}}
</preamble>
<layout paper="1024 576" origin="16 16" frame="992 496" skip="16" crop="no"/>
<pagenumberstyle pos="1000 552" color="pagenumber" size="tiny" halign="right" valign="top"></pagenumberstyle>
<titlestyle pos="0 544" size="Large" color="title" valign="top"/>
</ipestyle>
<page>
<layer name="alpha"/>
<view layers="alpha" active="alpha"/>
<use layer="alpha" matrix="1 0 0 1 224 96" name="mark/disk(sx)" pos="256 320" size="normal" stroke="black"/>
<use matrix="1 0 0 1 0 96" name="mark/disk(sx)" pos="288 320" size="normal" stroke="black"/>
<use matrix="1 0 0 1 160 -160" name="mark/disk(sx)" pos="320 320" size="normal" stroke="black"/>
<use matrix="1 0 0 1 -160 -64" name="mark/disk(sx)" pos="352 320" size="normal" stroke="black"/>
<use matrix="1 0 0 1 0 -192" name="mark/disk(sx)" pos="384 320" size="normal" stroke="black"/>
<use matrix="1 0 0 1 -224 -192" name="mark/disk(sx)" pos="416 320" size="normal" stroke="black"/>
<use matrix="1 0 0 1 128 -192" name="mark/disk(sx)" pos="448 320" size="normal" stroke="black"/>
<use matrix="1 0 0 1 -288 64" name="mark/disk(sx)" pos="480 320" size="normal" stroke="black"/>
<use matrix="1 0 0 1 -32 32" name="mark/disk(sx)" pos="512 320" size="normal" stroke="black"/>
<use matrix="1 0 0 1 32 64" name="mark/disk(sx)" pos="544 320" size="normal" stroke="black"/>
<use matrix="1 0 0 1 -16 0" name="mark/disk(sx)" pos="400 384" size="normal" stroke="black"/>
<path stroke="black">
384 384 m
480 416 l
</path>
<path stroke="black">
384 384 m
288 416 l
</path>
<path stroke="black">
384 384 m
480 160 l
</path>
<path stroke="black">
384 384 m
192 256 l
</path>
<path stroke="black">
384 384 m
384 128 l
</path>
<path stroke="black">
384 384 m
192 128 l
</path>
<path stroke="black">
384 384 m
576 128 l
</path>
<path stroke="black">
384 384 m
192 384 l
</path>
<path stroke="black">
384 384 m
480 352 l
</path>
<path stroke="black">
384 384 m
576 384 l
</path>
<path stroke="black">
480 160 m
192 256 l
</path>
<path stroke="black">
480 160 m
384 128 l
</path>
<path stroke="black">
480 160 m
192 128 l
</path>
<path stroke="black">
480 160 m
576 128 l
</path>
<path stroke="black">
480 160 m
192 384 l
</path>
<path stroke="black">
480 160 m
480 352 l
</path>
<path stroke="black">
480 160 m
576 384 l
</path>
<path stroke="black">
384 128 m
192 128 l
</path>
<path stroke="black">
384 128 m
576 128 l
</path>
<path stroke="black">
384 128 m
192 384 l
</path>
<path stroke="black">
384 128 m
480 352 l
</path>
<path stroke="black">
384 128 m
576 384 l
</path>
<path stroke="black">
576 128 m
192 384 l
</path>
<path stroke="black">
576 128 m
480 352 l
</path>
<path stroke="black">
576 128 m
576 384 l
</path>
<path stroke="black">
480 352 m
576 384 l
</path>
<text matrix="1 0 0 1 -64 -24" transformations="translations" pos="352 448" stroke="black" type="label" width="8.8704" height="11.3472" depth="0" halign="center" valign="bottom" size="script" style="math">1</text>
<text matrix="1 0 0 1 128 -24" transformations="translations" pos="352 448" stroke="black" type="label" width="8.8704" height="11.3472" depth="0" halign="center" valign="bottom" size="script" style="math">1</text>
<text matrix="1 0 0 1 -160 -184" transformations="translations" pos="352 448" stroke="black" type="label" width="8.8704" height="11.3472" depth="0" halign="center" valign="bottom" size="script" style="math">2</text>
<text matrix="1 0 0 1 -160 -312" transformations="translations" pos="352 448" stroke="black" type="label" width="8.8704" height="11.3568" depth="0.36" halign="center" valign="bottom" size="script" style="math">3</text>
<text matrix="1 0 0 1 -160 -56" transformations="translations" pos="352 448" stroke="black" type="label" width="8.8704" height="10.98" depth="0" halign="center" valign="bottom" size="script" style="math">4</text>
<text matrix="1 0 0 1 128 -88" transformations="translations" pos="352 448" stroke="black" type="label" width="8.8704" height="10.9872" depth="0.36" halign="center" valign="bottom" size="script" style="math">5</text>
<text matrix="1 0 0 1 224 -56" transformations="translations" pos="352 448" stroke="black" type="label" width="8.8704" height="10.9872" depth="0.36" halign="center" valign="bottom" size="script" style="math">5</text>
<text matrix="1 0 0 1 128 -296" transformations="translations" pos="352 448" stroke="black" type="label" width="8.8704" height="11.3568" depth="0.36" halign="center" valign="top" size="script" style="math">8</text>
<text matrix="1 0 0 1 32 -328" transformations="translations" pos="352 448" stroke="black" type="label" width="8.8704" height="10.9968" depth="0.168" halign="center" valign="top" size="script" style="math">7</text>
<text matrix="1 0 0 1 224 -328" transformations="translations" pos="352 448" stroke="black" type="label" width="8.8704" height="11.3568" depth="0.36" halign="center" valign="top" size="script" style="math">6</text>
<text matrix="1 0 0 1 32 -56" transformations="translations" pos="352 448" stroke="black" type="label" width="17.7408" height="11.3568" depth="0.36" halign="center" valign="bottom" size="script" style="math">10</text>
</page>
<page>
<layer name="alpha"/>
<view layers="alpha" active="alpha"/>
<use layer="alpha" matrix="1 0 0 1 160 128" name="mark/disk(sx)" pos="256 320" size="normal" stroke="black"/>
<use matrix="1 0 0 1 32 96" name="mark/disk(sx)" pos="288 320" size="normal" stroke="black"/>
<use matrix="1 0 0 1 96 -256" name="mark/disk(sx)" pos="320 320" size="normal" stroke="black"/>
<use matrix="1 0 0 1 -96 32" name="mark/disk(sx)" pos="352 320" size="normal" stroke="black"/>
<use matrix="1 0 0 1 176 -208" name="mark/disk(sx)" pos="384 320" size="normal" stroke="black"/>
<use matrix="1 0 0 1 -192 -64" name="mark/disk(sx)" pos="416 320" size="normal" stroke="black"/>
<use matrix="1 0 0 1 160 -64" name="mark/disk(sx)" pos="448 320" size="normal" stroke="black"/>
<use matrix="1 0 0 1 -208 -208" name="mark/disk(sx)" pos="480 320" size="normal" stroke="black"/>
<use matrix="1 0 0 1 0 96" name="mark/disk(sx)" pos="512 320" size="normal" stroke="black"/>
<use matrix="1 0 0 1 32 32" name="mark/disk(sx)" pos="544 320" size="normal" stroke="black"/>
<use matrix="1 0 0 1 16 -128" name="mark/disk(sx)" pos="400 384" size="normal" stroke="black"/>
<path stroke="black">
416 256 m
416 448 l
</path>
<path stroke="black">
416 256 m
320 416 l
</path>
<path stroke="black">
416 256 m
416 64 l
</path>
<path stroke="black">
416 256 m
256 352 l
</path>
<path stroke="black">
416 256 m
560 112 l
</path>
<path stroke="black">
416 256 m
224 256 l
</path>
<path stroke="black">
416 256 m
608 256 l
</path>
<path stroke="black">
416 256 m
272 112 l
</path>
<path stroke="black">
416 256 m
512 416 l
</path>
<path stroke="black">
416 256 m
576 352 l
</path>
<path stroke="black">
416 64 m
256 352 l
</path>
<path stroke="black">
416 64 m
560 112 l
</path>
<path stroke="black">
416 64 m
224 256 l
</path>
<path stroke="black">
416 64 m
608 256 l
</path>
<path stroke="black">
416 64 m
272 112 l
</path>
<path stroke="black">
416 64 m
512 416 l
</path>
<path stroke="black">
416 64 m
576 352 l
</path>
<path stroke="black">
560 112 m
224 256 l
</path>
<path stroke="black">
560 112 m
608 256 l
</path>
<path stroke="black">
560 112 m
272 112 l
</path>
<path stroke="black">
560 112 m
512 416 l
</path>
<path stroke="black">
560 112 m
576 352 l
</path>
<path stroke="black">
608 256 m
272 112 l
</path>
<path stroke="black">
608 256 m
512 416 l
</path>
<path stroke="black">
608 256 m
576 352 l
</path>
<path stroke="black">
512 416 m
576 352 l
</path>
<text matrix="1 0 0 1 -64 -24" transformations="translations" pos="352 448" stroke="black" type="label" halign="center" valign="bottom" size="script" style="math">1</text>
<text matrix="1 0 0 1 128 -24" transformations="translations" pos="352 448" stroke="black" type="label" halign="center" valign="bottom" size="script" style="math">1</text>
<text matrix="1 0 0 1 -160 -184" transformations="translations" pos="352 448" stroke="black" type="label" halign="center" valign="bottom" size="script" style="math">2</text>
<text matrix="1 0 0 1 -160 -312" transformations="translations" pos="352 448" stroke="black" type="label" halign="center" valign="bottom" size="script" style="math">3</text>
<text matrix="1 0 0 1 -160 -56" transformations="translations" pos="352 448" stroke="black" type="label" halign="center" valign="bottom" size="script" style="math">4</text>
<text matrix="1 0 0 1 128 -88" transformations="translations" pos="352 448" stroke="black" type="label" halign="center" valign="bottom" size="script" style="math">5</text>
<text matrix="1 0 0 1 224 -56" transformations="translations" pos="352 448" stroke="black" type="label" halign="center" valign="bottom" size="script" style="math">5</text>
<text matrix="1 0 0 1 128 -296" transformations="translations" pos="352 448" stroke="black" type="label" halign="center" valign="top" size="script" style="math">8</text>
<text matrix="1 0 0 1 272 -184" transformations="translations" pos="352 448" stroke="black" type="label" halign="center" valign="top" size="script" style="math">7</text>
<text matrix="1 0 0 1 288 -320" transformations="translations" pos="352 448" stroke="black" type="label" halign="center" valign="top" size="script" style="math">6</text>
<text matrix="1 0 0 1 32 -56" transformations="translations" pos="352 448" stroke="black" type="label" halign="center" valign="bottom" size="script" style="math">10</text>
<path stroke="black">
416 256 m
416 64 l
</path>
</page>
<page>
<layer name="alpha"/>
<view layers="alpha" active="alpha"/>
<path layer="alpha" stroke="black" arrow="ng-normal/normal">
448 320 m
576 256 l
</path>
<path stroke="black" arrow="ng-normal/normal">
448 256 m
576 256 l
</path>
<path stroke="black" arrow="ng-normal/normal">
448 192 m
576 256 l
</path>
<path stroke="black" arrow="ng-normal/normal">
192 256 m
320 320 l
</path>
<path stroke="black" arrow="ng-normal/normal">
192 256 m
320 256 l
</path>
<path stroke="black" arrow="ng-normal/normal">
192 256 m
320 192 l
</path>
<path stroke="black" arrow="ng-normal/normal">
320 256 m
448 320 l
</path>
<path stroke="black" arrow="ng-normal/normal">
320 320 m
448 320 l
</path>
<path stroke="black" arrow="ng-normal/normal">
320 320 m
448 320 l
</path>
<path stroke="black" arrow="ng-normal/normal">
320 256 m
448 256 l
</path>
<path stroke="black" arrow="ng-normal/normal">
320 320 m
448 192 l
</path>
<path stroke="black" arrow="ng-normal/normal">
320 192 m
448 192 l
</path>
<path stroke="black" arrow="ng-normal/normal">
320 320 m
448 256 l
</path>
<use name="mark/disk(sx)" pos="192 256" size="normal" stroke="black"/>
<use name="mark/disk(sx)" pos="320 320" size="normal" stroke="dark blue"/>
<use name="mark/disk(sx)" pos="320 256" size="normal" stroke="dark blue"/>
<use name="mark/disk(sx)" pos="320 192" size="normal" stroke="dark blue"/>
<use name="mark/disk(sx)" pos="448 320" size="normal" stroke="dark orange"/>
<use name="mark/disk(sx)" pos="448 256" size="normal" stroke="dark orange"/>
<use name="mark/disk(sx)" pos="448 192" size="normal" stroke="dark orange"/>
<use name="mark/disk(sx)" pos="576 256" size="normal" stroke="black"/>
<text matrix="1 0 0 1 0 8" transformations="translations" pos="320 320" stroke="black" type="label" width="18.7176" height="8.5848" depth="4.728" halign="center" valign="bottom" size="footnote" style="math">v_1</text>
<text matrix="1 0 0 1 0 -56" transformations="translations" pos="320 320" stroke="black" type="label" width="18.7176" height="8.5848" depth="4.728" halign="center" valign="bottom" size="footnote" style="math">v_2</text>
<text matrix="1 0 0 1 4 -136" transformations="translations" pos="320 320" stroke="black" type="label" width="19.764" height="8.604" depth="4.824" halign="center" valign="top" size="footnote" style="math">v_n</text>
<text matrix="1 0 0 1 128 8" transformations="translations" pos="320 320" stroke="black" type="label" width="17.9904" height="8.8152" depth="4.728" halign="center" valign="bottom" size="footnote" style="math">e_1</text>
<text matrix="1 0 0 1 -128 -56" transformations="translations" pos="320 320" stroke="black" type="label" width="7.7664" height="8.8368" depth="0.192" halign="center" valign="bottom" size="footnote" style="math">s</text>
<text matrix="1 0 0 1 128 -56" transformations="translations" pos="320 320" stroke="black" type="label" width="17.9904" height="8.8152" depth="4.728" halign="center" valign="bottom" size="footnote" style="math">e_2</text>
<text matrix="1 0 0 1 128 -136" transformations="translations" pos="320 320" stroke="black" type="label" width="21.6624" height="8.8344" depth="4.824" halign="center" valign="top" size="footnote" style="math">e_m</text>
<text matrix="1 0 0 1 256 -56" transformations="translations" pos="320 320" stroke="black" type="label" width="8.34" height="10.9416" depth="0.192" halign="center" valign="bottom" size="footnote" style="math">t</text>
<text matrix="0.894704 0.446659 -0.446659 0.894704 112.622 -137.236" pos="320 320" stroke="black" type="label" width="33.0312" height="8.976" depth="3.984" halign="center" valign="bottom" size="tiny" style="math">B(v_1)</text>
<text matrix="0.894427 -0.447214 0.447214 0.894427 -73.1492 134.135" pos="256 224" stroke="black" type="label" width="33.9288" height="8.9664" depth="3.048" halign="center" valign="top" size="tiny" style="math">B(v_n)</text>
<text transformations="translations" pos="256 260" stroke="black" type="label" width="33.0312" height="8.976" depth="3.984" halign="center" valign="bottom" size="tiny" style="math">B(v_2)</text>
<text matrix="0.894427 -0.447214 0.447214 0.894427 186.851 218.135" pos="256 224" stroke="black" type="label" width="28.2504" height="8.976" depth="3.984" halign="center" valign="top" size="tiny" style="math">r(e_1)</text>
<text matrix="0.894704 0.446659 -0.446659 0.894704 368.622 -209.236" pos="320 320" stroke="black" type="label" width="31.6704" height="8.9664" depth="3.048" halign="center" valign="top" size="tiny" style="math">r(e_m)</text>
<text matrix="1 0 0 1 256 0" transformations="translations" pos="256 260" stroke="black" type="label" width="28.2504" height="8.976" depth="3.984" halign="center" valign="bottom" size="tiny" style="math">r(e_2)</text>
<text transformations="translations" pos="320 224" stroke="black" type="label" width="5.3184" height="10.98" depth="1.32" halign="center" valign="center" size="footnote" style="math">\vdots</text>
<text matrix="1 0 0 1 128 0" transformations="translations" pos="320 224" stroke="black" type="label" width="5.3184" height="10.98" depth="1.32" halign="center" valign="center" size="footnote" style="math">\vdots</text>
</page>
</ipe>

71
übung_4/ngexrcs.cls Normal file
View file

@ -0,0 +1,71 @@
% 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}
\setlength{\marginparwidth}{1.5\marginparwidth}
\setlength{\fboxrule}{\heavyrulewidth}
% Use sansfont for all title elements
\addtokomafont{titlehead}{\sffamily}
\addtokomafont{subject}{\normalfont \sffamily \itshape}
\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][\quad]{\marginline{\framebox{{\usekomafont{points}#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}

124
übung_4/ngutils.sty Normal file
View file

@ -0,0 +1,124 @@
\NeedsTeXFormat{LaTeX2e}
\ProvidesPackage{ngutils}[2025/12/24 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={, 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{\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{\Pe}{\mathrm{P}}
\newcommand{\NPe}{\mathrm{NP}}
\newcommand{\Oh}{\mathcal{O}}
\newcommand{\oh}{\scriptstyle{\mathcal{O}}}
\newcommand{\Eh}{\mathop{\mathrm{E}}}
\newcommand{\Var}{\mathop{\mathrm{Var}}}
\newcommand{\pot}{\mathop{\mathcal{P}}}
\newcommand{\argmax}{\mathop{\mathrm{arg\,max}}}
\newcommand{\argmin}{\mathop{\mathrm{arg\,min}}}
\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{\tup}[1]{\parens{#1}}
\newcommand{\ivl}[1]{\brackets{#1}}
\newcommand{\set}[1]{\braces{#1}}
\newcommand{\arr}[1]{\angled{#1}}
\newcommand{\abs}[1]{\lvert#1\rvert}
\newcommand{\norm}[1]{\lVert#1\rVert}
\newcommand{\ceil}[1]{\lceil#1\rceil}
\newcommand{\floor}[1]{\lfloor#1\rfloor}
\newcommand{\alg}[2]{{\normalfont\scshape#1}{\normalfont(#2)}}
\newcommand{\algt}[1]{{\normalfont\scshape#1}}
\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}
}
\newlength{\theoremskip}
\setlength{\theoremskip}{6em}
\newcommand{\theoremfont}{\normalfont\bfseries}
\newcommand{\definitionfont}{\normalfont\bfseries}
\newenvironment{theoremic}[2][\theoremfont]{
{#1 #2}
\hfill
\begin{minipage}[t]{\the\dimexpr\linewidth-\theoremskip\relax}
}{
\end{minipage}
}
\newenvironment{theorem}{
\begin{theoremic}{Satz.}
}{
\end{theoremic}
}
\newenvironment{lemma}{
\begin{theoremic}{Lemma.}
}{
\end{theoremic}
}
\newenvironment{proof}{
\begin{theoremic}{Beweis.}
}{
\end{theoremic}
}
\newenvironment{definition}{
\begin{theoremic}[\definitionfont]{Definition.}
}{
\end{theoremic}
}
\newenvironment{example}{
\begin{theoremic}[\definitionfont]{Beispiel.}
}{
\end{theoremic}
}