[TiKZ] Exemple de graphes

\begin{tikzpicture}[->,>=stealth,shorten >=1pt,node distance=2.8cm,
semithick]
\node (A) [circle,draw,fill=white,text=black] {$A$};
\node (B) [circle,draw,above left of=A,fill=white,text=black] {$B$}
\node (C) [circle,draw,above right of=A,fill=white,text=black] {$C$};
\node (D) [circle,draw,right of=A,fill=white,text=black] {$D$};
\node (E) [circle,draw,left of=A,fill=white,text=black] {$E$};
\node (F) [circle,draw,below of=A,fill=white,text=black] {$F$};
\node (G) [circle,draw,right of=F,fill=white,text=black] {$G$};
\node (H) [circle,draw,right of=G,fill=white,text=black] {$H$};


\path (A) edge node[midway,fill=white] {$1$} (B);
\path (B) edge node[midway,fill=white] {$5$} (E);
\path (E) edge node[midway,fill=white] {$8$} (A);
\path (B) edge node[midway,fill=white] {$2$} (C);
\path (C) edge node[midway,fill=white] {$10$} (A);
\path (A) edge node[midway,fill=white] {$14$} (D);
\path (C) edge node[midway,fill=white] {$10$} (D);
\path (A) edge node[midway,fill=white] {$10$} (F);
\path (A) edge node[midway,fill=white] {$25$} (G);
\path (F) edge node[midway,fill=white] {$10$} (G);
\path (G) edge node[midway,fill=white] {$35$} (H);
\path (D) edge node[midway,fill=white] {$40$} (H);
\end{tikzpicture}
Ce contenu a été publié dans ArTICE, Blog, LaTeX/TikZ, avec comme mot(s)-clé(s) , . Vous pouvez le mettre en favoris avec ce permalien.

Laisser un commentaire

Votre adresse e-mail ne sera pas publiée. Les champs obligatoires sont indiqués avec *