0

I need help to draw this in Latex. All the connected arrows are meant to be singular arrows. Apologies to be bad writing but I also need these additional arrows and numbers.

I am not sure how to do this so any help would be greatly appreciated. Thank you!

System of machines

3

1 Answer 1

3

I will be happy to remove this if you feel that this is not an adequate start. You may use this to ask a new question. Yet I will be reluctant to address additional requests here.

\documentclass[tikz,border=3.14mm]{standalone}
\usetikzlibrary{positioning,quotes}
\begin{document}
\begin{tikzpicture}[box/.style={draw,minimum width=1cm,minimum height=8mm},font=\sffamily]
 \begin{scope}[every node/.style={box}]
  \node (1){1};
  \node[right=1cm of 1] (5){5};
  \node[below=3mm of 5] (6){6};
  \node[above=11mm of 5] (2){2};
  \node[above=2mm of 2,xshift=8mm] (4){4};
  \node[right=1cm of 2] (3){3};
  \node[right=2.5cm of 5] (7){7};
  \node[right=1cm of 7] (8){8};
  \node[above=2mm of 8] (9){9};
  \node[below=2mm of 8] (10){10};
 \end{scope}
 \begin{scope}[every edge/.append style={-latex},auto,
  hv/.style={to path={-| (\tikztotarget) \tikztonodes}},
  vh/.style={to path={|- (\tikztotarget) \tikztonodes}},
  hvh/.style args={#1/#2/#3}{to path={-| ([xshift=#1]\tikztotarget)
  node[pos=0.75,#3]{#2} --(\tikztotarget) \tikztonodes}},]
  \draw (1) ++ (-1,0) edge (1) 
  (1) edge[vh] (2) (4) edge[hv] (2) (3) edge[vh,"0.4" right] (4)
  (1) edge (5) (2) edge (3) (5) edge (7) (7) edge (8) (8) edge ++ (2.2,0)
  (3) edge[hv] (7)
   (9) edge[hvh={-3mm//}] (8.160) (8.200) edge[hvh={-3mm//}] (10.180)
   (8.20) edge[hvh={7mm/0.3/}] (9.0)  (8.-20) edge[hvh={5mm/0.2/}] (10.0);
 \end{scope}
 \begin{scope}[-latex]
  \draw (1.south) -- ++ (-45:0.6) node[pos=1.35]{0.2};
  \draw (2.south) -- ++ (-135:0.6) node[pos=1.35]{0.4};
  \draw (3.south) -- ++ (-45:0.6) node[pos=1.35]{0.2};
  \draw (4.north) -- ++ (45:0.6) node[pos=1.35]{0.2};
  \draw (5.north) -- ++ (45:0.6) node[pos=1.35]{0.1};
  \draw (6.south) -- ++ (-45:0.6) node[pos=1.35]{0.2};
  \draw (7.south) -- ++ (-45:0.6) node[pos=1.35]{0.1};
  \draw (8.10) -- ++ (0.8,0) -- ++ (45:0.6) node[pos=1.35]{0.2};
  \draw (9.north) -- ++ (45:0.6) node[pos=1.35]{0.3};
  \draw (10.south) -- ++ (-45:0.6) node[pos=1.35]{0.1};
 \end{scope}
\end{tikzpicture}
\end{document}

enter image description here

3
  • 1
    thank you so much! I am going to open a new question on how to assign "weights" to the lines. Jan 30, 2019 at 3:11
  • 1
    @BrandonHaberman I quickly added some. (And I fear your follow-up question may not be very well-received by everyone because some may feel you should try yourself first.)
    – user121799
    Jan 30, 2019 at 3:37
  • Thank you for the comments. I was trying to add the weights but it was not working properly. Do you have advice on how to approach this for next time? Jan 30, 2019 at 4:01

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .