如果有人能帮我画出这个网络,我将不胜感激。先谢谢了。
答案1
您可以从此开始并添加/删除不同的项目
\documentclass[tikz]{standalone}
\begin{document}
\begin{tikzpicture}[c/.style 2 args={insert path={node[n={#1}{#2}] (n#1#2){}}},
n/.style 2 args={circle,fill,inner sep=1pt,label={90:$D(#1,#2)$}}
]
\path (-2,4.5)[c={1}{1}];
\foreach\y in{1,...,8}{
\draw (n11) -- (2,\y)[c={2}{\y}] -- (4,\y) [c={3}{\y}] -- (6,\y) [c={4}{\y}]
node[right]{Scen\y};}
\end{tikzpicture}
\end{document}
答案2
pstricks
带有和 的简短代码etoolbox
:
\documentclass[pdf, x11names, a4paper]{article}
\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
\usepackage[charter]{mathdesign}
\usepackage{etoolbox}
\usepackage{pstricks-add}
\begin{document}
\begin{pspicture}$
\psset{xunit=2.5, tickstyle=top, ticksize=6pt, tickwidth=0.6pt, labels=none, labelsep=4pt, dotsize=5pt, linecolor=LightSteelBlue3, tickcolor=LightSteelBlue3}
\psaxes[linewidth=0.6pt,](0,0.3)(4,0.3)
\dotnode[linecolor=SteelBlue4!80!](1,4.5){D11}\uput[ul](D11){D_{1,1}}
\multido{\ic=2+1}{3}{\multido{\il=8+-1,\im=1+1}{8}{%
\dotnode[linecolor=SteelBlue4!80!](\ic,\il){D\ic\im}
\ifnumless{\ic}{3}{\uput[55](D\ic\im){D(\ic, \im)}}{\uput[120](D\ic\im){D(\ic, \im)}}
}%
}
\multido{\i=0+1}{5}{\uput[d](\i, 0){t = \i}}
\multido{\im=1+1}{8}{\ncline{D11}{D2\im}\ncline{D2\im}{D3\im}\ncline{D3\im}{D4\im}\uput[r](D4\im){\enspace\textrm{Scen \im}}}
\ncline{D11}{D1}
$\end{pspicture}
\end{document}
{}
答案3
因为它是一棵树,所以你应该有一个forest
......
\documentclass[tikz,border=5pt,multi]{standalone}
\usepackage{forest}
\begin{document}
\begin{forest}
delay={
for tree={
grow'=0,
l sep+=50pt,
circle,
minimum width = 2.5pt,
fill,
inner sep = 0pt,
parent anchor = center,
child anchor = center,
tier/.wrap pgfmath arg={tier #1}{level()},
delay n=1{
if level=1{
label/.wrap 2 pgfmath args={[font=\footnotesize]above right:$D(#1,#2)$}{int(level()+1)}{n},
}{
if level=0{
label={[font=\footnotesize]above left:$D(1,1)$}
}{
label/.wrap 2 pgfmath args={[font=\footnotesize]above left:$D(#1,#2)$}{int(level()+1)}{n("!to tier=tier 1")},
if n children=0{
l sep+=-70pt,
append={[, font=\footnotesize, content/.wrap pgfmath arg={Scen #1}{n("!to tier=tier 1")}, no edge]}
}{},
}
}
}
}
},
[,
repeat=8{
append = {[[[]]]}
},
]
\end{forest}
\end{document}
答案4
对于有兴趣使用的人来说,这是一种可行的方法asymptote
。
unitsize(1inch);
pair d11 = (1, 1.5);
label("$D$(1,1)", d11, NW);
for (int y = 1; y <= 8; ++y)
{
path p = d11;
pair d;
for (int x = 2; x <= 4; ++x)
{
d = (x, (9-y)/3.0);
p = p--d;
label("$D$("+string(x)+","+string(y)+")", d+(0,0.1), (3-x,0));
}
label("Scen "+string(y), d, 2*E);
draw(p);
dot(p);
}
draw((0,0)--(4,0));
for (int x = 0; x <= 4; ++x)
{
draw((x,0)--(x,0.1));
label("$t="+string(x)+"$", (x,0), S);
}