-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsoluzione_esercitazione_1.tex
34 lines (32 loc) · 1.35 KB
/
soluzione_esercitazione_1.tex
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
% !TEX TS-program = lualatex
\documentclass{standalone}
\usepackage{tikz}
\usepackage{pgf}
\usepackage{pgfcore}
\usepackage{pgfplots}
\usepackage{amsmath}
\usepackage{amsfonts}
\usetikzlibrary{graphs,graphdrawing,calc}
\pgfplotsset{compat=1.18}
\begin{document}
\usegdlibrary{trees}
\tikz[tree layout, nodes={circle, thick}, inner sep=0.5pt]
\node[green, draw, text=black] {$s_0$}
child { node[draw] {$s_1$} edge from parent node[fill=white]{$5$}
child { node[draw] {$s_3$} edge from parent node[fill=white]{$3$}
child { node[ draw, text=black] {$s_2$} edge from parent node[fill=white]{$4$}}
child { node[, draw, text=black] {$s_4$} edge from parent node[fill=white]{$4$}}
child { node[, draw, text=black] {$s_5$} edge from parent node[fill=white]{$6$}}
}
child [missing]
}
child { node[green, draw, text=black] {$s_2$} edge from parent node[fill=white]{$3$}
child { node[green, draw, text=black] {$s_4$} edge from parent node[fill=white]{$5$}
child { node[draw] {$s_2$} edge from parent node[fill=white]{$5$}}
child { node[draw] {$s_3$} edge from parent node[fill=white]{$4$}}
child { node[green, draw, text=black] {$s_5$} edge from parent node[fill=white]{$3$}}
}
child { node[draw] {$s_0$} edge from parent node[fill=white]{$5$}}
}
;
\end{document}