¿Cómo puedo escribir texto encima de los bordes?

¿Cómo puedo escribir texto encima de los bordes?

Tengo el siguiente código para dibujar un gráfico con aristas dirigidas:

\begin{tikzpicture}
% vertices
\node[vertex] (1) at  (0,0) {$\times$};
\node[below left=1cm of 1] (A) {};
\node[below right=1cm of 1] (B) {};
\node[vertex] (2) at  (2,0) {$+$};
\node[below left=1cm of 2] (C) {};
\node[below right=1cm of 2] (D) {};
\node[vertex] (3) at  (4,0) {$\times$};
\node[below left=1cm of 3] (E) {};
\node[below right=1cm of 3] (F) {};
\node[vertex] (4) at  (1,2) {$+$};
\node[vertex] (5) at  (3,2) {$\times$};
\node[vertex] (6) at  (2,4) {$+$};
\node[above=1cm of 6] (G) {};
%edges
\draw[edge] (1) to (4);
\draw[edge] (1) to (5);
\draw[edge] (2) to (4);
\draw[edge] (3) to (5);
\draw[edge] (4) to (6);
\draw[edge] (5) to (6);
\draw[edge] (A) to (1);
\draw[edge] (B) to (1);
\draw[edge] (C) to (2);
\draw[edge] (D) to (2);
\draw[edge] (E) to (3);
\draw[edge] (F) to (3);
\draw[edge] (6) to (G);
\end{tikzpicture}

con estas opciones

\tikzset{vertex/.style = {shape=circle,draw,minimum size=1.5em}}
\tikzset{edge/.style = {->,> = latex'}}

lo que da como resultado el siguiente gráfico

ingrese la descripción de la imagen aquí

¿Hay alguna manera de agregar texto encima, debajo... de cada borde? Además, ¿podría escribir el texto de manera que quede centrado con respecto al documento, en lugar del borde mismo?

Respuesta1

ingrese la descripción de la imagen aquí

\documentclass{standalone}
\usepackage{tikz}

\usetikzlibrary{calc,positioning,angles,arrows.meta,quotes,intersections}
\usetikzlibrary{through}

\begin{document}

\begin{tikzpicture}\tikzset{vertex/.style = {shape=circle,draw,minimum size=1.5em}}
\tikzset{edge/.style = {->}}
% vertices
\node[vertex] (1) at  (0,0) {$\times$};
\node[below left=1cm of 1] (A) {};
\node[below right=1cm of 1] (B) {};
\node[vertex] (2) at  (2,0) {$+$};
\node[below left=1cm of 2] (C) {};
\node[below right=1cm of 2] (D) {};
\node[vertex] (3) at  (4,0) {$\times$};
\node[below left=1cm of 3] (E) {};
\node[below right=1cm of 3] (F) {};
\node[vertex] (4) at  (1,2) {$+$};
\node[vertex] (5) at  (3,2) {$\times$};
\node[vertex] (6) at  (2,4) {$+$};
\node[above=1cm of 6] (G) {};
%edges
\draw[edge] (1) to node[left, sloped,xshift=4pt,yshift=4pt]{\tiny AA}(4);%<---instead of left can use right/ above/ below
\draw[edge] (1) to (5);
\draw[edge] (2) to (4);
\draw[edge] (3) to (5);
\draw[edge] (4) to (6);
\draw[edge] (5) to (6);
\draw[edge] (A) to (1);
\draw[edge] (B) to (1);
\draw[edge] (C) to (2);
\draw[edge] (D) to (2);
\draw[edge] (E) to (3);
\draw[edge] (F) to (3);
\draw[edge] (6) to (G);
\end{tikzpicture}
 \end{document}

información relacionada