mirror of
https://github.com/2martens/uni.git
synced 2026-05-06 11:26:25 +02:00
Compare commits
11 Commits
gdb_blatt_
...
opti_blatt
| Author | SHA1 | Date | |
|---|---|---|---|
| dad77a8dff | |||
| d013e0533e | |||
| 5bdf5a2487 | |||
| f5e1a36683 | |||
| 6507d7a749 | |||
| eb6256a57f | |||
| a324b8291d | |||
| 6afc457d64 | |||
| f768bb15bf | |||
| f589ab47c7 | |||
| 2b0d06f6ea |
1
.gitignore
vendored
1
.gitignore
vendored
@ -26,6 +26,7 @@
|
||||
*.pdf
|
||||
*.pdfsync
|
||||
*.ps
|
||||
*.pyg
|
||||
*.snm
|
||||
*.synctex.gz
|
||||
*.toc
|
||||
|
||||
@ -14,6 +14,7 @@
|
||||
\usepackage{tikz}
|
||||
\usepackage{algorithm}
|
||||
\usepackage{algorithmic}
|
||||
\usepackage{minted}
|
||||
\usetikzlibrary{automata,matrix,fadings,calc,positioning,decorations.pathreplacing,arrows,decorations.markings}
|
||||
\usepackage{polynom}
|
||||
\polyset{style=C, div=:,vars=x}
|
||||
@ -40,9 +41,8 @@ Jim Martens (6420323)}
|
||||
|
||||
\section{} %1
|
||||
Dieser folgende Pseudocode beschreibt eine leichte Abänderung, die vorzeitig abbricht, wenn sich nach einem kompletten Durchlauf aller Kanten nichts geändert hat. Nach $m$ Durchläufen hat der Algorithmus alle kürzeste Pfade mit maximal $m$ Kanten entdeckt. In einem weiteren Durchlauf wird sich dann nichts mehr ändern, da keine neuen kürzesten Pfade mehr gefunden werden können, wodurch die geänderte Variante abbricht. Um die Abbruchbedingung zu erreichen muss $m$ nicht bekannt sein, da nach $m+1$ Durchläufen die Abbruchbedingung immer gegeben ist.
|
||||
|
||||
\begin{verbatim}
|
||||
function BellmanFord(G,s)
|
||||
\begin{minted}{python}
|
||||
function BellmanFord(G,s)
|
||||
InitializeSingleSource(G,s)
|
||||
for i = 1, ... |V| - 1
|
||||
changed = false
|
||||
@ -56,16 +56,40 @@ Jim Martens (6420323)}
|
||||
if v.dist > u.dist + w(u,v)
|
||||
return false
|
||||
return true
|
||||
\end{verbatim}
|
||||
\end{minted}
|
||||
% \begin{verbatim}
|
||||
% function BellmanFord(G,s)
|
||||
% InitializeSingleSource(G,s)
|
||||
% for i = 1, ... |V| - 1
|
||||
% changed = false
|
||||
% for all edges (u,v) in E
|
||||
% changedTmp = Relax(u,v)
|
||||
% if (!changed)
|
||||
% changed = changedTmp
|
||||
% if (!changed)
|
||||
% break
|
||||
% for all edges (u,v) in E
|
||||
% if v.dist > u.dist + w(u,v)
|
||||
% return false
|
||||
% return true
|
||||
% \end{verbatim}
|
||||
\section{} %2
|
||||
\begin{verbatim}
|
||||
function DAG-SP(G,s)
|
||||
\begin{minted}{python}
|
||||
function DAG-SP(G,s)
|
||||
sort vertices topologically
|
||||
InitializeSingleSource(G,s)
|
||||
for each u in V in topological sort order
|
||||
for each v in Adj(u)
|
||||
Relax(u,v)
|
||||
\end{verbatim}
|
||||
\end{minted}
|
||||
% \begin{verbatim}
|
||||
% function DAG-SP(G,s)
|
||||
% sort vertices topologically
|
||||
% InitializeSingleSource(G,s)
|
||||
% for each u in V in topological sort order
|
||||
% for each v in Adj(u)
|
||||
% Relax(u,v)
|
||||
% \end{verbatim}
|
||||
\section{} %3
|
||||
Wir wissen, dass der Dijkstra-Algorithmus für rein positive Kantengewichte funktioniert. Es bleibt also nur zu zeigen, dass die kürzesten Wege zu den Knoten korrekt berechnet werden, die eine Kante von dem Startknoten entfernt sind. Ferner ist bekannt, dass Dijkstra zuerst den Knoten besucht, der am billigsten zu erreichen ist. Damit geht der Algorithmus die Kante mit dem kleinsten Gewicht zu erst (einschließlich negative Gewichte). Der somit erreichte Knoten kann also gar nicht billiger zu erreichen sein, da jeder andere Pfad dorthin aus mindestens zwei Kanten besteht, die zusammen bestenfalls das gleiche Gewicht haben wie die gegangene Kante.
|
||||
|
||||
@ -76,29 +100,201 @@ Jim Martens (6420323)}
|
||||
|
||||
In Pseudocode sieht das dann so aus:
|
||||
|
||||
\begin{verbatim}
|
||||
function berechneDurchmesser(G)
|
||||
\begin{minted}{python}
|
||||
function berechneDurchmesser(G)
|
||||
longestPath = 0
|
||||
current = G.wurzel
|
||||
current = G.root
|
||||
queue.enqueue(current.getChilds())
|
||||
while (!empty(queue))
|
||||
current = queue.dequeue()
|
||||
parent = current.parent
|
||||
// wähle eines von beiden, abhängig davon,
|
||||
// ob die Länge sich auf die Kanten oder die Gewichtungen bezieht (TBD)
|
||||
distance = parent.getDistance() + w(parent,current)
|
||||
distance = parent.getDistance() + 1
|
||||
current.setDistance(distance)
|
||||
if (distance > longestPath)
|
||||
longestPath = distance
|
||||
|
||||
childs = current.getChilds()
|
||||
if (!empty(childs))
|
||||
queue.enqueue(current.getChilds())
|
||||
\end{verbatim}
|
||||
\subsection{} %b
|
||||
\end{minted}
|
||||
% \begin{verbatim}
|
||||
% function berechneDurchmesser(G)
|
||||
% longestPath = 0
|
||||
% current = G.root
|
||||
% queue.enqueue(current.getChilds())
|
||||
% while (!empty(queue))
|
||||
% current = queue.dequeue()
|
||||
% parent = current.parent
|
||||
% distance = parent.getDistance() + w(parent,current)
|
||||
% current.setDistance(distance)
|
||||
% if (distance > longestPath)
|
||||
% longestPath = distance
|
||||
|
||||
% childs = current.getChilds()
|
||||
% if (!empty(childs))
|
||||
% queue.enqueue(current.getChilds())
|
||||
% \end{verbatim}
|
||||
\subsection{} %b
|
||||
\begin{minted}{python}
|
||||
def Durchmesser(G):
|
||||
laengsterWeg = 0
|
||||
for v1 in G.kanten:
|
||||
for v2 in G.kanten with v1 != v2:
|
||||
P = findeKuerzestenWeg(v1, v2)
|
||||
if P.laenge() > laengsterWeg:
|
||||
laengsterWeg = P.laenge()
|
||||
return laengsterWeg
|
||||
\end{minted}
|
||||
% \begin{verbatim}
|
||||
% Diam(G)
|
||||
% longestPath = 0
|
||||
% for each v1 in G.vertices
|
||||
% for each v2 in G.vertices with v1 != v2
|
||||
% find shortest path P from v1 to v2
|
||||
% if P.length > longestPath
|
||||
% longestPath = P.length
|
||||
% return longestPath
|
||||
% \end{verbatim}
|
||||
|
||||
Die Laufzeit dieses Algorithmus beträgt $\mathcal{O}(|V|^3)$.
|
||||
\section{} %5
|
||||
\subsection{} %a
|
||||
Man konstruiert einen vollständigen Graphen aus der Matrix, in welchem die Knoten Währungen repräsentieren, und als Kantengewichte die Werte verwendet werden.
|
||||
Gibt es nun in diesem Graphen einen Zyklus, in dem das Produkt aller Kantengewichte ungleich 1 ist, existiert Währungsarbitrage. Ansonsten ist dies nicht der Fall.
|
||||
\subsection{} %b
|
||||
Nein, unsere Lösung kann nicht zu negativen Zyklen führen, denn dafür müssten negative Werte in der Matrix vorhanden sein.
|
||||
Würden solche Zyklen existieren, bedeuteten sie, man verliere all sein Geld bei einem Tausch, und müsste außerdem eine Strafe zahlen.
|
||||
\section{} %6
|
||||
\begin{tikzpicture}[shorten >=1pt,node distance=1.1cm]
|
||||
\node[state] (s) {s};
|
||||
\node[state] (a) [above right=1.5 and 1.0 of s] {A};
|
||||
\node[state] (b) [below right=1.5 and 1.0 of s] {B};
|
||||
\node[state] (d) [above right=1.0 and 1.0 of a] {D};
|
||||
\node[state] (c) [right=of a] {C};
|
||||
\node[state] (f) [below right=1.0 and 1.25 of a] {F};
|
||||
\node[state] (e) [right=1.0 of c] {E};
|
||||
\node[state] (g) [right=of f] {G};
|
||||
|
||||
\path[every node/.style={font=\scriptsize},->]
|
||||
(s) edge node [above] {30} (a)
|
||||
(s) edge node [below] {18} (b)
|
||||
(a) edge node [above] {21} (c)
|
||||
(a) edge node [above] {38} (d)
|
||||
(a) edge node [below] {22} (f)
|
||||
(c) edge node [right] {22} (f)
|
||||
(c) edge node [above] {20} (e)
|
||||
(f) edge node [above] {9} (g)
|
||||
(b) edge node [left] {30} (a);
|
||||
\end{tikzpicture}
|
||||
|
||||
Da dies ein gerichteter Graph ohne Zyklen ist und auch keine negativen Kantengewichte vorkommen, kann der Dijkstra-Algorithmus angewendet werden. Da von 9 bis 17 Uhr Fahrer bezahlt werden müssen, kommen nur die Pfade in Betrachtung, die zu einer Senke führen. Senken sind D, E und G. Derjenige dieser Knoten welcher als erster vom Algorithmus gefunden wird (über den eindeutig bestimmbaren Weg), ist auch der kürzeste Pfad vom Startknoten aus, der die Bedingungen erfüllt.
|
||||
|
||||
Es ergibt sich folgende Abfolge:
|
||||
\begin{verbatim}
|
||||
S = {s}
|
||||
d(s) = 0
|
||||
while 1.
|
||||
U = {A, B}
|
||||
for all u in U -> u = A
|
||||
for all pre(u) in S that are predecessors of u -> pre(u) = s
|
||||
d'(u, pre(u)) = d(pre(u)) + w(pre(u), u)
|
||||
d'(u, pre(u)) = 0 + 30
|
||||
for all u in U -> u = B
|
||||
for all pre(u) in S that are predecessors of u -> pre(u) = s
|
||||
d'(u, pre(u)) = d(pre(u)) + w(pre(u), u)
|
||||
d'(u, pre(u)) = 0 + 18
|
||||
u* = B
|
||||
d(u*) = 18
|
||||
S = {s, B}
|
||||
while 2.
|
||||
U = {A}
|
||||
for all u in U -> u = A
|
||||
for all pre(u) in S that are predecessors of u -> pre(u) = s
|
||||
d'(u, pre(u)) = d(pre(u)) + w(pre(u), u)
|
||||
d'(u, pre(u)) = 0 + 30
|
||||
for all pre(u) in S that are predecessors of u -> pre(u) = B
|
||||
d'(u, pre(u)) = d(pre(u)) + w(pre(u), u)
|
||||
d'(u, pre(u)) = 18 + 30
|
||||
u* = A
|
||||
d(u*) = 30
|
||||
S = {S, B, A}
|
||||
while 3.
|
||||
U = {D, C, F}
|
||||
for all u in U -> u = D
|
||||
for all pre(u) in S that are predecessors of u -> pre(u) = A
|
||||
d'(u, pre(u)) = d(pre(u)) + w(pre(u), u)
|
||||
d'(u, pre(u)) = 30 + 38
|
||||
for all u in U -> u = C
|
||||
for all pre(u) in S that are predecessors of u -> pre(u) = A
|
||||
d'(u, pre(u)) = d(pre(u)) + w(pre(u), u)
|
||||
d'(u, pre(u)) = 30 + 21
|
||||
for all u in U -> u = F
|
||||
for all pre(u) in S that are predecessors of u -> pre(u) = A
|
||||
d'(u, pre(u)) = d(pre(u)) + w(pre(u), u)
|
||||
d'(u, pre(u)) = 30 + 22
|
||||
u* = C
|
||||
d(u*) = 51
|
||||
S = {s, B, A, C}
|
||||
while 4.
|
||||
U = {D, F, E}
|
||||
for all u in U -> u = D
|
||||
for all pre(u) in S that are predecessors of u -> pre(u) = A
|
||||
d'(u, pre(u)) = d(pre(u)) + w(pre(u), u)
|
||||
d'(u, pre(u)) = 30 + 38
|
||||
for all u in U -> u = F
|
||||
for all pre(u) in S that are predecessors of u -> pre(u) = A
|
||||
d'(u, pre(u)) = d(pre(u)) + w(pre(u), u)
|
||||
d'(u, pre(u)) = 30 + 22
|
||||
for all pre(u) in S that are predecessors of u -> pre(u) = C
|
||||
d'(u, pre(u)) = d(pre(u)) + w(pre(u), u)
|
||||
d'(u, pre(u)) = 51 + 22
|
||||
for all u in U -> u = E
|
||||
for all pre(u) in S that are predecessors of u -> pre(u) = C
|
||||
d'(u, pre(u)) = d(pre(u)) + w(pre(u), u)
|
||||
d'(u, pre(u)) = 51 + 20
|
||||
u* = F
|
||||
d(u*) = 52
|
||||
S = {s, B, A, C, F}
|
||||
while 5.
|
||||
U = {D, E, G}
|
||||
for all u in U -> u = D
|
||||
for all pre(u) in S that are predecessors of u -> pre(u) = A
|
||||
d'(u, pre(u)) = d(pre(u)) + w(pre(u), u)
|
||||
d'(u, pre(u)) = 30 + 38
|
||||
for all u in U -> u = E
|
||||
for all pre(u) in S that are predecessors of u -> pre(u) = C
|
||||
d'(u, pre(u)) = d(pre(u)) + w(pre(u), u)
|
||||
d'(u, pre(u)) = 51 + 20
|
||||
for all u in U -> u = G
|
||||
for all pre(u) in S that are predecessors of u -> pre(u) = F
|
||||
d'(u, pre(u)) = d(pre(u)) + w(pre(u), u)
|
||||
d'(u, pre(u)) = 52 + 9
|
||||
u* = G
|
||||
d(u*) = 61
|
||||
S = {s, B, A, C, F, G}
|
||||
while 6.
|
||||
U = {D, E}
|
||||
for all u in U -> u = D
|
||||
for all pre(u) in S that are predecessors of u -> pre(u) = A
|
||||
d'(u, pre(u)) = d(pre(u)) + w(pre(u), u)
|
||||
d'(u, pre(u)) = 30 + 38
|
||||
for all u in U -> u = E
|
||||
for all pre(u) in S that are predecessors of u -> pre(u) = C
|
||||
d'(u, pre(u)) = d(pre(u)) + w(pre(u), u)
|
||||
d'(u, pre(u)) = 51 + 22
|
||||
u* = D
|
||||
d(u*) = 68
|
||||
S = {s, B, A, C, F, G, D}
|
||||
while 7.
|
||||
U = {E}
|
||||
for all u in U -> u = E
|
||||
for all pre(u) in S that are predecessors of u -> pre(u) = C
|
||||
d'(u, pre(u)) = d(pre(u)) + w(pre(u), u)
|
||||
d'(u, pre(u)) = 51 + 20
|
||||
u* = E
|
||||
d(u*) = 71
|
||||
S = {s, B, A, C, F, G, D, E}
|
||||
\end{verbatim}
|
||||
|
||||
Wie zu sehen ist wird die Senke G zuerst erreicht. Folgt man dem Weg zu G, so ergibt sich, dass der kürzeste Pfad von s über A und F nach G führt. Weniger Kosten als 61 sind daher nicht möglich.
|
||||
\end{document}
|
||||
|
||||
117
optimierung/Uebungsblatt10.tex
Normal file
117
optimierung/Uebungsblatt10.tex
Normal file
@ -0,0 +1,117 @@
|
||||
\documentclass[10pt,a4paper,oneside,ngerman,numbers=noenddot]{scrartcl}
|
||||
\usepackage[T1]{fontenc}
|
||||
\usepackage[utf8]{inputenc}
|
||||
\usepackage[ngerman]{babel}
|
||||
\usepackage{amsmath}
|
||||
\usepackage{amsfonts}
|
||||
\usepackage{amssymb}
|
||||
\usepackage{paralist}
|
||||
\usepackage{gauss}
|
||||
\usepackage{pgfplots}
|
||||
\usepackage[locale=DE,exponent-product=\cdot,detect-all]{siunitx}
|
||||
\usepackage{tikz}
|
||||
\usetikzlibrary{matrix,fadings,calc,positioning,decorations.pathreplacing,arrows,decorations.markings}
|
||||
\usepackage{polynom}
|
||||
\usepackage{multirow}
|
||||
\polyset{style=C, div=:,vars=x}
|
||||
\pgfplotsset{compat=1.8}
|
||||
\pagenumbering{arabic}
|
||||
% ensures that paragraphs are separated by empty lines
|
||||
\parskip 12pt plus 1pt minus 1pt
|
||||
\parindent 0pt
|
||||
% define how the sections are rendered
|
||||
\def\thesection{\arabic{section})}
|
||||
\def\thesubsection{\alph{subsection})}
|
||||
\def\thesubsubsection{(\roman{subsubsection})}
|
||||
% some matrix magic
|
||||
\makeatletter
|
||||
\renewcommand*\env@matrix[1][*\c@MaxMatrixCols c]{%
|
||||
\hskip -\arraycolsep
|
||||
\let\@ifnextchar\new@ifnextchar
|
||||
\array{#1}}
|
||||
\makeatother
|
||||
|
||||
\begin{document}
|
||||
\author{Jan Branitz (6326955), Jim Martens (6420323),\\
|
||||
Stephan Niendorf (6242417)}
|
||||
\title{Hausaufgaben zum 6. Januar}
|
||||
\maketitle
|
||||
\section{} %1
|
||||
\section{} %2
|
||||
\subsection{} %a
|
||||
\begin{alignat*}{9}
|
||||
\text{minimiere}\; & 67w &+& 120k &+& 100h &+& 60f &+& 97b &+& 124n &+& 22s &+& 62m && \\
|
||||
\multicolumn{18}{l}{\text{unter den Nebenbedingungen}} && \\
|
||||
& 8w &+& 25k &+& 30h &+& 22f &+& 3b &+& 8n &+& 6s && &\geq &\, 75 \\
|
||||
& w &+& 35k &+& 8h &+& f && &+& 33n &+& 13s &+& 98m &\geq &\, 90 \\
|
||||
& 54w && && && &+& 42b &+& 4n &+& 63s && &\geq &\, 300 \\
|
||||
\multicolumn{16}{r}{$w, k, h, f, b, n, s, m$} \,&\geq &\, 0
|
||||
\end{alignat*}
|
||||
\subsection{} %b
|
||||
In das verlinkte Tool wird folgendes eingegeben:
|
||||
\begin{verbatim}
|
||||
Minimize p = 67w + 120k + 100h + 60f + 97b + 124n + 22s + 62m subject to
|
||||
8w + 25k + 30h + 22f + 3b + 8n + 6s + 0m >= 75
|
||||
w + 35k + 8h + f + 0b + 33n + 13s + 98m >= 90
|
||||
54w + 0k + 0h + 0f + 42b + 4n + 63s + 0m >= 300
|
||||
w >= 0
|
||||
k >= 0
|
||||
h >= 0
|
||||
f >= 0
|
||||
b >= 0
|
||||
n >= 0
|
||||
s >= 0
|
||||
m >= 0
|
||||
\end{verbatim}
|
||||
Die Ausgabe ist:
|
||||
\begin{verbatim}
|
||||
Optimal Solution: p = 6801/28; w = 0, k = 0, h = 0, f = 87/56,
|
||||
b = 0, n = 0, s = 381/56, m = 0
|
||||
\end{verbatim}
|
||||
\subsection{} %c
|
||||
In das verlinkte Tool wird folgendes eingegeben:
|
||||
\begin{verbatim}
|
||||
Minimize p = 3x1 + 24x2 + 13x3 + 9x4 + 20x5 + 19x6 subject to
|
||||
110x1 + 205x2 + 160x3 + 160x3 + 420x5 + 260x6 >= 2000
|
||||
4x1 + 32x2 + 13x3 + 8x4 + 4x5 + 14x6 >= 55
|
||||
2x1 + 12x2 + 54x3 + 285x4 + 22x5 + 80x6 >= 800
|
||||
x1 <= 4
|
||||
x2 <= 3
|
||||
x3 <= 2
|
||||
x4 <= 8
|
||||
x5 <= 2
|
||||
x6 <= 2
|
||||
x1 >= 0
|
||||
x2 >= 0
|
||||
x3 >= 0
|
||||
x4 >= 0
|
||||
x5 >= 0
|
||||
x6 >= 0
|
||||
\end{verbatim}
|
||||
Die Ausgabe ist:
|
||||
\begin{verbatim}
|
||||
Optimal Solution: p = 46621/380; x1 = 4, x2 = 0, x3 = 5/4,
|
||||
x4 = 347/190, x5 = 2, x6 = 2
|
||||
\end{verbatim}
|
||||
\subsection{} %d
|
||||
In das verlinkte Tool wird folgendes eingegeben:
|
||||
\begin{verbatim}
|
||||
Maximize p = 8a1 + 3a2 + 6b1 + 3b2 + 9c1 + 5c2 subject to
|
||||
a1 + a2 <= 400
|
||||
b1 + b2 <= 480
|
||||
c1 + c2 <= 230
|
||||
a1 + b1 + c1 <= 420
|
||||
a2 + b2 + c2 <= 250
|
||||
a1 >= 0
|
||||
a2 >= 0
|
||||
b1 >= 0
|
||||
b2 >= 0
|
||||
c1 >= 0
|
||||
c2 >= 0
|
||||
\end{verbatim}
|
||||
Die Ausgabe ist:
|
||||
\begin{verbatim}
|
||||
Optimal Solution: p = 4550; a1 = 400, a2 = 0, b1 = 0, b2 = 40,
|
||||
c1 = 20, c2 = 210
|
||||
\end{verbatim}
|
||||
\end{document}
|
||||
@ -117,8 +117,8 @@ Stephan Niendorf (6242417)}
|
||||
\frac{4}{5}x_{1} \,&=&&\, 20 + \frac{1}{50}x_{4} - x_{3} \\
|
||||
x_{1} \,&=&&\, 25 + \frac{1}{40}x_{4} - \frac{5}{4}x_{3} \\
|
||||
x_{2} \,&=&&\, 80 - \frac{1}{5}\left(25 + \frac{1}{40}x_{4} - \frac{5}{4}x_{3}\right) - \frac{1}{50}x_{4} \\
|
||||
&=&&\, 80 - 5 + \frac{1}{200}x_{4} - \frac{1}{4}x_{3} - \frac{1}{50}x_{4} \\
|
||||
&=&&\, 75 - \frac{3}{200}x_{4} - \frac{1}{4}x_{3} \\
|
||||
&=&&\, 80 - 5 - \frac{1}{200}x_{4} + \frac{1}{4}x_{3} - \frac{1}{50}x_{4} \\
|
||||
&=&&\, 75 - \frac{1}{40}x_{4} + \frac{1}{4}x_{3} \\
|
||||
z \,&=&&\, 5600 + 26\left(25 + \frac{1}{40}x_{4} - \frac{5}{4}x_{3}\right) - \frac{7}{5}x_{4} \\
|
||||
&=&&\, 5600 + 650 + \frac{13}{20}x_{4} - \frac{65}{2}x_{3} - \frac{7}{5}x_{4} \\
|
||||
&=&&\, 6250 - \frac{3}{4}x_{4} - \frac{65}{2}x_{3}
|
||||
@ -127,7 +127,7 @@ Stephan Niendorf (6242417)}
|
||||
\underline{Ergebnis der 2. Iteration}:
|
||||
\begin{alignat*}{4}
|
||||
x_{1} \,&=&\, 25 \,&-&\, \frac{1}{40}x_{4} \,&-&\, \frac{5}{4}x_{3} \\
|
||||
x_{2} \,&=&\, 75 \,&-&\, \frac{3}{200}x_{4} \,&-&\, \frac{1}{4}x_{3} \\ \cline{1 - 7}
|
||||
x_{2} \,&=&\, 75 \,&-&\, \frac{1}{40}x_{4} \,&+&\, \frac{1}{4}x_{3} \\ \cline{1 - 7}
|
||||
z &=& 6250 \,&-&\, \frac{3}{4}x_{4} \,&-&\, \frac{65}{2}x_{3}
|
||||
\end{alignat*}
|
||||
|
||||
@ -242,8 +242,8 @@ Stephan Niendorf (6242417)}
|
||||
\frac{4}{5}x_{1} \,&=&&\, 20 - \frac{1}{50}t + \frac{1}{50}x_{4} - x_{3} \\
|
||||
x_{1} \,&=&&\, 25 - \frac{1}{40}t + \frac{1}{40}x_{4} - \frac{5}{4}x_{3} \\
|
||||
x_{2} \,&=&&\, 80 + \frac{1}{50}t - \frac{1}{5}\left(25 - \frac{1}{40}t + \frac{1}{40}x_{4} - \frac{5}{4}x_{3}\right) - \frac{1}{50}x_{4} \\
|
||||
&=&&\, 80 + \frac{1}{50}t - 5 + \frac{1}{200}t - \frac{1}{200}x_{4} - \frac{1}{4}x_{3} - \frac{1}{50}x_{4} \\
|
||||
&=&&\, 75 + \frac{1}{40}t - \frac{1}{40}x_{4} - \frac{1}{4}x_{3} \\
|
||||
&=&&\, 80 + \frac{1}{50}t - 5 + \frac{1}{200}t - \frac{1}{200}x_{4} + \frac{1}{4}x_{3} - \frac{1}{50}x_{4} \\
|
||||
&=&&\, 75 + \frac{1}{40}t - \frac{1}{40}x_{4} + \frac{1}{4}x_{3} \\
|
||||
z \,&=&&\, 5600 + \frac{7}{5}t + 26\left(25 - \frac{1}{40}t + \frac{1}{40}x_{4} - \frac{5}{4}x_{3}\right) - \frac{7}{5}x_{4} \\
|
||||
&=&&\, 5600 + \frac{7}{5}t + 650 - \frac{13}{20}t + \frac{13}{20}x_{4} - \frac{65}{2}x_{3} - \frac{7}{5}x_{4} \\
|
||||
&=&&\, 6250 + \frac{3}{4}t - \frac{3}{4}x_{4} - \frac{65}{2}x_{3}
|
||||
@ -251,8 +251,8 @@ Stephan Niendorf (6242417)}
|
||||
|
||||
\underline{Ergebnis der 2. Iteration}:
|
||||
\begin{alignat*}{4}
|
||||
x_{1} \,&=&\, 25 - \frac{1}{40}t \,&-&\, \frac{1}{40}x_{4} \,&-&\, \frac{5}{4}x_{3} \\
|
||||
x_{2} \,&=&\, 75 + \frac{1}{40}t \,&-&\, \frac{1}{40}x_{4} \,&-&\, \frac{1}{4}x_{3} \\ \cline{1 - 7}
|
||||
x_{1} \,&=&\, 25 - \frac{1}{40}t \,&+&\, \frac{1}{40}x_{4} \,&-&\, \frac{5}{4}x_{3} \\
|
||||
x_{2} \,&=&\, 75 + \frac{1}{40}t \,&-&\, \frac{1}{40}x_{4} \,&+&\, \frac{1}{4}x_{3} \\ \cline{1 - 7}
|
||||
z &=& 6250 + \frac{3}{4}t \,&-&\, \frac{3}{4}x_{4} \,&-&\, \frac{65}{2}x_{3}
|
||||
\end{alignat*}
|
||||
|
||||
|
||||
@ -99,123 +99,65 @@ Stephan Niendorf (6242417)}
|
||||
Also gilt $y^{T} = \begin{pmatrix} 0 & 0 & 0 \end{pmatrix}$.
|
||||
|
||||
\textbf{2. Schritt} (Bestimmung der Eingangsspalte a und gleichzeitig der Eingangsvariablen):\\
|
||||
Es gilt $A_{N} = \begin{pmatrix} x_{1} & x_{2} \\ 1 & -4 \\ 1 & 0 \\ 0 & 1 \end{pmatrix},\; y^{T}A_{N} = \begin{pmatrix} 0 & 0 \end{pmatrix}$ und $c_{N}^{T} = \begin{pmatrix} 2 & 3 \end{pmatrix}$. Also kommt jede Spalte von $A_{N}$ als Eingangsspalte a infrage, wir wählen $a = \begin{pmatrix} 1 \\ 1 \\ 0 \end{pmatrix}$; die Eingangsvariable ist $x_{1}$.
|
||||
Es gilt $A_{N} = \begin{pmatrix} x_{1} & x_{2} \\ 1 & -4 \\ 1 & 0 \\ 0 & 1 \end{pmatrix},\; y^{T}A_{N} = \begin{pmatrix} 0 & 0 \end{pmatrix}$ und $c_{N}^{T} = \begin{pmatrix} 2 & 3 \end{pmatrix}$. Also kommt jede Spalte von $A_{N}$ als Eingangsspalte a infrage, wir wählen $a = \begin{pmatrix} -4 \\ 0 \\ 1 \end{pmatrix}$; die Eingangsvariable ist $x_{2}$.
|
||||
|
||||
\textbf{3. Schritt} (Lösung von $Bd = a$):\\
|
||||
Das Gleichungssystem $Bd = a$ lautet
|
||||
\begin{alignat*}{3}
|
||||
d_{1} & & &=& 1 \\
|
||||
& d_{2} & &=& 1 \\
|
||||
& & d_{3} &=& 0
|
||||
d_{1} & & &=& -4 \\
|
||||
& d_{2} & &=& 0 \\
|
||||
& & d_{3} &=& 1
|
||||
\end{alignat*}
|
||||
Es folgt $d = \begin{pmatrix}1 \\ 1 \\ 0 \end{pmatrix}$.
|
||||
Es folgt $d = \begin{pmatrix}-4 \\ 0 \\ 1 \end{pmatrix}$.
|
||||
|
||||
\textbf{4. Schritt} (Bestimmung der Ausgangsvariablen):\\
|
||||
Die Ungleichung $x_{B}^{*} - td \geq 0$ lautet $\begin{pmatrix} 2 \\ 5 \\ 8\end{pmatrix} - t \begin{pmatrix}1 \\ 1 \\ 0 \end{pmatrix} \geq \begin{pmatrix} 0 \\ 0 \\ 0 \end{pmatrix}$. Das größte t, das dies erfüllt, ist $t = 2$; für $t = 2$ gilt $\begin{pmatrix} 2 \\ 5 \\ 8\end{pmatrix} - t \begin{pmatrix}1 \\ 1 \\ 0 \end{pmatrix} = \begin{pmatrix} 0 \\ 3 \\ 8 \end{pmatrix}$, Ausgangsvariable ist $x_{3}$.
|
||||
Die Ungleichung $x_{B}^{*} - td \geq 0$ lautet $\begin{pmatrix} 2 \\ 5 \\ 8\end{pmatrix} - t \begin{pmatrix}-4 \\ 0 \\ 1 \end{pmatrix} \geq \begin{pmatrix} 0 \\ 0 \\ 0 \end{pmatrix}$. Das größte t, das dies erfüllt, ist $t = 8$; für $t = 8$ gilt $\begin{pmatrix} 2 \\ 5 \\ 8\end{pmatrix} - t \begin{pmatrix}-4 \\ 0 \\ 1 \end{pmatrix} = \begin{pmatrix} 34 \\ 5 \\ 0 \end{pmatrix}$, Ausgangsvariable ist $x_{5}$.
|
||||
|
||||
\textbf{5. Schritt} (Update von $x_{B}^{*}$ und $B$):\\
|
||||
$x_{B}^{*} = \begin{pmatrix} x_{1}^{*} \\ x_{4}^{*} \\ x_{5}^{*} \end{pmatrix} = \begin{pmatrix} 2 \\ 3 \\ 8 \end{pmatrix}$ und $B = \begin{pmatrix} x_{1} & x_{4} & x_{5} \\ 1 & 0 & 0 \\ 1 & 1 & 0 \\ 0 & 0 & 1 \end{pmatrix}$.
|
||||
$x_{B}^{*} = \begin{pmatrix} x_{3}^{*} \\ x_{4}^{*} \\ x_{2}^{*} \end{pmatrix} = \begin{pmatrix} 34 \\ 5 \\ 8 \end{pmatrix}$ und $B = \begin{pmatrix} x_{3} & x_{4} & x_{2} \\ 1 & 0 & -4 \\ 0 & 1 & 0 \\ 0 & 0 & 1 \end{pmatrix}$.
|
||||
|
||||
\underline{2. Iteration}
|
||||
|
||||
\textbf{1. Schritt} (Lösung von $y^{T}B = c_{B}^{T}$):\\
|
||||
Es gilt $c_{B}^{T} = \begin{pmatrix} 2 & 0 & 0 \end{pmatrix}$. Das Gleichungssystem $y^{T}B = c_{B}^{T}$ lautet
|
||||
\begin{alignat*}{4}
|
||||
y_{1} &+& y_{2} && &=& 2 \\
|
||||
&& y_{2} && &=& 0 \\
|
||||
&& && y_{3} &=& 0
|
||||
y_{1} && &-& 4y_{3} &=& 34 \\
|
||||
&& y_{2} && &=& 5 \\
|
||||
&& && y_{3} &=& 8
|
||||
\end{alignat*}
|
||||
Also gilt $y^{T} = \begin{pmatrix} 2 & 0 & 0 \end{pmatrix}$.
|
||||
Also gilt $y^{T} = \begin{pmatrix} 66 & 5 & 8 \end{pmatrix}$.
|
||||
|
||||
\textbf{2. Schritt} (Bestimmung der Eingangsspalte a und gleichzeitig der Eingangsvariablen):\\
|
||||
Es gilt $A_{N} = \begin{pmatrix} x_{3} & x_{2} \\ 1 & -4 \\ 0 & 0 \\ 0 & 1 \end{pmatrix},\; y^{T}A_{N} = \begin{pmatrix} 2 & -8 \end{pmatrix}$ und $c_{N}^{T} = \begin{pmatrix} 0 & 3 \end{pmatrix}$. Also kommt nur die zweite Spalte von $A_{N}$ als Eingangsspalte a infrage, wir wählen $a = \begin{pmatrix} -4 \\ 0 \\ 1 \end{pmatrix}$; die Eingangsvariable ist $x_{2}$.
|
||||
Es gilt $A_{N} = \begin{pmatrix} x_{1} & x_{5} \\ 1 & 0 \\ 1 & 0 \\ 0 & 1 \end{pmatrix},\; y^{T}A_{N} = \begin{pmatrix} 71 & 8 \end{pmatrix}$ und $c_{N}^{T} = \begin{pmatrix} 2 & 0 \end{pmatrix}$. Also kommt nur die erste Spalte von $A_{N}$ als Eingangsspalte a infrage, wir wählen $a = \begin{pmatrix} 1 \\ 1 \\ 0 \end{pmatrix}$; die Eingangsvariable ist $x_{1}$.
|
||||
|
||||
\textbf{3. Schritt} (Lösung von $Bd = a$):\\
|
||||
Das Gleichungssystem $Bd = a$ lautet
|
||||
\begin{alignat*}{4}
|
||||
d_{1} && && &=& -4 \\
|
||||
d_{1} &+& d_{2} && &=& 0 \\
|
||||
&& && d_{3} &=& 1
|
||||
d_{1} && &-& 4d_{3} &=& 1 \\
|
||||
&& d_{2} && &=& 1 \\
|
||||
&& && d_{3} &=& 0
|
||||
\end{alignat*}
|
||||
Es folgt $d = \begin{pmatrix}-4 \\ 4 \\ 1 \end{pmatrix}$.
|
||||
Es folgt $d = \begin{pmatrix}1 \\ 1 \\ 0 \end{pmatrix}$.
|
||||
|
||||
\textbf{4. Schritt} (Bestimmung der Ausgangsvariablen):\\
|
||||
Die Ungleichung $x_{B}^{*} - td \geq 0$ lautet $\begin{pmatrix} 2 \\ 3 \\ 8\end{pmatrix} - t \begin{pmatrix}-4 \\ 4 \\ 1 \end{pmatrix} \geq \begin{pmatrix} 0 \\ 0 \\ 0 \end{pmatrix}$. Das größte t, das dies erfüllt, ist $t = \frac{3}{4}$; für $t = \frac{3}{4}$ gilt $\begin{pmatrix} 2 \\ 3 \\ 8\end{pmatrix} - t \begin{pmatrix}-4 \\ 4 \\ 1 \end{pmatrix} = \begin{pmatrix} 5 \\ 0 \\ \frac{29}{4} \end{pmatrix}$, Ausgangsvariable ist $x_{4}$.
|
||||
Die Ungleichung $x_{B}^{*} - td \geq 0$ lautet $\begin{pmatrix} 34 \\ 5 \\ 8\end{pmatrix} - t \begin{pmatrix}1 \\ 1 \\ 0 \end{pmatrix} \geq \begin{pmatrix} 0 \\ 0 \\ 0 \end{pmatrix}$. Das größte t, das dies erfüllt, ist $t = 5$; für $t = 5$ gilt $\begin{pmatrix} 34 \\ 5 \\ 8\end{pmatrix} - t \begin{pmatrix}1 \\ 1 \\ 0 \end{pmatrix} = \begin{pmatrix} 29 \\ 0 \\ 8 \end{pmatrix}$, Ausgangsvariable ist $x_{4}$.
|
||||
|
||||
\textbf{5. Schritt} (Update von $x_{B}^{*}$ und $B$):\\
|
||||
$x_{B}^{*} = \begin{pmatrix} x_{1}^{*} \\ x_{2}^{*} \\ x_{5}^{*} \end{pmatrix} = \begin{pmatrix} 5 \\ \frac{3}{4} \\ \frac{29}{4} \end{pmatrix}$ und $B = \begin{pmatrix} x_{1} & x_{2} & x_{5} \\ 1 & -4 & 0 \\ 1 & 0 & 0 \\ 0 & 1 & 1 \end{pmatrix}$.
|
||||
$x_{B}^{*} = \begin{pmatrix} x_{3}^{*} \\ x_{1}^{*} \\ x_{2}^{*} \end{pmatrix} = \begin{pmatrix} 29 \\ 5 \\ 8 \end{pmatrix}$ und $B = \begin{pmatrix} x_{3} & x_{1} & x_{2} \\ 1 & 1 & -4 \\ 0 & 1 & 0 \\ 0 & 0 & 1 \end{pmatrix}$.
|
||||
|
||||
\underline{3. Iteration}
|
||||
|
||||
\textbf{1. Schritt} (Lösung von $y^{T}B = c_{B}^{T}$):\\
|
||||
Es gilt $c_{B}^{T} = \begin{pmatrix} 2 & 3 & 0 \end{pmatrix}$. Das Gleichungssystem $y^{T}B = c_{B}^{T}$ lautet
|
||||
Es gilt $c_{B}^{T} = \begin{pmatrix} 0 & 2 & 3 \end{pmatrix}$. Das Gleichungssystem $y^{T}B = c_{B}^{T}$ lautet
|
||||
\begin{alignat*}{4}
|
||||
y_{1} &+& y_{2} && &=& 2 \\
|
||||
-4y_{1} && &+& y_{3} &=& 3 \\
|
||||
&& && y_{3} &=& 0
|
||||
\end{alignat*}
|
||||
Also gilt $y^{T} = \begin{pmatrix} -\frac{3}{4} & \frac{11}{4} & 0 \end{pmatrix}$.
|
||||
|
||||
\textbf{2. Schritt} (Bestimmung der Eingangsspalte a und gleichzeitig der Eingangsvariablen):\\
|
||||
Es gilt $A_{N} = \begin{pmatrix} x_{3} & x_{4} \\ 1 & 0 \\ 0 & 1 \\ 0 & 0 \end{pmatrix},\; y^{T}A_{N} = \begin{pmatrix} -\frac{3}{4} & \frac{11}{4} \end{pmatrix}$ und $c_{N}^{T} = \begin{pmatrix} 0 & 0 \end{pmatrix}$. Also kommt nur die erste Spalte von $A_{N}$ als Eingangsspalte a infrage, wir wählen $a = \begin{pmatrix} 1 \\ 0 \\ 0 \end{pmatrix}$; die Eingangsvariable ist $x_{3}$.
|
||||
|
||||
\textbf{3. Schritt} (Lösung von $Bd = a$):\\
|
||||
Das Gleichungssystem $Bd = a$ lautet
|
||||
\begin{alignat*}{4}
|
||||
d_{1} &-& 4d_{2} && &=& 1\\
|
||||
d_{1} && && &=& 0 \\
|
||||
&& d_{2} &+& d_{3} &=& 0
|
||||
\end{alignat*}
|
||||
Es folgt $d = \begin{pmatrix} 0 \\ -\frac{1}{4} \\ \frac{1}{4} \end{pmatrix}$.
|
||||
|
||||
\textbf{4. Schritt} (Bestimmung der Ausgangsvariablen):\\
|
||||
Die Ungleichung $x_{B}^{*} - td \geq 0$ lautet $\begin{pmatrix} 5 \\ \frac{3}{4} \\ \frac{29}{4}\end{pmatrix} - t \begin{pmatrix}0 \\ -\frac{1}{4} \\ \frac{1}{4} \end{pmatrix} \geq \begin{pmatrix} 0 \\ 0 \\ 0 \end{pmatrix}$. Das größte t, das dies erfüllt, ist $t = 3$; für $t = 3$ gilt $\begin{pmatrix} 5 \\ \frac{3}{4} \\ \frac{29}{4}\end{pmatrix} - t \begin{pmatrix} 0 \\ -\frac{1}{4} \\ \frac{1}{4} \end{pmatrix} = \begin{pmatrix} 5 \\ 0 \\ \frac{13}{2} \end{pmatrix}$, Ausgangsvariable ist $x_{2}$.
|
||||
|
||||
\textbf{5. Schritt} (Update von $x_{B}^{*}$ und $B$):\\
|
||||
$x_{B}^{*} = \begin{pmatrix} x_{1}^{*} \\ x_{3}^{*} \\ x_{5}^{*} \end{pmatrix} = \begin{pmatrix} 5 \\ 3 \\ \frac{13}{2} \end{pmatrix}$ und $B = \begin{pmatrix} x_{1} & x_{3} & x_{5} \\ 1 & 1 & 0 \\ 1 & 0 & 0 \\ 0 & 0 & 1 \end{pmatrix}$.
|
||||
|
||||
\underline{4. Iteration}
|
||||
|
||||
\textbf{1. Schritt} (Lösung von $y^{T}B = c_{B}^{T}$):\\
|
||||
Es gilt $c_{B}^{T} = \begin{pmatrix} 2 & 0 & 0 \end{pmatrix}$. Das Gleichungssystem $y^{T}B = c_{B}^{T}$ lautet
|
||||
\begin{alignat*}{4}
|
||||
y_{1} &+& y_{2} && &=& 2 \\
|
||||
y_{1} && && &=& 0 \\
|
||||
&& && y_{3} &=& 0
|
||||
\end{alignat*}
|
||||
Also gilt $y^{T} = \begin{pmatrix} 0 & 2 & 0 \end{pmatrix}$.
|
||||
|
||||
\textbf{2. Schritt} (Bestimmung der Eingangsspalte a und gleichzeitig der Eingangsvariablen):\\
|
||||
Es gilt $A_{N} = \begin{pmatrix} x_{2} & x_{4} \\ -4 & 0 \\ 0 & 1 \\ 1 & 0 \end{pmatrix},\; y^{T}A_{N} = \begin{pmatrix} 0 & 2 \end{pmatrix}$ und $c_{N}^{T} = \begin{pmatrix} 3 & 0 \end{pmatrix}$. Also kommt nur die erste Spalte von $A_{N}$ als Eingangsspalte a infrage, wir wählen $a = \begin{pmatrix} -4 \\ 0 \\ 1 \end{pmatrix}$; die Eingangsvariable ist $x_{2}$.
|
||||
|
||||
\textbf{3. Schritt} (Lösung von $Bd = a$):\\
|
||||
Das Gleichungssystem $Bd = a$ lautet
|
||||
\begin{alignat*}{4}
|
||||
d_{1} &+& d_{2} && &=& -4\\
|
||||
d_{1} && && &=& 0 \\
|
||||
&& && d_{3} &=& 1
|
||||
\end{alignat*}
|
||||
Es folgt $d = \begin{pmatrix} 0 \\ -4 \\ 1 \end{pmatrix}$.
|
||||
|
||||
\textbf{4. Schritt} (Bestimmung der Ausgangsvariablen):\\
|
||||
Die Ungleichung $x_{B}^{*} - td \geq 0$ lautet $\begin{pmatrix} 5 \\ 3 \\ \frac{13}{2}\end{pmatrix} - t \begin{pmatrix}0 \\ -4 \\ 1 \end{pmatrix} \geq \begin{pmatrix} 0 \\ 0 \\ 0 \end{pmatrix}$. Das größte t, das dies erfüllt, ist $t = \frac{13}{2}$; für $t = \frac{13}{2}$ gilt $\begin{pmatrix} 5 \\ 3 \\ \frac{13}{2}\end{pmatrix} - t \begin{pmatrix} 0 \\ -4 \\ 1 \end{pmatrix} = \begin{pmatrix} 5 \\ 29 \\ 0 \end{pmatrix}$, Ausgangsvariable ist $x_{5}$.
|
||||
|
||||
\textbf{5. Schritt} (Update von $x_{B}^{*}$ und $B$):\\
|
||||
$x_{B}^{*} = \begin{pmatrix} x_{1}^{*} \\ x_{3}^{*} \\ x_{2}^{*} \end{pmatrix} = \begin{pmatrix} 5 \\ 29 \\ \frac{13}{2} \end{pmatrix}$ und $B = \begin{pmatrix} x_{1} & x_{3} & x_{2} \\ 1 & 1 & -4 \\ 1 & 0 & 0 \\ 0 & 0 & 1 \end{pmatrix}$.
|
||||
|
||||
\underline{5. Iteration}
|
||||
|
||||
\textbf{1. Schritt} (Lösung von $y^{T}B = c_{B}^{T}$):\\
|
||||
Es gilt $c_{B}^{T} = \begin{pmatrix} 2 & 0 & 3 \end{pmatrix}$. Das Gleichungssystem $y^{T}B = c_{B}^{T}$ lautet
|
||||
\begin{alignat*}{4}
|
||||
y_{1} &+& y_{2} && &=& 2 \\
|
||||
y_{1} && && &=& 0 \\
|
||||
-4y_{1} && &+& y_{3} &=& 3
|
||||
\end{alignat*}
|
||||
Also gilt $y^{T} = \begin{pmatrix} 0 & 2 & 3 \end{pmatrix}$.
|
||||
|
||||
\textbf{2. Schritt} (Bestimmung der Eingangsspalte a und gleichzeitig der Eingangsvariablen):\\
|
||||
Es gilt $A_{N} = \begin{pmatrix} x_{5} & x_{4} \\ 0 & 0 \\ 0 & 1 \\ 1 & 0 \end{pmatrix},\; y^{T}A_{N} = \begin{pmatrix} 3 & 2 \end{pmatrix}$ und $c_{N}^{T} = \begin{pmatrix} 0 & 0 \end{pmatrix}$. Wegen $3 \geq 0, 2 \geq 0$ ist die aktuelle Lösung optimal. Die optimale Lösung lautet $x_{1}^{*} = 5, x_{2}^{*} = \frac{13}{2}$ mit $z^{*} = 2x_{1}^{*} + 3x_{2}^{*} = \frac{59}{2}$.
|
||||
Es gilt $A_{N} = \begin{pmatrix} x_{4} & x_{5} \\ 0 & 0 \\ 1 & 0 \\ 0 & 1 \end{pmatrix},\; y^{T}A_{N} = \begin{pmatrix} 2 & 3 \end{pmatrix}$ und $c_{N}^{T} = \begin{pmatrix} 0 & 0 \end{pmatrix}$. Wegen $2 \geq 0, 3 \geq 0$ ist die aktuelle Lösung optimal. Die optimale Lösung lautet $x_{1}^{*} = 5, x_{2}^{*} = 8$ mit $z^{*} = 2x_{1}^{*} + 3x_{2}^{*} = 34$.
|
||||
\subsection{} %b
|
||||
\begin{alignat*}{4}
|
||||
\text{maximiere}\; & 3x_{1} \,&+&\, 2x_{2} \,&+&\, 2x_{3} && \\
|
||||
|
||||
Reference in New Issue
Block a user