Merge branch 'fiche_antograb' of antograb/FicheInf101 into master

This commit was merged in pull request #7.
This commit is contained in:
antograb authored and Gogs committed 2017-11-16 08:58:17 +01:00
commit f340405821
2 files changed
+335 -11

No files matched your search

Executable
+221
View File
@@ -0,0 +1,221 @@
## Core latex/pdflatex auxiliary files:
*.aux
*.lof
*.log
*.lot
*.fls
*.out
*.toc
*.fmt
*.fot
*.cb
*.cb2
## Intermediate documents:
*.dvi
*.xdv
*-converted-to.*
# these rules might exclude image files for figures etc.
# *.ps
# *.eps
# *.pdf
## Generated if empty string is given at "Please type another file name for output:"
.pdf
## Bibliography auxiliary files (bibtex/biblatex/biber):
*.bbl
*.bcf
*.blg
*-blx.aux
*-blx.bib
*.run.xml
## Build tool auxiliary files:
*.fdb_latexmk
*.synctex
*.synctex(busy)
*.synctex.gz
*.synctex.gz(busy)
*.pdfsync
## Auxiliary and intermediate files from other packages:
# algorithms
*.alg
*.loa
# achemso
acs-*.bib
# amsthm
*.thm
# beamer
*.nav
*.pre
*.snm
*.vrb
# changes
*.soc
# cprotect
*.cpt
# elsarticle (documentclass of Elsevier journals)
*.spl
# endnotes
*.ent
# fixme
*.lox
# feynmf/feynmp
*.mf
*.mp
*.t[1-9]
*.t[1-9][0-9]
*.tfm
#(r)(e)ledmac/(r)(e)ledpar
*.end
*.?end
*.[1-9]
*.[1-9][0-9]
*.[1-9][0-9][0-9]
*.[1-9]R
*.[1-9][0-9]R
*.[1-9][0-9][0-9]R
*.eledsec[1-9]
*.eledsec[1-9]R
*.eledsec[1-9][0-9]
*.eledsec[1-9][0-9]R
*.eledsec[1-9][0-9][0-9]
*.eledsec[1-9][0-9][0-9]R
# glossaries
*.acn
*.acr
*.glg
*.glo
*.gls
*.glsdefs
# gnuplottex
*-gnuplottex-*
# gregoriotex
*.gaux
*.gtex
# hyperref
*.brf
# knitr
*-concordance.tex
# TODO Comment the next line if you want to keep your tikz graphics files
*.tikz
*-tikzDictionary
# listings
*.lol
# makeidx
*.idx
*.ilg
*.ind
*.ist
# minitoc
*.maf
*.mlf
*.mlt
*.mtc[0-9]*
*.slf[0-9]*
*.slt[0-9]*
*.stc[0-9]*
# minted
_minted*
*.pyg
# morewrites
*.mw
# nomencl
*.nlo
# pax
*.pax
# pdfpcnotes
*.pdfpc
# sagetex
*.sagetex.sage
*.sagetex.py
*.sagetex.scmd
# scrwfile
*.wrt
# sympy
*.sout
*.sympy
sympy-plots-for-*.tex/
# pdfcomment
*.upa
*.upb
# pythontex
*.pytxcode
pythontex-files-*/
# thmtools
*.loe
# TikZ & PGF
*.dpth
*.md5
*.auxlock
# todonotes
*.tdo
# easy-todo
*.lod
# xindy
*.xdy
# xypic precompiled matrices
*.xyc
# endfloat
*.ttt
*.fff
# Latexian
TSWLatexianTemp*
## Editors:
# WinEdt
*.bak
*.sav
# Texpad
.texpadtmp
# Kile
*.backup
# KBibTeX
*~[0-9]*
# auto folder when using emacs and auctex
/auto/*
# expex forward references with \gathertags
*-tags.tex
Regular → Executable
+114 -11
View File
@@ -30,15 +30,15 @@
\let\endchangemargin=\endlist \let\endchangemargin=\endlist
\titleformat{\section} \titleformat{\section}
{\sffamily\Large\bfseries\raggedleft}{\thesection}{1em}{}[{\titlerule[1pt]}] {\sffamily\large\bfseries\raggedleft}{\thesection}{1em}{}[{\titlerule[1pt]}]
\titleformat{\subsection} \titleformat{\subsection}
{\sffamily\large\bfseries\centering}{\thesection}{0em}{}[{\titlerule[0pt]}] {\sffamily\normalsize\bfseries\centering}{\thesection}{0em}{}[{\titlerule[0pt]}]
\title{\sffamily\textbf{Fiche de révision \\ INF101} \thanks{Cours suivi avec Olivier \bsc{Hudry} }} \title{\sffamily\textbf{Fiche de révision \\ INF101} \thanks{Cours suivi avec Olivier \bsc{Hudry} }}
\author{Antonin \bsc{Godard}} \author{Antonin \bsc{Godard}\\Sylvain \bsc{Rager}}
\date{} \date{}
\begin{document} \begin{document}
@@ -142,7 +142,7 @@ Hauteur de $A$ : $h = \displaystyle \max_{N\in A}\left(\text{prof}(N)\right).$
\KwData{Données du tableau $T$ entre les indices $g$ et $d$} \KwData{Données du tableau $T$ entre les indices $g$ et $d$}
$cle \longleftarrow T\left[g\right]$ \; $cle \longleftarrow T\left[g\right]$ \;
$i \longleftarrow g+1$ \; $i \longleftarrow g+1$ \;
$j \longleftarrow d1$ \; $j \longleftarrow d$ \;
\While{$j \geqslant i$}{ \While{$j \geqslant i$}{
\While{$i \leqslant j$ et $T\left[i\right] \leqslant cle$}{$i \longleftarrow i+1$\;} \While{$i \leqslant j$ et $T\left[i\right] \leqslant cle$}{$i \longleftarrow i+1$\;}
\While{$T\left[j\right] > cle$}{$j \longleftarrow j-1$\;} \While{$T\left[j\right] > cle$}{$j \longleftarrow j-1$\;}
@@ -305,20 +305,120 @@ Exemple :
\node[vertex] (c) at (1,0) {$C$}; \node[vertex] (c) at (1,0) {$C$};
%edges %edges
\draw[edge] (a) to (e); \draw[edge] (a) to node [left] {5} (e);
\draw[edge] (b) to (c); \draw[edge] (b) to node [right] {2} (c);
\draw[edge] (c) to (d); \draw[edge] (c) to node [above] {-3} (d);
\draw[edge] (a) to[bend left = 15] node [right] {abc} (b); \draw[edge] (a) to[bend left = 15] node [right] {1} (b);
\draw[edge] (b) to[bend left = 15] (a); \draw[edge] (b) to[bend left = 15] node [left] {7} (a);
\draw[edge] (b) to[bend left = 15] (e); \draw[edge] (b) to[bend left = 15] node [below] {6} (e);
\draw[edge] (e) to[bend left = 15] (b); \draw[edge] (e) to[bend left = 15] node [above] {-4} (b);
\end{tikzpicture} \end{tikzpicture}
\end{center} \end{center}
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*{Flux et flots} \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)$:
\[
\begin{array}{cc|ccl}
c & : & A & \to & \mathbb{R}^*_+ \\
& & a & \mapsto & c(a) \\
\end{array}
\]
Soient $s$ et $p$ resp. sources et puits.
Un flot $f$ est défini par : \begin{enumerate}
\item $
\begin{array}{cc|ccl}
f & : & A & \to & \mathbb{R}_+ \\
& & a & \mapsto & f(a)\\
\end{array}
$
\item $\forall a \in A\quad 0 \leqslant f(a) \leqslant c(a) $
\item $\forall x \in X\backslash\{s,p\}$\\
$\displaystyle\sum_{y\in V^-(x)}{f(x,y)} = \sum_{z\in V^+(x)}{f(x,z)}$
\end{enumerate}
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$.
Une coupe $(S,\Sb)$ est une bipartition de $X$ avec :\begin{enumerate}
\item $S \cap \Sb = \varnothing$
\item $S \cup \Sb = X$
\item $s\in S$ et $p\in \Sb$
\end{enumerate}
On définit $c(S,\Sb) = \sum_{(x,y)\in S\times\Sb}{c(x,y)}$.
Soit $f$ un flot de $s$ à $p$. Soit $(S,\Sb)$ une coupe dans $G$. Alors :
\[ \displaystyle v(f) = \sum_{(x,y)\in S\times\Sb}{f(x,y)} - \sum_{(z,t)\in \Sb\times S}{f(z,t)} \]
\textbf{Corollaire 1 :} $\forall\,\text{flot}\,f, \,\forall\,\text{coupe}\,(S,\Sb)\\v(f) \leqslant c(S,\Sb)$.
\textbf{Corollaire 2 :} Soit $v_{\text{max}}$ la valeur maximale d'un flot et soit $c_{\text{min}}$ la capacité minimum d'une coupe. Alors $v_{\text{max}} \leqslant c_{\text{min}}$. De plus, s'il existe $f$ et $(S,\Sb)$ avec $v(f) = c(S,\Sb)$ alors $f$ est un flot maximum et $(S,\Sb)$ une coupe de capacité maximum.
Une \textit{chaîne augmentante} (cf. algorithme de marquage suivant) pour $f$ est une suite de sommets de la forme $x_1x_2\ldots x_k$ avec :
\begin{enumerate}
\item $\forall\, 1 \leqslant i \leqslant k\quad x_i \in X$
\item $\forall\, 1 \leqslant i \leqslant k-1$
\begin{itemize}
\item $(x_i,x_{i+1})\in A$ avec $f(x_i,x_{i+1}) < c(x_i,x_{i+1})$
\item $(x_{i+1},x_i)\in A$ avec $f (x_{i+1},x_i) > 0$
\end{itemize}
\end{enumerate}
On les représente de la sorte :
\begin{center}
\begin{tikzpicture}[scale = 1.5]
\tikzset{vertex/.style = {inner sep=2pt, draw = none}}
\tikzset{edge/.style = {->,> = latex'}}
% vertices
\node[vertex] (a) at (-1,0) {$s$};
\node[vertex] (e) at (0,0) {$b$};
\node[vertex] (b) at (1,0) {$p$};
%edges
\draw[edge] (a) to node [above] {+$\varepsilon$} (e);
\draw[edge] (b) to node [above] {-$\varepsilon$} (e);
\end{tikzpicture}
\end{center}
\begin{algorithm}[H]
$s$ est marqué par $(\Delta,+\infty)$ \;
Les autres sommets sont non marqués \;
Aucun sommet n'est examiné \;
\While{$p$ non marqué \emph{et} $\exists$ un sommet marqué non-examiné}
{
Soit $x$ un tel sommet et $\alpha$ la val. absolue de la seconde composante de la marque de $x$ \;
\For{$y\in V^+(x)$ non-marqué}
{
\If{$f(x,y) < c(x,y)$}
{
marquer $y$ par \footnotesize{$\left(x,\min\left[\alpha,c(x,y)-f(x,y)\right]\right)$} \;
}
}
\For{$z\in V^-(x)$ non-marqué}
{
\If{$f(x,y) > 0$}
{
marquer $z$ par \footnotesize{$\left(x,-\min\left[\alpha,f(z,x)\right]\right)$} \;
}
}
$x$ est examiné \;
}
\caption{Algorithme de \textsc{Ford} et \textsc{Fulkerson}}
\end{algorithm}
\subsection*{Théorème de Mayer} \subsection*{Théorème de Mayer}
Soit $G = (X,A)$ un graphe orienté.\\ Soit $G = (X,A)$ un graphe orienté.\\
@@ -395,5 +495,8 @@ Puis on résout le problème 1 avec le graphe obtenu.
Le \textbf{problème 3} est résolu en remplaçant $\{x,y\}$ par $(x,y)$ et $(y,x)$. Attention, après la recherche d'arcs-disjoints il faut ré-ajuster les arcs afin d'y transformer en graphe non-orienté. Le \textbf{problème 3} est résolu en remplaçant $\{x,y\}$ par $(x,y)$ et $(y,x)$. Attention, après la recherche d'arcs-disjoints il faut ré-ajuster les arcs afin d'y transformer en graphe non-orienté.
Le \textbf{problème 4} en résolu grâce au \textbf{problème 2} puis \textbf{1}. Le \textbf{problème 4} en résolu grâce au \textbf{problème 2} puis \textbf{1}.
\end{multicols*} \end{multicols*}
\end{document} \end{document}