Pooling from edges to nodes

Each node gather data from adjacent edges.

Author

Emre Anakok

Published

March 18, 2025

\documentclass[border=3pt,tikz]{standalone}
\usepackage{amsmath}
\usepackage[dvipsnames]{xcolor}
\usepackage{pgfplots}
\definecolor{taupegray}{rgb}{0.55, 0.52, 0.54}
\def\general_height{0.2}
\usepackage{tikz-network}
\begin{document}

\def\a{0.8}
\tikzset{pics/four colors/.style args=
    {#1|#2|#3|#4|rotate=#5}{code={%
\fill[#1,rotate=#5] (0,\a/2) arc(90:180:\a/2)--(0,0)--cycle;            
\fill[#2,rotate=#5] (0,\a/2) arc(90:0:\a/2)--(0,0)--cycle;
\fill[#3,rotate=#5] (180:\a/2) arc(180:270:\a/2)--(0,0)--cycle;
\fill[#4,rotate=#5] (270:\a/2) arc(270:360:\a/2)--(0,0)--cycle;
%\path (0,0) node[c] (-boundary) {};
}}}

\begin{tikzpicture}
\begin{scope}[scale=0.9]

\begin{scope}[scale=2,xshift=-1cm]
\Vertex[x=0.88,y=0.48,label=A,color=white]{A}
\Vertex[x=-0.18,y=0.98,label=B,style={line width=1.5mm},color=white]{B}
\Vertex[x=-1,y=0.12,label=C,color=white]{C}
\Vertex[x=-0.42,y=-0.9,label=D,color=white]{D}
\Vertex[x=0.72,y=-0.69,label=E,color=white]{E}
\Edge[color=pink,lw=5](A)(B)
\Edge[color=green](A)(C)
\Edge[color=red](A)(D)
\Edge[color=blue](A)(E)
\Edge[color=yellow,lw=5](B)(C)
\Edge[color=orange,lw=5](B)(D)
\Edge[color=gray,lw=5](B)(E)
\end{scope}

\begin{scope}[xshift=2cm]
\node[] at (1.5cm,4.5cm) {\huge $X^{E(l)}$};
\node[align = center, text width=5cm] at (1.5cm,6cm) {\Large Données sur les arêtes adjacente à B};

\Vertex[x=0,y=3,Pseudo]{bar_1}
\begin{axis}[ybar stacked, 
yshift = 3cm,
height=\general_height\textwidth,
 bar width=13pt,ymin=0,
 x=17pt,
 ytick=\empty,
 xtick=\empty,
 hide axis]
    \addplot[fill=yellow,opacity=0.5] coordinates
        {(0,0.15) (1,0.1) (2,0.1) (3,0.2) (4,0.1)};
    \end{axis}

\Vertex[x=0,y=2,Pseudo]{bar_2}
\begin{axis}[ybar stacked, 
yshift = 2cm,
height=\general_height\textwidth,
 bar width=13pt,ymin=0,
 x=17pt,
 ytick=\empty,
 xtick=\empty,
 hide axis]
    \addplot[fill=pink,opacity=0.5] coordinates
        {(0,0.1) (1,0.05) (2,0.3) (3,0.2) (4,0.0)};
    \end{axis}


 
\Vertex[x=0,y=0,Pseudo]{bar_4}
\begin{axis}[ybar stacked,
height=\general_height\textwidth,
 bar width=13pt,ymin=0,
 x=17pt,
 ytick=\empty,
 xtick=\empty,
 hide axis]
    \addplot[fill=gray,opacity=0.5] coordinates
        {(0,0.1) (1,0.1) (2,0.15) (3,0.2) (4,0.15)};
    \end{axis}



\Vertex[x=0,y=-3,Pseudo]{bar_7}
 
\begin{axis}[ybar stacked, 
yshift = -3cm,
height=\general_height\textwidth,
 bar width=13pt,ymin=0,
 x=17pt,
 ytick=\empty,
 xtick=\empty,
 hide axis]
\addplot[fill=orange,opacity=0.5] coordinates
        {(0,0.2) (1,0.1) (2,0.1) (3,0.2) (4,0.1)};
\end{axis}
 
 \Vertex[x=3,y=0,Pseudo]{barplots}
 
\end{scope}

\begin{scope}[xshift=8cm]
\node[] at (1.5cm,4.5cm) {\huge $X^{V(l+1)}$};
\node[align = center, text width=4cm] at (1.5cm,6cm) {\Large Données sur le noeuds B};

\Vertex[x=0,y=0,Pseudo]{agregation}


\begin{axis}[ybar stacked,
height= 2*\general_height\textwidth,
yshift = 0cm,
 bar width=13pt,ymin=0,
 x=17pt,
 ytick=\empty,
 xtick=\empty,
 hide axis]
 \addplot[fill=orange,opacity=0.5] coordinates
        {(0,0.2) (1,0.1) (2,0.1) (3,0.2) (4,0.1)};
 
 
 \addplot[fill=gray,opacity=0.5] coordinates
 {(0,0.1) (1,0.1) (2,0.15) (3,0.2) (4,0.15)};
  
  \addplot[fill=pink,opacity=0.5] coordinates
  {(0,0.1) (1,0.05) (2,0.3) (3,0.2) (4,0.0)};
  \addplot[fill=yellow,opacity=0.5] coordinates
  {(0,0.15) (1,0.1) (2,0.1) (3,0.2) (4,0.1)};
 \end{axis}
 \Vertex[x=3,y=1.5,Pseudo]{N}   
\end{scope}


\Edge[bend=35,style={dashed},Direct]($(A)!.5!(B)$)(bar_2)
%\Edge[bend=35,style={dashed},Direct]($(A)!.5!(C)$)(bar_3)
%\Edge[bend=-35,style={dashed},Direct]($(A)!.5!(D)$)(bar_6)
%\Edge[bend=-35,style={dashed},Direct]($(A)!.5!(E)$)(bar_5)
\Edge[bend=70,style={dashed},Direct]($(B)!.5!(C)$)(bar_1)
\Edge[bend=-35,style={dashed},Direct]($(B)!.5!(D)$)(bar_7)
\Edge[bend=10,style={dashed},Direct]($(B)!.5!(E)$)(bar_4)





\begin{scope}[xshift=14cm,scale=2]
    \Vertex[x=0.88,y=0.48,label=A,color=purple,opacity=0.5]{A2}
\Vertex[x=-0.18,y=0.98,label=B,color=purple,opacity=0.7]{B2}
\Vertex[x=-1,y=0.12,label=C,color=purple,opacity=0.4]{C2}
\Vertex[x=-0.42,y=-0.9,label=D,color=purple]{D2}
\Vertex[x=0.72,y=-0.69,label=E,color=purple,opacity=0.2]{E2}

\draw (A2) pic (YGH) {four colors={pink|green|red|blue|rotate=72}};
\draw (B2) pic (YGH) {four colors={yellow|pink|orange|gray|rotate=144}};
\draw (C2) pic (YGH) {four colors={yellow|yellow|green|green|rotate=36}};
\draw (D2) pic (YGH) {four colors={orange|orange|red|red|rotate=65}};
\draw (E2) pic (YGH) {four colors={gray|gray|blue|blue|rotate=100}};

\Edge[color=gray](A2)(B2)
\Edge[color=gray](A2)(C2)
\Edge[color=gray](A2)(D2)
\Edge[color=gray](A2)(E2)
\Edge[color=gray](B2)(C2)
\Edge[color=gray](B2)(D2)
\Edge[color=gray](B2)(E2)
\end{scope}

\Edge[style={dashed},Direct,label={\Huge $\phi$}](barplots)(agregation)
\Edge[style={dashed},bend=35,Direct](N)(B2)

\end{scope}
\end{tikzpicture}
    
    
\end{document}