I want to draw a graph, where nodes will be rectangular in shape, inside them I want to have some text, and some of the nodes should even be filled with a specific color of my choice. Apart from these, I also want to have a a small text right where the edge starts, something like in the picture below.
And as I said the nodes are rectangular. I tried something like below, but it doesn't even display anything. Any ideas how to achieve stuff I want?
\usepackage{tikz}
\usetikzlibrary{shapes}
\begin{document}
\begin{figure}[H]
\begin{tikzpicture}[auto,node distance=5 cm, scale=1, transform shape]
\node[rectangle] (1) {1};
\node[rectangle] (2) {2};
\node[rectangle] (3) {3};
\path[->] (1) edge [left] node (2)
(1) edge [right] node (3);
\end{tikzpicture}
\end{figure}
\end{document}