Rajout de la partie Graphes sans circuits de la partie Problème de plus courts chemins #4 #8
No files matched your search
+1
-1
@@ -18,7 +18,7 @@
|
||||
# these rules might exclude image files for figures etc.
|
||||
# *.ps
|
||||
# *.eps
|
||||
# *.pdf
|
||||
*.pdf
|
||||
|
||||
## Generated if empty string is given at "Please type another file name for output:"
|
||||
.pdf
|
||||
|
||||
+145
-5
@@ -13,6 +13,7 @@
|
||||
\usepackage{amssymb}
|
||||
\usepackage[babel=true]{csquotes}
|
||||
\usepackage{titlesec}
|
||||
\usepackage{color}
|
||||
\usepackage[usenames,dvipsnames,pdf]{pstricks}
|
||||
\usepackage{epsfig}
|
||||
\usepackage{pst-grad} % For gradients
|
||||
@@ -21,6 +22,7 @@
|
||||
\usepackage{etoolbox} % For spaces in paths
|
||||
\usepackage[vlined, boxruled]{algorithm2e}
|
||||
\usepackage{pgf,tikz}
|
||||
\usepackage{pgfplots}
|
||||
\usetikzlibrary{arrows}
|
||||
\tikzset{
|
||||
font={\fontsize{7pt}{12}\selectfont}}
|
||||
@@ -186,8 +188,10 @@ child {node {right}
|
||||
|
||||
\section*{Théorie des graphes}
|
||||
|
||||
\newcommand{\GXA}{$G = (X,A)$ }
|
||||
|
||||
\subsection*{Graphes Non-Orientés}
|
||||
Un graphe non-orienté $G = (X,A)$ est un couple d'ensembles finis avec :
|
||||
Un graphe non-orienté \GXA est un couple d'ensembles finis avec :
|
||||
\begin{itemize}
|
||||
\item $X = \left\{\text{sommets}\right\}$
|
||||
\item $A = \left\{\mathbf{ar\hat{e}tes}\right\}$, les arêtes étant de la forme $\{x,y\}$ (le sens compte).
|
||||
@@ -276,7 +280,7 @@ Codage d'un graphe :
|
||||
\textbf{Algorithme de \textsc{Krusgal} :}
|
||||
|
||||
\subsection*{Graphe Orientés}
|
||||
Un graphe orienté $G = (X,A)$ est un couple d'ensembles finis avec :
|
||||
Un graphe orienté \GXA est un couple d'ensembles finis avec :
|
||||
\begin{itemize}
|
||||
\item $X = \left\{\text{sommets}\right\}$
|
||||
\item $A = \left\{\mathbf{arcs}\right\}$, les arcs étant de la forme $(x,y)$ (le sens compte).
|
||||
@@ -320,10 +324,146 @@ Exemple :
|
||||
|
||||
On définit alors de manière analogue la matrice d'adjacence de $G$. La liste d'adjacence distingue la liste des successeurs et la liste des prédécesseurs.
|
||||
|
||||
\section*{Plus courts chemins}
|
||||
|
||||
\subsection*{Cas des graphes sans circuits : algorithme de Bellman}
|
||||
|
||||
\newcommand{\pere}{\text{père}}
|
||||
\newcommand{\Vm}{V^-}
|
||||
\newcommand{\Vp}{V^+}
|
||||
\newcommand{\tred}[1]{{\color{red}#1}}
|
||||
|
||||
Soit \GXA orienté pondéré par $p\,:\,A\,\rightarrow\,\mathbb{R}$ \emph{sans-circuits}, et un sommet $r\in X$.
|
||||
|
||||
\textbf{Problème :} déterminer, pour $x\neq r$, un $\underset{\tred{plch.}}{pcch.}$ de $r$ à $x$.
|
||||
|
||||
On définit deux attributs :
|
||||
\begin{itemize}
|
||||
\item $\pi(x) =$ poids d'un pcch. de $r$ à $x$
|
||||
\item $\pere(x) =$ prédécesseur de $x$ sur un tel chemin
|
||||
\end{itemize}
|
||||
|
||||
\[ \pi(x) = \displaystyle \min_{y\in \Vm(x)}\left[\pi(y) + p(y,x)\right] \]
|
||||
|
||||
Une \textbf{numération topologique} de $G$ orienté est une bijection $\varphi\,:\,X\rightarrow\,\{1,2,\ldots,n\}$ tq. $\forall (x,y)\in A, \,\varphi(x) < \varphi(y)$.
|
||||
|
||||
%inclure exemple
|
||||
|
||||
\begin{algorithm}[H]
|
||||
Déterminer une numérotation topologique $\varphi$ et $\varphi^{-1}$ \;
|
||||
Pour $x\neq r$, $\pi(x) \longleftarrow \underset{\tred{-\infty}}{+\infty}$\;
|
||||
$\pi(r) \longleftarrow 0$ \;
|
||||
|
||||
\For{$i$ variant de 2 à $n$}
|
||||
{
|
||||
$x \longleftarrow \varphi^{-1}(i)$ \;
|
||||
$\pi(x) \longleftarrow \min_{y\in \Vm(x)}\left[\pi(y) + p(y,x)\right]$ \;
|
||||
{\footnotesize \tred{$\pi(x) \leftarrow\max_{y\in \Vm(x)}\left[\pi(y) + p(y,x)\right]$\;} }
|
||||
$\pere(x) \longleftarrow y^*\in \Vm(x)$ avec $\pi(x) = \pi(y^*) + p(y^*,x)$ \;
|
||||
}
|
||||
|
||||
\caption{Algorithme de \textsc{Bellman}}
|
||||
\end{algorithm}
|
||||
|
||||
\subsection*{Problème de l'ordonnancement}
|
||||
|
||||
\newcommand{\Dmin}{D_{\text{min}}}
|
||||
\newcommand{\debut}{\text{début}}
|
||||
\newcommand{\fin}{\text{fin}}
|
||||
|
||||
Soit $T$ un ensemble de $p$ tâches $t_i$ ($1\leqslant i\leqslant p$). Chaque tâche $t_i$ possède une durée $d_i$. On doit respecter des contraintes de la forme : avant de commencer $x$, on doit avoir fini $y$. On peut réaliser les tâches en parallèle.
|
||||
|
||||
De quelle façon réaliser chaque tâche de façon à :
|
||||
\begin{itemize}
|
||||
\item respecter les contraintes
|
||||
\item minimiser la durée totale de réalisation, $\Dmin$.
|
||||
\end{itemize}
|
||||
|
||||
Modélisation : soit \GXA orienté, pondéré, défini par :
|
||||
\begin{itemize}
|
||||
\item $X = T \cup \{\debut,\fin\}$
|
||||
\item $(x,y)\in A \Longleftrightarrow$ $x$ doit être réalisée avant $y$ et on pondère $(x,y)$ par $d_x$
|
||||
\item $(\debut,x)$ pondéré par 0
|
||||
\item $(x,\fin)$ pondéré par $d_x$
|
||||
\end{itemize}
|
||||
|
||||
Exemple :
|
||||
\begin{center}
|
||||
\begin{tabular}{ccc}
|
||||
& Durée & Contraintes \\
|
||||
\hline \hline
|
||||
A & 2 & B,D avant A \\
|
||||
\hline
|
||||
B & 7 & / \\
|
||||
\hline
|
||||
C & 5 & B,D,E avant C \\
|
||||
\hline
|
||||
D & 3 & / \\
|
||||
\hline
|
||||
E & 6 & A avant E \\
|
||||
\end{tabular}
|
||||
\end{center}
|
||||
|
||||
\newcommand{\ovun}[3]{\overset{{\color{blue}#2}}{\underset{{\color{red}#3}}{#1}}}
|
||||
|
||||
$\forall\mathcal{C}$ chemin de début à fin , $\Dmin \geqslant p(\mathcal{C})$.
|
||||
|
||||
$G$ est sans-circuit ssi le problème d'ordonnancement admet une solution. Dans ce cas, considérons un plch. de début à $x \neq$ début : le poids de ce chemin donne la date au plus tôt de début de réalisation de $x$. D'où :
|
||||
\[ \Dmin = \text{poids d'un plch. de début à fin}\]
|
||||
|
||||
$\Rightarrow$ Algorithme de \textsc{Bellman} :
|
||||
|
||||
\begin{center}
|
||||
\begin{tikzpicture}[scale = 1.5]
|
||||
|
||||
\tikzset{vertex/.style = {inner sep=2pt, draw = none}}
|
||||
\tikzset{edge/.style = {->,> = latex'}}
|
||||
% vertices
|
||||
\node[vertex] (a) at (0.7,1.4) {$\ovun{A}{7,B}{4}$};
|
||||
\node[vertex] (b) at (-0.7,1.4) {$\ovun{B}{0,\text{début}}{3}$};
|
||||
\node[vertex] (c) at (0.7,0) {$\ovun{C}{15,E}{6}$};
|
||||
\node[vertex] (d) at (-0.7,0) {$\ovun{D}{0,\text{début}}{2}$};
|
||||
\node[vertex] (e) at (0.7,0.7) {$\ovun{E}{9,A}{5}$};
|
||||
\node[vertex] (deb) at (-1.4,.7) {$\ovun{\text{début}}{0,\cdot}{1}$};
|
||||
\node[vertex] (fin) at (1.4,0.7) {$\ovun{\text{fin}}{20,C}{7}$};
|
||||
|
||||
%edges
|
||||
\draw[edge] (deb) to node [above] {0} (b);
|
||||
\draw[edge] (deb) to node [above] {0} (d);
|
||||
\draw[edge] (b) to node [above] {7} (a);
|
||||
\draw[edge] (b) to[bend left = 15] node [above] {7} (c);
|
||||
\draw[edge] (d) to[bend right = 15] node [left] {3} (a);
|
||||
\draw[edge] (d) to node [above] {3} (c);
|
||||
\draw[edge] (a) to node [right] {2} (e);
|
||||
\draw[edge] (e) to node [right] {6} (c);
|
||||
\draw[edge] (c) to node [below] {5} (fin);
|
||||
|
||||
\end{tikzpicture}
|
||||
\end{center}
|
||||
|
||||
\begin{flushright}
|
||||
{\footnotesize \tred{Numérotation topologique} \\
|
||||
{\color{blue} Marquage de \textsc{Bellman}}}
|
||||
\end{flushright}
|
||||
|
||||
\begin{tikzpicture}[scale = 1]
|
||||
\begin{axis}
|
||||
[title = Diagramme de \textsc{Gantt}, height = 3cm, xlabel = temps, ylabel = ressources, width = 0.3\paperwidth, axis x line = bottom, axis y line =left, ymin = 0, ymax = 2.2, xmin = 0, xmax = 21]
|
||||
\addplot+[blue, ybar interval, mark = none] coordinates {(0,1) (7,1) (9,1) (15,1) (20,1) };
|
||||
\addplot+[blue, ybar interval, mark = none] plot coordinates {(0,2) (3,2)};
|
||||
\addplot+[white, mark = none] plot coordinates {(3,0.001) (3,0.99)};
|
||||
\node at (axis cs:3.5,0.5) [] {$B$};
|
||||
\node at (axis cs:8,0.5) [] {$A$};
|
||||
\node at (axis cs:12,0.5) [] {$E$};
|
||||
\node at (axis cs:17.5,0.5) [] {$C$};
|
||||
\node at (axis cs:1.5,1.5) [] {$D$};
|
||||
\end{axis}
|
||||
\end{tikzpicture}
|
||||
|
||||
\section*{Flux et flots}
|
||||
\newcommand{\Sb}{\overline{S}}
|
||||
|
||||
Soit $G=(x,a)$ un graphe orienté. On dote chaque arc $a$ d'une capacité $c(a)$:
|
||||
Soit \GXA un graphe orienté. On dote chaque arc $a$ d'une capacité $c(a)$:
|
||||
\[
|
||||
\begin{array}{cc|ccl}
|
||||
c & : & A & \to & \mathbb{R}^*_+ \\
|
||||
@@ -348,7 +488,7 @@ On définit ainsi
|
||||
\[v(f) = \displaystyle\sum_{z\in V^+(s)}{f(s,z)} - \sum_{y\in V^+(x)}{f(y,z)} \]
|
||||
|
||||
\subsection*{Problème de la coupe minimum}
|
||||
Soit $G$ orienté, $c\, :\, A\, \mapsto\, \mathbb{R}^*_+$, $s$ et $p$.
|
||||
Soit $G$ orienté, $c\, :\, A\, \rightarrow\, \mathbb{R}^*_+$, $s$ et $p$.
|
||||
|
||||
Une coupe $(S,\Sb)$ est une bipartition de $X$ avec :\begin{enumerate}
|
||||
\item $S \cap \Sb = \varnothing$
|
||||
@@ -421,7 +561,7 @@ On les représente de la sorte :
|
||||
\end{algorithm}
|
||||
|
||||
\subsection*{Théorème de Mayer}
|
||||
Soit $G = (X,A)$ un graphe orienté.\\
|
||||
Soit \GXA un graphe orienté.\\
|
||||
\textbf{Problème 1 :} déterminer le nombre minimum d'\textit{arcs} à retirer $G$ pour laisser un graphe fortement connexe $=$ forte arc-connectivité.\\
|
||||
\textbf{Problème 2 :} de même mais en enlevant des \textit{sommets} $=$ forte sommet-connectivité.\\
|
||||
\textbf{Problème 3 \textit{\&} 4 :} mêmes problèmes avec $G$ non-orienté.
|
||||
|
||||
Reference in new issue
Block a user