\( %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% Mes commandes %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% \newcommand{\multirows}[3]{\multirow{#1}{#2}{$#3$}}%pour rester en mode math \renewcommand{\arraystretch}{1.3}%pour augmenter la taille des case \newcommand{\point}[1]{\marginnote{\small\vspace*{-1em} #1}}%pour indiquer les points ou le temps \newcommand{\dpl}[1]{\displaystyle{#1}}%megamode \newcommand{\A}{\mathscr{A}} \newcommand{\LN}{\mathscr{N}} \newcommand{\LL}{\mathscr{L}} \newcommand{\K}{\mathbb{K}} \newcommand{\N}{\mathbb{N}} \newcommand{\Z}{\mathbb{Z}} \newcommand{\Q}{\mathbb{Q}} \newcommand{\R}{\mathbb{R}} \newcommand{\C}{\mathbb{C}} \newcommand{\M}{\mathcal{M}} \newcommand{\D}{\mathbb{D}} \newcommand{\E}{\mathcal{E}} \renewcommand{\P}{\mathcal{P}} \newcommand{\G}{\mathcal{G}} \newcommand{\Kk}{\mathcal{K}} \newcommand{\Cc}{\mathcal{C}} \newcommand{\Zz}{\mathcal{Z}} \newcommand{\Ss}{\mathcal{S}} \newcommand{\B}{\mathbb{B}} \newcommand{\inde}{\bot\!\!\!\bot} \newcommand{\Proba}{\mathbb{P}} \newcommand{\Esp}[1]{\dpl{\mathbb{E}\left(#1\right)}} \newcommand{\Var}[1]{\dpl{\mathbb{V}\left(#1\right)}} \newcommand{\Cov}[1]{\dpl{Cov\left(#1\right)}} \newcommand{\base}{\mathcal{B}} \newcommand{\Som}{\textbf{Som}} \newcommand{\Chain}{\textbf{Chain}} \newcommand{\Ar}{\textbf{Ar}} \newcommand{\Arc}{\textbf{Arc}} \newcommand{\Min}{\text{Min}} \newcommand{\Max}{\text{Max}} \newcommand{\Ker}{\text{Ker}} \renewcommand{\Im}{\text{Im}} \newcommand{\Sup}{\text{Sup}} \newcommand{\Inf}{\text{Inf}} \renewcommand{\det}{\texttt{det}} \newcommand{\GL}{\text{GL}} \newcommand{\crossmark}{\text{\ding{55}}} \renewcommand{\checkmark}{\text{\ding{51}}} \newcommand{\Card}{\sharp} \newcommand{\Surligne}[2]{\text{\colorbox{#1}{ #2 }}} \newcommand{\SurligneMM}[2]{\text{\colorbox{#1}{ #2 }}} \newcommand{\norm}[1]{\left\lVert#1\right\rVert} \renewcommand{\lim}[1]{\underset{#1}{lim}\,} \newcommand{\nonor}[1]{\left|#1\right|} \newcommand{\Un}{1\!\!1} \newcommand{\sepon}{\setlength{\columnseprule}{0.5pt}} \newcommand{\sepoff}{\setlength{\columnseprule}{0pt}} \newcommand{\flux}{Flux} \newcommand{\Cpp}{\texttt{C++\ }} \newcommand{\Python}{\texttt{Python\ }} %\newcommand{\comb}[2]{\begin{pmatrix} #1\\ #2\end{pmatrix}} \newcommand{\comb}[2]{C_{#1}^{#2}} \newcommand{\arrang}[2]{A_{#1}^{#2}} \newcommand{\supp}[1]{Supp\left(#1\right)} \newcommand{\BB}{\mathcal{B}} \newcommand{\arc}[1]{\overset{\rotatebox{90}{)}}{#1}} \newcommand{\modpi}{\equiv_{2\pi}} \renewcommand{\Re}{Re} \renewcommand{\Im}{Im} \renewcommand{\bar}[1]{\overline{#1}} \newcommand{\mat}{\mathcal{M}} \newcommand{\und}[1]{{\mathbf{\color{red}\underline{#1}}}} \newcommand{\rdots}{\text{\reflectbox{$\ddots$}}} \newcommand{\Compa}{Compa} \newcommand{\dint}{\dpl{\int}} \newcommand{\intEFF}[2]{\left[\!\left[#1 ; #2\right]\!\right]} \newcommand{\intEFO}[2]{\left[\!\left[#1 ; #2\right[\!\right[} \newcommand{\intEOF}[2]{\left]\!\left]#1 ; #2\right]\!\right]} \newcommand{\intEOO}[2]{\left]\!\left]#1 ; #2\right[\!\right[} \newcommand{\ou}{\vee} \newcommand{\et}{\wedge} \newcommand{\non}{\neg} \newcommand{\implique}{\Rightarrow} \newcommand{\equivalent}{\Leftrightarrow} \newcommand{\Ab}{\overline{A}} \newcommand{\Bb}{\overline{B}} \newcommand{\Cb}{\overline{C}} \newcommand{\Cl}{\texttt{Cl}} \newcommand{\ab}{\overline{a}} \newcommand{\bb}{\overline{b}} \newcommand{\cb}{\overline{c}} \newcommand{\Rel}{\mathcal{R}} \newcommand{\superepsilon}{\varepsilon\!\!\varepsilon} \newcommand{\supere}{e\!\!e} \makeatletter \newenvironment{console}{\noindent\color{white}\begin{lrbox}{\@tempboxa}\begin{minipage}{\columnwidth} \ttfamily \bfseries\vspace*{0.5cm}} {\vspace*{0.5cm}\end{minipage}\end{lrbox}\colorbox{black}{\usebox{\@tempboxa}} } \makeatother \def\ie{\textit{i.e. }} \def\cf{\textit{c.f. }} \def\vide{ { $ {\text{ }} $ } } %Commande pour les vecteurs \newcommand{\grad}{\overrightarrow{Grad}} \newcommand{\Vv}{\overrightarrow{v}} \newcommand{\Vu}{\overrightarrow{u}} \newcommand{\Vw}{\overrightarrow{w}} \newcommand{\Vup}{\overrightarrow{u'}} \newcommand{\Zero}{\overrightarrow{0}} \newcommand{\Vx}{\overrightarrow{x}} \newcommand{\Vy}{\overrightarrow{y}} \newcommand{\Vz}{\overrightarrow{z}} \newcommand{\Vt}{\overrightarrow{t}} \newcommand{\Va}{\overrightarrow{a}} \newcommand{\Vb}{\overrightarrow{b}} \newcommand{\Vc}{\overrightarrow{c}} \newcommand{\Vd}{\overrightarrow{d}} \newcommand{\Ve}[1]{\overrightarrow{e_{#1}}} \newcommand{\Vf}[1]{\overrightarrow{f_{#1}}} \newcommand{\Vn}{\overrightarrow{0}} \newcommand{\Mat}{Mat} \newcommand{\Pass}{Pass} \newcommand{\mkF}{\mathfrak{F}} \renewcommand{\sp}{Sp} \newcommand{\Co}{Co} \newcommand{\vect}[1]{\texttt{Vect}\dpl{\left( #1\right)}} \newcommand{\prodscal}[2]{\dpl{\left\langle #1\left|\vphantom{#1 #2}\right. #2\right\rangle}} \newcommand{\trans}[1]{{\vphantom{#1}}^{t}{#1}} \newcommand{\ortho}[1]{{#1}^{\bot}} \newcommand{\oplusbot}{\overset{\bot}{\oplus}} \SelectTips{cm}{12}%Change le bout des flèches dans un xymatrix \newcommand{\pourDES}[8]{ \begin{itemize} \item Pour la ligne : le premier et dernier caractère forment $#1#2$ soit $#4$ en base 10. \item Pour la colonne : les autres caractères du bloc forment $#3$ soit $#5$ en base 10. \item A l'intersection de la ligne $#4+1$ et de la colonne $#5+1$ de $S_{#8}$ se trouve l'entier $#6$ qui, codé sur $4$ bits, est \textbf{\texttt{$#7$}}. \end{itemize} } \)

Représentation d'un graphe

La manière naïve de représenter un graphe est de noter les sommets dans le plan et de relier deux sommets par un segment ou un arc de cercle lorsque l'arête (ou l'arc) correspondant existe, en précisant par des flèches l'orientation dans le cas d'un graphe orienté. Il s'agit de la représentation sagittale. \[ \xymatrix@C=2cm@R=2.5cm{ a\ar[r]\ar@/^2pc/[rr]&b\ar@(ur,dr)[]&c\ar[dl]&\\ &d\ar[ul]\ar[r]\ar@/_2pc/[rr]&e\ar[ull]&f\ar[ulll] } \] \( \Som(\G)=\left\{a,b,c,d,e,f\right\}\)
\( \Arc(\G)=\left\{(a,b),(a,c),(b,b),(c,d),(d,a),(d,e),\right.\)
\( \left.(d,f),(e,a),(f,a)\right\}\) \[ \xymatrix@C=2cm@R=2.5cm{ a\ar@{-}[d]\ar@{-}[dr]\ar@{-}[drr]\ar@{-}@/^2pc/[rr]&b\ar@{-}[d]\ar@{-}[r]&c\ar@{-}[dll]\\ f&e&d } \] \( \Som(\G)=\{a,b,c,d,e,f\}\)
\( \Ar(\G)=\left\{ \{a,c\},\{a,d\},\{a,e\},\{a,f\},\{b,c\},\{b,e\},\{c,f\} \right\}\) On peut également représenter un graphe par une matrice booléenne.

Définition


Notons \( \B=\{0,1\}\) l'algèbre de Boole standard. Son addition et sa multiplication sont données par les tables de calculs suivantes : \[\begin{array}{c|c|c} {\color{red} +}&0&1\\\hline 0&0&1\\\hline 1&1&1 \end{array}\qquad\qquad \begin{array}{c|c|c} {\color{red} \times}&0&1\\\hline 0&0&0\\\hline 1&0&1 \end{array} \]
Le \( 0\) , \( 1\) , \( +\) et \( \times\) représentent respectivement le FAUX, VRAI, OU et ET de la logique.

Définition


Soit \( \G\) un graphe. Notons \( n\in \N_{{>}0}\) la cardinalité de \( \Som(\G)\) et notons \( \{a_1,\dots,a_n\}\) les sommets. La matrice booléenne ou matrice d'adjacence de \( \G\) est une matrice \( M\in \M_{n}(\B)\) tel que \[M_{i,j}=\left\{ \begin{array}{rl} 1 & \text{si }\{a_i,a_j\}\in \Ar(\G)\text{,}\\ 0 & \text{sinon.} \end{array} \right.\]
Dans le cas non orienté.
\[M_{i,j}=\left\{ \begin{array}{rl} 1 & \text{si }(a_i,a_j)\in \Arc(\G)\text{,}\\ 0 & \text{sinon.} \end{array} \right.\]
Dans le cas orienté.
Par exemple : \[ \xymatrix@C=2cm@R=2cm{ a\ar[r]\ar@/^2pc/[rr]&b\ar@(ur,dr)[]&c\ar[dl]&\\ &d\ar[ul]\ar[r]\ar@/_2pc/[rr]&e\ar[ull]&f\ar[ulll] } \] \[ \begin{array}{c|cccccc} &a&b&c&d&e&f\\\hline a&0&1&1&0&0&0\\ b&0&1&0&0&0&0\\ c&0&0&0&1&0&0\\ d&1&0&0&0&1&1\\ e&1&0&0&0&0&0\\ f&1&0&0&0&0&0 \end{array} \] \[ \xymatrix@C=2cm@R=2cm{ a\ar@{-}[d]\ar@{-}[dr]\ar@{-}[drr]\ar@{-}@/^2pc/[rr]&b\ar@{-}[d]\ar@{-}[r]&c\ar@{-}[dll]\\ f&e&d } \] \[ \begin{array}{c|cccccc} &a&b&c&d&e&f\\\hline a&0&0&1&1&1&1\\ b&0&0&1&0&1&0\\ c&1&1&0&0&0&1\\ d&1&0&0&0&0&0\\ e&1&1&0&0&0&0\\ f&1&0&1&0&0&0 \end{array} \]

Proposition


La matrice booléenne d'un graphe non orienté est une matrice carré symétrique à diagonale nulle.

Démonstration

Si \( \{a_i,a_j\}\) est une arête alors \( \{a_j,a_i\}\) également (l'ordre des éléments dans un ensemble ne compte pas). De plus \( \{a_i, a_i\}\) ne peut jamais être une arête (les arêtes sont des ensembles à deux éléments or \( \{a_i, a_i\}=\{a_i\}\) ).

Définition


Soit \( \G\) un graphe orienté. On note \( \nonor{\G}\) le graphe non orienté associé à \( \G\) et défini par : \[\Som(\nonor{\G})=\Som(\G),\qquad\Ar(\nonor{\G})=\left\{\{x,y\}\big|x\neq y \wedge (x,y)\in Arc(\G)\right\}\]
Pour "désorienter" un graphe, il suffit d'enlever les boucles et les flèches de sa représentation sagittale. \[ \xymatrix@C=2cm@R=2cm{ a\ar[r]\ar@/^2pc/[rr]&b\ar@(ur,dr)[]&c\ar[dl]&\\ &d\ar[ul]\ar[r]\ar@/_2pc/[rr]&e\ar[ull]&f\ar[ulll] } \] \[ \xymatrix@C=2cm@R=2cm{ a\ar@{-}[r]\ar@/^2pc/@{-}[rr]&b&c\ar@{-}[dl]&\\ &d\ar@{-}[ul]\ar@{-}[r]\ar@/_2pc/@{-}[rr]&e\ar@{-}[ull]&f\ar@{-}[ulll] } \] Pour la représentation matricielle, le procédé est un peu plus compliqué : il faut tout d'abord mettre des \( 0\) sur la diagonale (ce qui correspond à enlever les boucles) et rendre la matrice symétrique. \[ \begin{array}{c|cccccc} &a&b&c&d&e&f\\\hline a&0&1&1&0&0&0\\ b&0&1&0&0&0&0\\ c&0&0&0&1&0&0\\ d&1&0&0&0&1&1\\ e&1&0&0&0&0&0\\ f&1&0&0&0&0&0 \end{array}\quad\Longrightarrow \] \[ \begin{array}{c|cccccc} &a&b&c&d&e&f\\\hline a&0&1&1&0&0&0\\ b&0&\color{red}{0}&0&0&0&0\\ c&0&0&0&1&0&0\\ d&1&0&0&0&1&1\\ e&1&0&0&0&0&0\\ f&1&0&0&0&0&0 \end{array}\quad\Longrightarrow \] \[ \begin{array}{c|cccccc} &a&b&c&d&e&f\\\hline a&0&1&1&\color{red}{1}&\color{red}{1}&\color{red}{1}\\ b&\color{red}{1}&0&0&0&0&0\\ c&\color{red}{1}&0&0&1&0&0\\ d&1&0&\color{red}{1}&0&1&1\\ e&1&0&0&\color{red}{1}&0&0\\ f&1&0&0&\color{red}{1}&0&0 \end{array}\qquad\qquad \]