% \tikzset{ % scale=1.0, % font=\normalsize, % level distance=1.2cm, % level 1/.style={sibling distance=2.4cm}, % level 2/.style={sibling distance=0.95cm}, % level 3/.style={sibling distance=0.95cm}, % every node/.style={font=\normalsize}, % leaf/.style={circle, draw=blue!50!black, fill=blue!10, minimum size=7mm, line width=0.7pt, % drop shadow={opacity=0.3, shadow xshift=1.5pt, shadow yshift=-1.5pt}}, % internal/.style={circle, draw=gray!70!black, fill=gray!10, minimum size=8mm, line width=0.7pt, % drop shadow={opacity=0.3, shadow xshift=1.5pt, shadow yshift=-1.5pt}}, % edge from parent/.style={draw, line width=0.8pt, gray!60} % } % \begin{tikzpicture} \begin{tikzpicture}[ scale=1.0, font=\normalsize, level distance=1.2cm, level 1/.style={sibling distance=2.4cm}, level 2/.style={sibling distance=0.95cm}, level 3/.style={sibling distance=0.95cm}, every node/.style={font=\normalsize}, leaf/.style={circle, draw=blue!50!black, fill=blue!10, minimum size=7mm, line width=0.7pt, drop shadow={opacity=0.3, shadow xshift=1.5pt, shadow yshift=-1.5pt}}, internal/.style={circle, draw=gray!70!black, fill=gray!10, minimum size=8mm, line width=0.7pt, drop shadow={opacity=0.3, shadow xshift=1.5pt, shadow yshift=-1.5pt}}, edge from parent/.style={draw, line width=0.8pt, gray!60} ] % ========================================== % PANEL A: By Node (4 groups: u1, u2, u3, u4) % DFS order: u1 -> u2 -> u3 -> u4 % ========================================== \begin{scope}[xshift=0cm] \node[font=\bfseries\Large] at (0, 1.2) {By Node}; % Tree: u1 -> {1, u2, u3}, u2 -> {2, 3}, u3 -> {u4, 6, 7}, u4 -> {4, 5} \node[internal, fill=red!15, draw=red!60!black] (u1) at (0, 0) {$u_1$} child {node[leaf] (l1) {$1$}} child {node[internal, fill=green!15, draw=green!60!black] (u2) {$u_2$} child {node[leaf] (l2) {$2$}} child {node[leaf] (l3) {$3$}} } child {node[internal, fill=orange!15, draw=orange!60!black] (u3) {$u_3$} child {node[internal, fill=cyan!15, draw=cyan!60!black] (u4) {$u_4$} child {node[leaf] (l4) {$4$}} child {node[leaf] (l5) {$5$}} } child {node[leaf] (l6) {$6$}} child {node[leaf] (l7) {$7$}} }; % V box - 6 coordinates: u1(2), u2(1), u3(2), u4(1) \begin{scope}[yshift=-5.0cm] % Braces above \draw[decorate, decoration={brace, amplitude=4pt}, line width=0.6pt, red!60!black] (-2.7, 0.15) -- (-0.9, 0.15) node[midway, above=4pt, font=\small, text=red!60!black] {$u_1$}; \draw[decorate, decoration={brace, amplitude=4pt}, line width=0.6pt, green!60!black] (-0.9, 0.15) -- (0.0, 0.15) node[midway, above=4pt, font=\small, text=green!60!black] {$u_2$}; \draw[decorate, decoration={brace, amplitude=4pt}, line width=0.6pt, orange!60!black] (0.0, 0.15) -- (1.8, 0.15) node[midway, above=4pt, font=\small, text=orange!60!black] {$u_3$}; \draw[decorate, decoration={brace, amplitude=4pt}, line width=0.6pt, cyan!60!black] (1.8, 0.15) -- (2.7, 0.15) node[midway, above=4pt, font=\small, text=cyan!60!black] {$u_4$}; % Frame background \draw[fill=white, drop shadow={opacity=0.1}] (-2.7, 0) rectangle (2.7, -0.7); % Colored sections: 2 + 1 + 2 + 1 = 6 coords \fill[red!15] (-2.7, 0) rectangle (-0.9, -0.7); \fill[green!15] (-0.9, 0) rectangle (0.0, -0.7); \fill[orange!15] (0.0, 0) rectangle (1.8, -0.7); \fill[cyan!15] (1.8, 0) rectangle (2.7, -0.7); % Grid lines (6 cells) \draw[gray!30] (-1.8, 0) -- (-1.8, -0.7); \draw[gray!30] (-0.9, 0) -- (-0.9, -0.7); \draw[gray!30] (0.0, 0) -- (0.0, -0.7); \draw[gray!30] (0.9, 0) -- (0.9, -0.7); \draw[gray!30] (1.8, 0) -- (1.8, -0.7); % Frame \draw[thick] (-2.7, 0) rectangle (2.7, -0.7); % Label \node[font=\large, anchor=north] at (0, -0.9) {$V \in \mathbb{R}^{7 \times 6}$}; \end{scope} \end{scope} % Separator 1 \draw[gray!20, line width=1.5pt] (5.0, 1.4) -- (5.0, -6.6); % ========================================== % PANEL B: By Depth (3 groups: depth 0, 1, 2) % ========================================== \begin{scope}[xshift=9.2cm] \node[font=\bfseries\Large] at (0, 1.2) {By Depth}; % Tree with depth coloring: depth 0 = u1, depth 1 = u2/u3, depth 2 = u4 \node[internal, fill=purple!15, draw=purple!60!black] (u1) at (0, 0) {$u_1$} child {node[leaf] (l1) {$1$}} child {node[internal, fill=teal!15, draw=teal!60!black] (u2) {$u_2$} child {node[leaf] (l2) {$2$}} child {node[leaf] (l3) {$3$}} } child {node[internal, fill=teal!15, draw=teal!60!black] (u3) {$u_3$} child {node[internal, fill=yellow!30, draw=yellow!70!black] (u4) {$u_4$} child {node[leaf] (l4) {$4$}} child {node[leaf] (l5) {$5$}} } child {node[leaf] (l6) {$6$}} child {node[leaf] (l7) {$7$}} }; % V box - grouped by depth: depth0(2), depth1(1+2=3), depth2(1) \begin{scope}[yshift=-5.0cm] % Braces above \draw[decorate, decoration={brace, amplitude=4pt}, line width=0.6pt, purple!60!black] (-2.7, 0.15) -- (-0.9, 0.15) node[midway, above=4pt, font=\small, text=purple!60!black] {depth 0}; \draw[decorate, decoration={brace, amplitude=4pt}, line width=0.6pt, teal!60!black] (-0.9, 0.15) -- (1.8, 0.15) node[midway, above=4pt, font=\small, text=teal!60!black] {depth 1}; \draw[decorate, decoration={brace, amplitude=4pt}, line width=0.6pt, yellow!70!black] (1.8, 0.15) -- (2.7, 0.15) node[midway, above=4pt, font=\small, text=yellow!70!black] {depth 2}; % Frame background \draw[fill=white, drop shadow={opacity=0.1}] (-2.7, 0) rectangle (2.7, -0.7); % Colored sections: depth0(2) + depth1(1+2=3) + depth2(1) = 6 \fill[purple!15] (-2.7, 0) rectangle (-0.9, -0.7); \fill[teal!15] (-0.9, 0) rectangle (1.8, -0.7); \fill[yellow!30] (1.8, 0) rectangle (2.7, -0.7); % Grid lines \draw[gray!30] (-1.8, 0) -- (-1.8, -0.7); \draw[gray!30] (-0.9, 0) -- (-0.9, -0.7); \draw[gray!30] (0.0, 0) -- (0.0, -0.7); \draw[gray!30] (0.9, 0) -- (0.9, -0.7); \draw[gray!30] (1.8, 0) -- (1.8, -0.7); % Frame \draw[thick] (-2.7, 0) rectangle (2.7, -0.7); % Label \node[font=\large, anchor=north] at (0, -0.9) {$V \in \mathbb{R}^{7 \times 6}$}; \end{scope} \end{scope} % Separator 2 \draw[gray!20, line width=1.5pt] (14.2, 1.4) -- (14.2, -6.6); % ========================================== % PANEL C: By Subtree (3 groups: u1, u2-subtree, u3-subtree) % u3-subtree includes u3 AND u4 % ========================================== \begin{scope}[xshift=18.4cm] \node[font=\bfseries\Large] at (0, 1.2) {By Subtree}; % Tree: subtree coloring - u3 subtree includes u4 (leaves stay blue) \node[internal, fill=red!15, draw=red!60!black] (u1) at (0, 0) {$u_1$} child {node[leaf] (l1) {$1$}} child {node[internal, fill=green!15, draw=green!60!black] (u2) {$u_2$} child {node[leaf] (l2) {$2$}} child {node[leaf] (l3) {$3$}} } child {node[internal, fill=orange!15, draw=orange!60!black] (u3) {$u_3$} child {node[internal, fill=orange!20, draw=orange!60!black] (u4) {$u_4$} child {node[leaf] (l4) {$4$}} child {node[leaf] (l5) {$5$}} } child {node[leaf] (l6) {$6$}} child {node[leaf] (l7) {$7$}} }; % V box - grouped by subtree: root(2), u2-subtree(1), u3-subtree(2+1=3) = 6 \begin{scope}[yshift=-5.0cm] % Braces above \draw[decorate, decoration={brace, amplitude=4pt}, line width=0.6pt, red!60!black] (-2.7, 0.15) -- (-0.9, 0.15) node[midway, above=4pt, font=\small, text=red!60!black] {$u_1$}; \draw[decorate, decoration={brace, amplitude=4pt}, line width=0.6pt, green!60!black] (-0.9, 0.15) -- (0.0, 0.15) node[midway, above=4pt, font=\small, text=green!60!black] {$u_2$ subtree}; \draw[decorate, decoration={brace, amplitude=4pt}, line width=0.6pt, orange!60!black] (0.0, 0.15) -- (2.7, 0.15) node[midway, above=4pt, font=\small, text=orange!60!black] {$u_3$ subtree}; % Frame background \draw[fill=white, drop shadow={opacity=0.1}] (-2.7, 0) rectangle (2.7, -0.7); % Colored sections: root(2) + u2-subtree(1) + u3-subtree(3) = 6 \fill[red!15] (-2.7, 0) rectangle (-0.9, -0.7); \fill[green!15] (-0.9, 0) rectangle (0.0, -0.7); \fill[orange!15] (0.0, 0) rectangle (2.7, -0.7); % Grid lines \draw[gray!30] (-1.8, 0) -- (-1.8, -0.7); \draw[gray!30] (-0.9, 0) -- (-0.9, -0.7); \draw[gray!30] (0.0, 0) -- (0.0, -0.7); \draw[gray!30] (0.9, 0) -- (0.9, -0.7); \draw[gray!30] (1.8, 0) -- (1.8, -0.7); % Frame \draw[thick] (-2.7, 0) rectangle (2.7, -0.7); % Label \node[font=\large, anchor=north] at (0, -0.9) {$V \in \mathbb{R}^{7 \times 6}$}; \end{scope} \end{scope} \end{tikzpicture}