PCC
Reduc11

Description

This is a LaTeX code that creates a diagram using the TikZ package. The code begins with defining the document class as standalone and including the TikZ package. Then, a TikZ environment is initiated and the node distance is set to 1.5 cm.

The diagram consists of a central node "r" with six surrounding nodes named "r1a", "r2a", "r2b", "r3a", "r3b", and "r4a". Each node is defined as a circle with black border, white filling, and minimum size of 10pt. The positions of the nodes are specified using the "right of", "above right of", and "above of" commands.

In addition, the diagram includes a "blank node" "t" positioned below and to the right of the central node "r", with two connected nodes "t1" and "t2a" and "t2b" positioned to the right and above right of "t1". The connections between nodes are established using the "draw" command with the appropriate starting and ending points. The text labels above the lines are set using the "node" command.

Overall, the diagram represents a tree-like structure with a central node and several sub-nodes connected to it, and a separate node connected to the central node through a separate path.

Keywords

tikz, standalone, node distance, positioning, circle, draw, black, fill, white, inner sep, minimum size, right of, above right of, above of, below right of, node, extension, blank node, below, small, arrow, thick.

Source Code

PCC

\documentclass[tikz]{standalone}
\tikzset{near start abs/.style={xshift=1cm}}
 
\usetikzlibrary{positioning}
\begin{document}
\begin{tikzpicture}[node distance=1.5cm]
    % place nodes
    \node[circle,draw=black, fill=white, inner sep=0pt,minimum size=10pt] (r) {};
    \node[circle,draw=black, fill=white, inner sep=0pt,right of=r, minimum size=10pt] (r1a)  {};
    \node[circle,draw=black, fill=white, inner sep=0pt,above right of=r, minimum size=10pt] (r2a)  {};
    \node[circle,draw=black, fill=white, inner sep=0pt,right of=r2a, minimum size=10pt] (r2b)  {};
    \node[circle,draw=black, fill=white, inner sep=0pt,above of=r2a, minimum size=10pt] (r3a)  {};
    \node[circle,draw=black, fill=white, inner sep=0pt,right of=r3a, minimum size=10pt] (r3b)  {};
    \node[circle,draw=black, fill=white, inner sep=0pt,above right of=r3a, minimum size=10pt] (r4a)  {};
    \node[circle,draw=black, fill=white, inner sep=0pt,right of=r4a, minimum size=10pt] (r4b)  {};
    % Extension from 7 nodes
    % Blank node
    \node[inner sep=0pt,below right of=r, minimum size=10pt] (t)  {};
    \node[circle,draw=black, fill=white, inner sep=0pt,below right of=t, minimum size=10pt] (t1)  {};
    \node[circle,draw=black, fill=white, inner sep=0pt,above right of=t1, minimum size=10pt] (t2a)  {};
    \node[circle,draw=black, fill=white, inner sep=0pt,right of=t1, minimum size=10pt] (t2b)  {};
    \draw (r) -- node[above] {\small{1}} ++(r1a);
    \draw (r) -- node[above] {\small{2}} ++(r2a);
    \draw (r3a) -- node[above] {\small{3}} ++(r);
    \draw (r2a) -- node[above] {\small{1}} ++(r2b);
    \draw (r3a) -- node[above] {\small{1}} ++(r3b);
    \draw (r3a) -- node[above] {\small{2}} ++(r4a);
    \draw (r4a) -- node[above] {\small{1}} ++(r4b);
    
    \draw[->, thick] (r) -- node[above] {\small{4}} ++(t1);
    \draw (t1) -- node[above] {\small{3}} ++(t2a);
    \draw (t1) -- node[above] {\small{2}} ++(t2b);
\end{tikzpicture}
\end{document}
Deploy to Overleaf