Как кто-то предположил, TikZ может быть излишним, но это работает.
\documentclass{article}
\usepackage{tikz}
\begin{document}
\begin{tikzpicture}
\draw (0,0) node[anchor=east]{a} -- (0.4,0) node[anchor=west]{b};
\draw (0.2,0) node[anchor=north]{1};
\draw (2,0) node[anchor=east]{b} -- (2.4,0) node[anchor=west]{c};
\draw (2.2,0) node[anchor=north]{3};
\draw (4,0) node[anchor=east]{c} -- (4.4,0) node[anchor=west]{e};
\draw (4.2,0) node[anchor=north]{5};
\end{tikzpicture}
\end{document}
РЕДАКТИРОВАТЬ: На самом деле, это, вероятно, проще и делает то, что вы хотите:
\[ \left. \begin{array}{ccc}
{a-b \atop 1} & {b-c \atop 3} & {c-e \atop 5}
\end{array} \right. \]
Вы можете сравнить для себя: tikzedgeweights.pdf