Home graph
Post
Cancel

graph

Graph

点集合以及点之间的关系

G = (V, E)

V: A set whose elements are called vertices.

E: A set of paired vertices, whose elements aref called edges.

In mathematics, and more specifically in graph theory, a graph is a structure amounting to a set of objects in which some pairs of the objects are in some sense “related”.

The objects correspond to mathematical abstractions called vertices (also called nodes or points) and each of the related pairs of vertices is called an edge (also called link or line).

A graph (sometimes called undirected graph for distinguishing from a directed graph, or simple graph for distinguishing from a multigraph) is a pair G = (V, E), where V is a set whose elements are called vertices (singular: vertex), and E is a set of paired vertices, whose elements are called edges (sometimes links or lines).

The vertices x and y of an edge {x, y} are called the endpoints of the edge.

The edge is said to join x and y and to be incident on x and y

A vertex may belong to no edge, in which case it is not joined to any other vertex.

Multigraph

两个点可以有多条边链接

A multigraph is a generalization that allows multiple edges to have the same pair of endpoints.

Sometimes, graphs are allowed to contain loops, which are edges that join a vertex to itself. For allowing loops, the above definition must be changed by defining edges as multisets of two vertices instead of two-sets. Such generalized graphs are called graphs with loops or simply graphs when it is clear from the context that loops are allowed.

Empty Graph

An empty graph is a graph that has an empty set of vertices (and thus an empty set of edges).

Order

The order of a graph is its number of vertices V .

Size

The size of a graph is its number of edges E .
However, in some contexts, such as for expressing the computational complexity of algorithms, the size is V + E (otherwise, a non-empty graph could have a size 0).

Degree of a vertex

The degree or valency of a vertex is the number of edges that are incident to it; for graphs with loops, a loop is counted twice.

  • In a graph of order n, the maximum degree of each vertex is n − 1 (or n if loops are allowed), and the maximum number of edges is n(n − 1)/2 (or n(n + 1)/2 if loops are allowed).

  • 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 may be fully specified by its adjacency matrix A, which is an {\displaystyle n\times n}n\times n square matrix, with Aij specifying the number of connections from vertex i to vertex j.

  • For a simple graph, {\displaystyle A_{ij}\in {0,1}}{\displaystyle A_{ij}\in {0,1}}, indicating disconnection or connection respectively, meanwhile {\displaystyle A_{ii}=0}{\displaystyle A_{ii}=0} (that is, an edge can not start and end at the same vertice).

  • Graphs with self-loops will be characterized by some or all {\displaystyle A_{ii}}A_ being equal to a positive integer, and multigraphs (with multiple edges between vertices) will be characterized by some or all {\displaystyle A_{ij}}A_{ij} being equal to a positive integer.

  • Undirected graphs will have a symmetric adjacency matrix ({\displaystyle A_{ij}=A_{ji}}{\displaystyle A_{ij}=A_{ji}}).

This post is licensed under CC BY 4.0 by the author.