File:Symmetric relation closure example.svg
Summary
| Description |
Ελληνικά: Συμμετρική κλειστότητα μίας σχέσης R. Με πράσινο οι συσχετισμοί που πρέπει να προστεθούν. |
| Date | |
| Source | Own work |
| Author | Dimitris131 |
| SVG development | |
| Source code | LaTeX code\documentclass[border=3mm, tikz]{standalone}
\usepackage{pgfplots}
\usepackage{xcolor}
\usepackage[utf8x]{inputenc}
\usepackage[greek,english]{babel}
\definecolor{Red}{HTML}{ff7979}
\definecolor{Green}{HTML}{8ac478}
\usepackage{tabularray}
\begin{document}
\begin{tikzpicture}
\tikzset{nd/.style={circle,thick,fill=black,minimum size=0.5mm,scale=0.35} }
% The positions of the nodes.
\node[nd] (a1) at (0, 0) {};
\node[nd] (a2) at (1.2, 0) {};
\node[nd] (a4) at (0, -0.8) {};
\node[nd] (a3) at (1.2, -0.8) {};
\node[nd] (a5) at (0.6, -1.35) {};
% The edges in the relation.
\path[->] (a1) edge[bend left=15] (a2);
\path[->,Green] (a2) edge[bend left=15] (a1);
\path[->] (a2) edge[bend right] (a3);
\path[->] (a3) edge[bend right] (a2);
\path[->] (a3) edge[bend right=15] (a4);
\path[->,Green] (a4) edge[bend right=15] (a3);
\path[->] (a1) edge[bend right] (a4);
\path[->] (a4) edge[bend right] (a1);
\path[->] (a5) edge[bend left=15] (a4);
\path[->,Green] (a4) edge[bend left=15] (a5);
% The self-loops of the relations.
\path[->] (a2) edge[in=60,out=110,loop,looseness=8] (a2);
% The labels of the nodes.
\node[anchor=south east,scale=0.5] at (a1) {$1$};
\node[anchor=south west,scale=0.5,xshift=0.2cm] at (a2) {$2$};
\node[anchor=north west,scale=0.5] at (a3) {$3$};
\node[anchor=north east,scale=0.5] at (a4) {$4$};
\node[anchor=north,scale=0.5,yshift=-0.1cm] at (a5) {$5$};
% The matrix representation of the relation.
\node[anchor=north,scale=0.4] at (2.75, 0.2) {
$M(R') = \quad $\begin{tblr}{
rows = {1.5em, rowsep = 2pt},
columns = {1.5em, colsep = 2pt},
cells = {m,c},
hlines = {1pt},
vlines = {1pt},
cell{2}{1} = {Green},
cell{4}{3} = {Green},
cell{4}{5} = {Green},
}
0 & 1 & 0 & 1 & 0 \\
1 & 1 & 1 & 0 & 0 \\
0 & 1 & 0 & 1 & 0 \\
1 & 0 & 1 & 0 & 1 \\
0 & 0 & 0 & 1 & 0 \\
\end{tblr}
};
\end{tikzpicture}
\end{document}
|
Licensing
I, the copyright holder of this work, hereby publish it under the following license:
| This file is made available under the Creative Commons CC0 1.0 Universal Public Domain Dedication. | |
| The person who associated a work with this deed has dedicated the work to the public domain by waiving all of their rights to the work worldwide under copyright law, including all related and neighboring rights, to the extent allowed by law. You can copy, modify, distribute and perform the work, even for commercial purposes, all without asking permission.
|