Add détection de circuit - humain

This commit is contained in:
flyingscorpio@clevo 2022-03-08 13:37:44 +01:00
parent 060746de75
commit b4958338fc

View file

@ -261,6 +261,157 @@
\subsubsection{Calcul de rang}
\paragraph{Méthode pour les humains}
Comme les humains peuvent avoir une vue globale sur tout le graphe d'un coup (pourvu que le nombre de sommets ne soit pas trop grand), il est possible d'identifier visuellement les sommets n'ayant aucun arc entrant.
L'algorithme consiste alors à retirer du graphe ces sommets, par itération.
À chaque itération, le rang augmente (le rang 0 étant le rang le plus fort).
\begin{multicols}{3}
\begin{center}
Graphe de départ~: \\
\begin{tikzpicture}[->,scale=0.6, transform shape]
\node (1) [state] at (0,0) {1};
\node (2) [state] at (-1,-8) {2};
\node (3) [state] at (-2,-5) {3};
\node (4) [state] at (1,-10) {4};
\node (5) [state] at (2,-1) {5};
\node (6) [state] at (-2,-1) {6};
\node (7) [state] at (1,-5) {7};
\node (8) [state] at (1,-8) {8};
\node (9) [state] at (-1,-3) {9};
\node (10) [state] at (2,-3) {10};
\node (11) [state] at (3,-7) {11};
\node (12) [state] at (4,-4) {12};
\path
(1) edge (5)
(2) edge (4)
(2) edge (7)
(2) edge (8)
(2) edge (12)
(3) edge (7)
(3) edge (10)
(3) edge (11)
(4) edge (8)
(4) edge (11)
(4) edge [bend right] (12)
(6) edge (1)
(6) edge (3)
(6) edge (10)
(7) edge (10)
(7) edge (12)
(8) edge (11)
(9) edge (5)
(9) edge (7)
(5) edge (12)
(10) edge (5)
(11) edge (12)
;
\end{tikzpicture}
\end{center}
\columnbreak
\begin{center}
Rang 0 (sommets 2--6--9)~: \\
\begin{tikzpicture}[->,scale=0.6, transform shape]
\node (1) [state] at (0,0) {1};
\node (3) [state] at (-2,-5) {3};
\node (4) [state] at (1,-10) {4};
\node (5) [state] at (2,-1) {5};
\node (7) [state] at (1,-5) {7};
\node (8) [state] at (1,-8) {8};
\node (10) [state] at (2,-3) {10};
\node (11) [state] at (3,-7) {11};
\node (12) [state] at (4,-4) {12};
\path
(1) edge (5)
(3) edge (7)
(3) edge (10)
(3) edge (11)
(4) edge (8)
(4) edge (11)
(4) edge [bend right] (12)
(7) edge (10)
(7) edge (12)
(8) edge (11)
(5) edge (12)
(10) edge (5)
(11) edge (12)
;
\end{tikzpicture}
\end{center}
\columnbreak
\begin{center}
Rang 1 (sommets 1--3--4)~: \\
\begin{tikzpicture}[->,scale=0.6, transform shape]
\node (5) [state] at (2,-1) {5};
\node (7) [state] at (1,-5) {7};
\node (8) [state] at (1,-8) {8};
\node (10) [state] at (2,-3) {10};
\node (11) [state] at (3,-7) {11};
\node (12) [state] at (4,-4) {12};
\path
(7) edge (10)
(7) edge (12)
(8) edge (11)
(5) edge (12)
(10) edge (5)
(11) edge (12)
;
\end{tikzpicture}
\end{center}
\end{multicols}
\begin{multicols}{3}
\begin{center}
Rang 2 (sommets 7--8)~: \\
\begin{tikzpicture}[->,scale=0.6, transform shape]
\node (5) [state] at (2,-1) {5};
\node (10) [state] at (2,-3) {10};
\node (11) [state] at (3,-7) {11};
\node (12) [state] at (4,-4) {12};
\path
(5) edge (12)
(10) edge (5)
(11) edge (12)
;
\end{tikzpicture}
\end{center}
\columnbreak
\begin{center}
Rang 3 (sommets 10--11)~: \\
\begin{tikzpicture}[->,scale=0.6, transform shape]
\node (5) [state] at (2,-1) {5};
\node (12) [state] at (4,-4) {12};
\path
(5) edge (12)
;
\end{tikzpicture}
\end{center}
\columnbreak
\begin{center}
Rang 4 (sommet 5)~: \\
\begin{tikzpicture}[->,scale=0.6, transform shape]
\node (12) [state] at (4,-4) {12};
\end{tikzpicture}
\end{center}
\end{multicols}
\ldots{} et donc le sommet 12 est de rang 5.
\paragraph{Méthode pour les ordinateurs}
\subsubsection{Détection de cycle (algorithme de Rosalind-Marimond)}
L'algorithme de Rosalind-Marimond supprime les $d^-$ (connexions entrantes) et les $d^+$ (connexions sortantes) à chaque étape.