enter image description here

I am new to Latex, i have to draw above diagram in latex. Can any one please help me, How to draw above network diagram in Latex.

  • I am new to latex. i don't have any code for above image. I was searching in net but i didn't get any related code for above image. can you help how to draw above diagram in latex. Dec 2, 2015 at 20:15
  • You might consider the Ipe drawing editor, which has nice LaTeX integration and would likely be faster than coding such a diagram by hand in PGF/TikZ.
    – G. Poore
    Dec 2, 2015 at 20:47

2 Answers 2


You can have that with pstricks. It can be compiled with pdflatex if you launch it with the switch --enable-write18 (MiKTeX) or --shell-escape (TeX Live, MacTeX).

\documentclass[border=3pt, x11names]{standalone}


    \psset{linewidth=0.5pt, dotsize=4pt, linecolor=SlateGray3, yunit=0.5, arrowinset=0.15, shortput=nab, linejoin =1}
    \multido{\i=2 + 1}{4}{\dotnode[href = 2ex, vref = 2ex](0,\i){A\i}}
    \multido{\i=2 + 1}{4}{\dotnode[href = 2ex, vref = 2ex](0,-\i){B\i}}
    \uput[u](0,4.5){\em item}
    \uput[u](4,4.5){\em container}
    \psset{linecolor=black, arrows=-> , arrowinset=0.15, labelsep=1pt, npos=0.6}
    \ncline{B5}{C1}\naput{$\mathrm {j\times i}$}
    \psset{braceWidthInner=3pt,braceWidthOuter=3pt, braceWidth =0.6pt, nodesepA =-5pt}
    \psbrace[rot=180](A’)(B’){$ j $}
    \psbrace[nodesepA=1pt](C)(D){$ i $}
    \psset{linestyle=dotted, linewidth=0.8pt, linecolor=black, arrows=-, nodesep=8pt}
    \pcline[offset=2.4cm, nodesep =-3pt](C1)(C2)


enter image description here


Here's a version done with luamplib using the TeX Gyre Termes fonts. Process with lualatex.

enter image description here

\setmainfont{TeX Gyre Termes}
\setmathfont{TeX Gyre Termes Math}
u := 20;
z0 = (u,u); z1 = (7u,u);
label(btex \textit{item}      etex, z0);
label(btex \textit{container} etex, z1);

path a[], c; picture dot;
a1 = (x0, 0)  -- (x1, 0);
a2 = (x0, 0)  -- (x1,-1.2u);
a3 = (x0, 0)  -- (x1,-2.4u);
a4 = (x0,-8u) -- (x1,-3.6u);
c = fullcircle scaled 4;
dot = image(fill c withcolor .67[blue, white]; draw c);

label.top(btex $1$ etex, point 0.6 of a1);
label.top(btex $2$ etex, point 0.6 of a2);
label.top(btex $3$ etex, point 0.6 of a3);
label.ulft(btex $j\times i$ etex, point 0.68 of a4);
label(btex $\vdots$ etex, 1/3[point 0.6 of a3, point 0.6 of a4]);
label(btex $\vdots$ etex, 1/2[point 0 of a1, point 0 of a4]);

for i=1 upto 4:
  drawarrow a[i] cutafter c shifted point 1 of a[i];
for i=1 upto 4:
  draw dot shifted point 1 of a[i];
  draw dot shifted point 0 of a1 shifted (0,u*(1-i));
  draw dot shifted point 0 of a4 shifted (0,u*(i-1));

vardef vbrace(expr a,b,n,m,s) =
  save offset, midpoint, bearing; 
  pair offset, midpoint, bearing; 
  offset = right scaled n;
  midpoint = 1/2[a,b] shifted (m,0);
  bearing = unitvector(b-a);
  (a {offset} ... 
  1/2[a,midpoint]{bearing} ... 
  {-offset} ... 
  1/2[midpoint,b]{bearing} ...
  {-offset} b) shifted offset

draw vbrace(point 0 of a1, point 0 of a4, -5, -12, btex $j$ etex);
draw vbrace(point 1 of a1, point 1 of a4,  5,  12, btex $i$ etex);


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.