\shorthandoff{:} 
%%%%%%%%%%%%%%%%%%%%% Styles %%%%%%%%%%%%%%%%%%%%%
\pgfdeclarelayer{background}
\pgfsetlayers{background,main}
\tikzstyle{preno}=[semithick] % arêtes non orientées.
\tikzstyle{pre}=[->,>=stealth,semithick] % arêtes orientées.
\tikzstyle{select}=[-,cap=round,style=nearly transparent,line width=6pt] %
\tikzstyle{fl_actif}=[-,cap=round,style=nearly transparent,line width=6pt,color=black!50!red]
\tikzstyle{blanc} =[circle,thick,inner sep=0pt,minimum size=6mm,node distance=20mm,draw=black!50,fill=blue!2,text=red]
\tikzstyle{gris}=[circle,thick,inner sep=0pt,minimum size=6mm,node distance=20mm,draw=black!50,fill=black!20,text=red]
\tikzstyle{noir}   = [circle,thick,inner sep=0pt,minimum size=6mm,node
distance=20mm,draw=black!80,fill=black!100, text=red!50]

\begin{center}
\begin{tikzpicture}[>=stealth,scale=1]
  \node[gris]       (0)                      {0};
  \node[blanc]      (1)        [right of=0]  {1};
  \node[blanc]      (2)        [right of=1]  {2};
  \node[blanc]      (3)        [above of=1]  {3};
  \node[blanc]      (4)        [above left of=0]  {4};
  \node[blanc]      (5)        [below of=0]  {5};
  \node[blanc]      (6)        [below of=1]  {6};
  \node[blanc]      (7)        [left of=0]  {7};
% flèches soulignées.
\begin{pgfonlayer}{background}

\end{pgfonlayer}
% flèches 
\draw[pre] (0) to node[auto]      {} (1) ;
\draw[pre] (0) to node[auto,swap] {} (3) ;
\draw[pre] (0) to node[auto,swap] {} (7) ;
\draw[pre] (1) to node[auto,swap] {} (2) ;
\draw[pre] (1) to node[auto,swap] {} (5) ;
\draw[pre] (2) to node[auto,swap] {} (3) ;
\draw[pre] (3) to node[auto,swap] {} (1) ;
\draw[pre] (4) to node[auto,swap] {} (0) ;
\draw[pre, bend right=20] (5) to node[auto,swap] {} (6) ;
\draw[pre] (5) to node[auto,swap] {} (7) ;
\draw[pre, bend right=20] (6) to node[auto,swap] {} (5) ;
\draw[pre] (6) to node[auto,swap] {} (1) ;
\draw[pre] (7) to node[auto,swap] {} (4) ;
\end{tikzpicture}
\end{center}



%%% Trop récent

%%% Arbres :

% https://tikz.dev/tikz-trees
\begin{tikzpicture}
  \node {root} [grow'=up]
    child {node {left}}
    child {node {right}
      child {node {child}}
      child {node {child}}
    };
\end{tikzpicture}

\begin{tikzpicture}
  [level distance=10mm,
   every node/.style={fill=red!60,circle,inner sep=1pt},
   level 1/.style={sibling distance=20mm,nodes={fill=red!45}},
   level 2/.style={sibling distance=10mm,nodes={fill=red!30}},
   level 3/.style={sibling distance=5mm,nodes={fill=red!25}}]
  \node {31}
     child {node {30}
       child {node {20}
         child {node {5}}
         child {node {4}}
       }
       child {node {10}
         child {node {9}}
         child {node {1}}
       }
     }
     child {node {20}
       child {node {19}
         child {node {1}}
         child[missing]
       }
       child {node {18}}
     };
\end{tikzpicture}

%%% Graphes
% Généralités :

\usetikzlibrary {graphs,quotes}  %quotes (graphe pondéré) : trop récent
\tikz
  \graph [edge quotes={fill=white,inner sep=1pt},
          grow down, branch right, nodes={circle,draw}] {
    "" -> h [>"9"] -> {
      c [>"4"] -> {
        a [>"2"],
        e [>"0"]
      },
      j [>"7"]
    }
  };

% Layout : 

\usetikzlibrary {graphs,graphdrawing} \usegdlibrary {force} 
 \tikz \graph [random seed=10, spring layout] {
   a -- {b, c, d} -- e -- f -- {g,h} -- {a,b,e};
 };

\tikz \graph [spring electrical layout', coarsen, vertical=3 to 4]
  {
    { [clique] 1, 2 } -- 3 -- 4 -- { 5, 6, 7 }
  };

