Graph (mathematics)

From Wikipedia, the free encyclopedia
  (Redirected from Nonadjacent)
Jump to: navigation, search


The edges may be directed or undirected. For example, if the vertices represent people at a party, and there is an edge between two people if they shake hands, then this is an undirected graph, because if person A shook hands with person B, then person B also shook hands with person A. In contrast, if there is an edge from person A to person B when person A knows of person B, then this graph is directed, because knowledge of someone is not necessarily a symmetric relation (that is, one person knowing another person does not necessarily imply the reverse; for example, many fans may know of a celebrity, but the celebrity is unlikely to know of all their fans). This latter type of graph is called a directed graph and the edges are called directed edges or arcs.

Vertices are also called nodes or points, and edges are also called arcs or lines. Graphs are the basic subject studied by graph theory. The word "graph" was first used in this sense by J.J. Sylvester in 1878.[2][3]




In the most common sense of the term,[4] a graph is an ordered pair G = (VE) comprising a set V of vertices or nodes together with a set E of edges or links, which are 2-element subsets of V (i.e., an edge is related with two vertices, and the relation is represented as an unordered pair of the vertices with respect to the particular edge). To avoid ambiguity, this type of graph may be described precisely as undirected and simple.


All of these variants and others are described more fully below.

The vertices belonging to an edge are called the ends, endpoints, or end vertices of the edge. A vertex may exist in a graph and not belong to an edge.

V and E are usually taken to be finite, and many of the well-known results are not true (or are rather different) for infinite graphs because many of the arguments fail in the infinite case. The order of a graph is |V| (the number of vertices). A graph's size is |E|, the number of edges. The degree of a vertex is the number of edges that connect to it, where an edge that connects to the vertex at both ends (a loop) is counted twice.

For an edge {uv}, graph theorists usually use the somewhat shorter notation uv.

Adjacency relation[edit]

The edges E of an undirected graph G induce a symmetric binary relation ~ on V that is called the adjacency relation of G. Specifically, for each edge {uv} the vertices u and v are said to be adjacent to one another, which is denoted u ~ v.

Types of graphs[edit]

Distinction in terms of the main definition[edit]

As stated above, in different contexts it may be useful to define the term graph with different degrees of generality. Whenever it is necessary to draw a strict distinction, the following terms are used. Most commonly, in modern texts in graph theory, unless stated otherwise, graph means "undirected simple finite graph" (see the definitions below).

A directed graph.

Undirected graph[edit]

An undirected graph is one in which edges have no orientation. The edge (a, b) is identical to the edge (b, a), i.e., they are not ordered pairs, but sets {uv} (or 2-multisets) of vertices. The maximum number of edges in an undirected graph without a self-loop is n(n - 1)/2.

Directed graph[edit]

Main article: Directed graph

A directed graph or digraph is an ordered pair D = (VA) with

  • V a set whose elements are called vertices or nodes, and
  • A a set of ordered pairs of vertices, called arcs, directed edges, or arrows.


A directed graph D is called symmetric if, for every arc in D, the corresponding inverted arc also belongs to D. A symmetric loopless directed graph D = (VA) is equivalent to a simple undirected graph G = (VE), where the pairs of inverse arcs in A correspond 1-to-1 with the edges in E; thus the edges in G number |E| = |A|/2, or half the number of arcs in D.

An oriented graph is a directed graph in which at most one of (xy) and (yx) may be arcs.

Mixed graph[edit]

Main article: Mixed graph

A mixed graph G is a graph in which some edges may be directed and some may be undirected. It is written as an ordered triple G = (VEA) with V, E, and A defined as above. Directed and undirected graphs are special cases.


A loop is an edge (directed or undirected) which starts and ends on the same vertex; these may be permitted or not permitted according to the application. In this context, an edge with two different ends is called a link.

The term "multigraph" is generally understood to mean that multiple edges (and sometimes loops) are allowed. Where graphs are defined so as to allow loops and multiple edges, a multigraph is often defined to mean a graph without loops,[6] however, where graphs are defined so as to disallow loops and multiple edges, the term is often defined to mean a "graph" which can have both multiple edges and loops,[7] although many use the term "pseudograph" for this meaning.[8]


A quiver or "multidigraph" is a directed graph which may have more than one arrow from a given source to a given target. A quiver may also have directed loops in it.

Simple graph[edit]

As opposed to a multigraph, a simple graph is an undirected graph that has no loops (edges connected at both ends to the same vertex) and no more than one edge between any two different vertices. In a simple graph the edges of the graph form a set (rather than a multiset) and each edge is a distinct pair of vertices. In a simple graph with n vertices, the degree of every vertex is at most n-1.

Weighted graph[edit]

