graph

A graph consists of a set of vertices, and a set of edges between vertices.

Formally
A graph G=(V,E) is an ordered pair, where V={vi:1in} is a set of vertices, and E={{vi,vj}:i,j[1,n]} is a set of edges.


The vertices u and v of an edge {u,v} are called the edge's endpoints. The edge is said to join u and v and said to be incident on them. When an edge {u,v} exists, the vertices u and v are called adjacent.

The order of a graph is the number |V| of vertices.
The size of a graph is its number |E| of edges.
The degree of a vertex is the number of edges that are incident to it; for graphs with loops, a loop is counted twice.

The edges of a graph define a symmetric relation on the vertices called the adjacency relation. Specifically, two vertices x and y are adjacent if {x,y} is an edge. A graph of order n is fully determined by its adjacency matrix A, which is an n×n square matrix, with Aij specifying the number of connections from vertex i to vertex j.

\documentclass[tikz,margin={3cm 0cm}]{standalone}
\usetikzlibrary{positioning}
%
\begin{document}
\begin{tikzpicture}[node distance=2.5cm]
    \node[draw,circle] (A) {$A$};
    \node[right=of A,draw,circle] (B) {$B$};
    \draw (A) -- (B) node[midway,below=2.5,draw,circle] (C) {$C$};
    \draw (B) -- (C) -- (A);
\end{tikzpicture}
\end{document}
Powered by Forestry.md