File:Symmetric relation closure example.svg

From Wikimedia Commons, the free media repository
Jump to navigation Jump to search

Original file(SVG file, nominally 176 × 93 pixels, file size: 41 KB)

Captions

Captions

Symmetric closure of a binary relation R. In green are the pairs that must be added to make R symmetric.

Summary

[edit]
Description
Ελληνικά: Συμμετρική κλειστότητα μίας σχέσης R. Με πράσινο οι συσχετισμοί που πρέπει να προστεθούν.
Date
Source Own work
Author Dimitris131
SVG development
InfoField
 
The SVG code is valid.
 
This vector image was created with LaTeX.
Source code
InfoField

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

[edit]
I, the copyright holder of this work, hereby publish it under the following license:
Creative Commons CC-Zero 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.

File history

Click on a date/time to view the file as it appeared at that time.

Date/TimeThumbnailDimensionsUserComment
current10:20, 20 May 2024Thumbnail for version as of 10:20, 20 May 2024176 × 93 (41 KB)Dimitris131 (talk | contribs)Uploaded own work with UploadWizard

There are no pages that use this file.

File usage on other wikis

The following other wikis use this file:

Metadata