enter image description here

Would appreciate if anyone help me draw this network? Thank you in advance.

  • 1
    Can you let us know how is this different from this old question of yours? tex.stackexchange.com/q/243919/32374 You've provided us with no code to go by... – darthbith May 21 '15 at 20:09
  • My only problem is how to make the second set of trees straight and horizontal and not sloped in the previous diagram. Thank you. – user28251 May 21 '15 at 20:18
  • 1
    This answer tex.stackexchange.com/a/166303/32374 that was linked on your previous question shows some straight lines... can you duplicate that? If not, you need to be quite specific about what you can't do, in particular, by providing code that shows something close to what you want, but not quite. – darthbith May 21 '15 at 20:48

You can start with this and add/remove different items

\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}] 

enter image description here

  • 4
    @user28251 my pleasure but please try to give us at least a code attempt next time. Believe it or not typing those first two lines is a torture for every question here. – percusse May 21 '15 at 20:59
  • Sure, I will exactly that next time. – user28251 May 21 '15 at 21:04

A short code with pstricks and etoolbox:

\documentclass[pdf, x11names, a4paper]{article}



    \psset{xunit=2.5, tickstyle=top, ticksize=6pt, tickwidth=0.6pt, labels=none, labelsep=4pt, dotsize=5pt, linecolor=LightSteelBlue3, tickcolor=LightSteelBlue3}
        \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}}}



enter image description here


Since it is a tree, you should have a forest...


      for tree={
        l sep+=50pt,
        minimum width = 2.5pt,
        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]}
        append = {[[[]]]}




Here's a way to do it for anyone interested in using asymptote.

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);
for (int x = 0; x <= 4; ++x)
    label("$t="+string(x)+"$", (x,0), S);

enter image description here

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.