A graph is a weighted graph if a number (weight) is assigned to each edge.[9] Such weights might represent, for example, costs, lengths or capacities, etc. depending on the problem at hand. Some authors call such a graph a network.[10] Weighted correlation networks can be defined by soft-thresholding the pairwise correlations among variables (e.g. gene measurements).

Half-edges, loose edges[edit]

In certain situations it can be helpful to allow edges with only one end, called half-edges, or no ends (loose edges); see for example signed graphs and biased graphs.

Important graph classes[edit]

Regular graph[edit]

Main article: Regular graph

A regular graph is a graph where each vertex has the same number of neighbours, i.e., every vertex has the same degree or valency. A regular graph with vertices of degree k is called a k‑regular graph or regular graph of degree k.

Complete graph[edit]

Main article: Complete graph

Complete graphs have the feature that each pair of vertices has an edge connecting them.

Finite and infinite graphs[edit]

A finite graph is a graph G = (VE) such that V and E are finite sets. An infinite graph is one with an infinite set of vertices or edges or both.


Graph classes in terms of connectivity[edit]

In an undirected graph G, two vertices u and v are called connected if G contains a path from u to v. Otherwise, they are called disconnected. A graph is called connected if every pair of distinct vertices in the graph is connected; otherwise, it is called disconnected.

A graph is called k-vertex-connected or k-edge-connected if no set of k-1 vertices (respectively, edges) exists that, when removed, disconnects the graph. A k-vertex-connected graph is often called simply k-connected.

A directed graph is called weakly connected if replacing all of its directed edges with undirected edges produces a connected (undirected) graph. It is strongly connected or strong if it contains a directed path from u to v and a directed path from v to u for every pair of vertices uv.

Category of all graphs[edit]

The category of all graphs is the slice category \mathbf{Set}\downarrow D where D : \mathbf{Set} \rightarrow \mathbf{Set} is the functor taking a set s to s \times s.

Properties of graphs[edit]

Two edges of a graph are called adjacent if they share a common vertex. Two arrows of a directed graph are called consecutive if the head of the first one is at the tail of the second one. Similarly, two vertices are called adjacent if they share a common edge (consecutive if they are at the tail and at the head of an arrow), in which case the common edge is said to join the two vertices. An edge and a vertex on that edge are called incident.


In a weighted graph or digraph, each edge is associated with some value, variously called its cost, weight, length or other term depending on the application; such graphs arise in many contexts, for example in optimal routing problems such as the traveling salesman problem.

Normally, the vertices of a graph, by their nature as elements of a set, are distinguishable. This kind of graph may be called vertex-labeled. However, for many questions it is better to treat vertices as indistinguishable; then the graph may be called unlabeled. (Of course, the vertices may be still distinguishable by the properties of the graph itself, e.g., by the numbers of incident edges). The same remarks apply to edges, so graphs with labeled edges are called edge-labeled graphs. Graphs with labels attached to edges or vertices are more generally designated as labeled. Consequently, graphs in which vertices are indistinguishable and edges are indistinguishable are called unlabeled. (Note that in the literature the term labeled may apply to other kinds of labeling, besides that which serves only to distinguish different vertices or edges.)


A graph with six nodes.

Important graphs[edit]

Basic examples are:

  • In a complete graph, each pair of vertices is joined by an edge; that is, the graph contains all possible edges.
  • In a bipartite graph, the vertex set can be partitioned into two sets, W and X, so that no two vertices in W are adjacent and no two vertices in X are adjacent. Alternatively, it is a graph with a chromatic number of 2.
  • In a linear graph or path graph of length n, the vertices can be listed in order, v0, v1, ..., vn, so that the edges are vi−1vi for each i = 1, 2, ..., n. If a linear graph occurs as a subgraph of another graph, it is a path in that graph.
  • In a cycle graph of length n ≥ 3, vertices can be named v1, ..., vn so that the edges are vi−1vi for each i = 2,...,n in addition to vnv1. Cycle graphs can be characterized as connected 2-regular graphs. If a cycle graph occurs as a subgraph of another graph, it is a cycle or circuit in that graph.
  • A planar graph is a graph whose vertices and edges can be drawn in a plane such that no two of the edges intersect (i.e., embedded in a plane).
  • A tree is a connected graph with no cycles.
  • A forest is a graph with no cycles (i.e. the disjoint union of one or more trees).

More advanced kinds of graphs are:

Operations on graphs[edit]

Main article: Operations on graphs

There are several operations that produce new graphs from old ones, which might be classified into the following categories:




Every graph gives rise to a matroid.




See also[edit]


  2. ^ See:


  • Graham, R.L., Grötschel, M., and Lovász, L, ed. (1995). Handbook of Combinatorics. MIT Press. ISBN 0-262-07169-X. 
  • Gross, Jonathan L., & Yellen, Jay, ed. (2003-12-29). Handbook of Graph Theory. CRC. ISBN 1-58488-090-2. 

Further reading[edit]

External links[edit]