In the mathematics of infinite graphs, an end of a graph represents, intuitively, a direction in which the graph extends to infinity. Ends may be formalized mathematically as equivalence classes of infinite paths, as havens describing strategies for pursuit-evasion games on the graph, or (in the case of locally finite graphs) as topological ends of topological spaces associated with the graph.

Ends of graphs may be used (via Cayley graphs) to define ends of finitely generated groups. Finitely generated infinite groups have one, two, or infinitely many ends, and the Stallings theorem about ends of groups provides a decomposition for groups with more than one end.

Ends of graphs were defined by Rudolf Halin (1964) in terms of equivalence classes of infinite paths. A .mw-parser-output .vanchor>:target~.vanchor-text{background-color:#b1d2ff}ray in an infinite graph is a semi-infinite simple path; that is, it is an infinite sequence of vertices

v

0

,

v

1

,

v

2

,

…

{\displaystyle v_{0},v_{1},v_{2},\dots }

in which each vertex appears at most once in the sequence and each two consecutive vertices in the sequence are the two endpoints of an edge in the graph. According to Halin's definition, two rays

r

0

{\displaystyle r_{0}}

and

r

1

{\displaystyle r_{1}}

are equivalent if there is a ray

r

2

{\displaystyle r_{2}}

(which may equal one of the two given rays) that contains infinitely many of the vertices in each of

r

0

{\displaystyle r_{0}}

and

r

1

{\displaystyle r_{1}}

. This is an equivalence relation: each ray is equivalent to itself, the definition is symmetric with regard to the ordering of the two rays, and it can be shown to be transitive. Therefore, it partitions the set of all rays into equivalence classes, and Halin defined an end as one of these equivalence classes.

An alternative definition of the same equivalence relation has also been used: two rays

r

0

{\displaystyle r_{0}}

and

r

1

{\displaystyle r_{1}}

are equivalent if there is no finite set

X

{\displaystyle X}

of vertices that separates infinitely many vertices of

r

0

{\displaystyle r_{0}}

from infinitely many vertices of

r

1

{\displaystyle r_{1}}

. This is equivalent to Halin's definition: if the ray

r

2

{\displaystyle r_{2}}

from Halin's definition exists, then any separator must contain infinitely many points of

r

2

{\displaystyle r_{2}}

and therefore cannot be finite, and conversely if

r

2

{\displaystyle r_{2}}

does not exist then a path that alternates as many times as possible between

r

0

{\displaystyle r_{0}}

and

r

1

{\displaystyle r_{1}}

must form the desired finite separator.

Ends also have a more concrete characterization in terms of havens, functions that describe evasion strategies for pursuit-evasion games on a graph

G

{\displaystyle G}

. In the game in question, a robber is trying to evade a set of policemen by moving from vertex to vertex along the edges of

G

{\displaystyle G}

. The police have helicopters and therefore do not need to follow the edges; however the robber can see the police coming and can choose where to move next before the helicopters land. A haven is a function

b

{\displaystyle \beta }

that maps each set

X

{\displaystyle X}

of police locations to one of the connected components of the subgraph formed by deleting

X

{\displaystyle X}

; a robber can evade the police by moving in each round of the game to a vertex within this component. Havens must satisfy a consistency property (corresponding to the requirement that the robber cannot move through vertices on which police have already landed): if

X

{\displaystyle X}

is a subset of

Y

{\displaystyle Y}

, and both

X

{\displaystyle X}

and

Y

{\displaystyle Y}

are valid sets of locations for the given set of police, then

b

(

X

)

{\displaystyle \beta (X)}

must be a superset of

b

(

Y

)

{\displaystyle \beta (Y)}

. A haven has order

k

{\displaystyle k}

if the collection of police locations for which it provides an escape strategy includes all subsets of fewer than

k

{\displaystyle k}

vertices in the graph; in particular, it has order

ℵ

0

{\displaystyle \aleph _{0}}

(the smallest aleph number) if it maps every finite subset

X

{\displaystyle X}

of vertices to a component of

G

∖

X

{\displaystyle G\setminus X}

. Every ray in

G

{\displaystyle G}

corresponds to a haven of order

ℵ

0

{\displaystyle \aleph _{0}}

, namely, the function

b

{\displaystyle \beta }

; that maps every finite set

X

{\displaystyle X}

to the unique component of

G

∖

X

{\displaystyle G\setminus X}

that contains infinitely many vertices of the ray. Conversely, every haven of order

ℵ

0

{\displaystyle \aleph _{0}}

can be defined in this way by a ray. Two rays are equivalent if and only if they define the same haven, so the ends of a graph are in one-to-one correspondence with its havens of order

ℵ

0

{\displaystyle \aleph _{0}}

.

If the infinite graph

G

{\displaystyle G}

is itself a ray, then it has infinitely many ray subgraphs, one starting from each vertex of

G

{\displaystyle G}

. However, all of these rays are equivalent to each other, so

G

{\displaystyle G}

only has one end.

If

G

{\displaystyle G}

is a forest (that is, a graph with no finite cycles), then the intersection of any two rays is either a path or a ray; two rays are equivalent if their intersection is a ray. If a base vertex is chosen in each connected component of

G

{\displaystyle G}

, then each end of

G

{\displaystyle G}

contains a unique ray starting from one of the base vertices, so the ends may be placed in one-to-one correspondence with these canonical rays. Every countable graph

G

{\displaystyle G}

has a spanning forest with the same set of ends as

G

{\displaystyle G}

. However, there exist uncountably infinite graphs with only one end in which every spanning tree has infinitely many ends.

If

G

{\displaystyle G}

is an infinite grid graph, then it has many rays, and arbitrarily large sets of vertex-disjoint rays. However, it has only one end. This may be seen most easily using the characterization of ends in terms of havens: the removal of any finite set of vertices leaves exactly one infinite connected component, so there is only one haven (the one that maps each finite set to the unique infinite connected component).

In point-set topology, there is a concept of an end that is similar to, but not quite the same as, the concept of an end in graph theory, dating back much earlier to Freudenthal (1931). If a topological space can be covered by a nested sequence of compact sets

k

0

⊂

k

1

⊂

k

2

…

{\displaystyle \kappa _{0}\subset \kappa _{1}\subset \kappa _{2}\dots }

, then an end of the space is a sequence of components

U

0

⊃

U

1

⊃

U

2

…

{\displaystyle U_{0}\supset U_{1}\supset U_{2}\dots }

of the complements of the compact sets. This definition does not depend on the choice of the compact sets: the ends defined by one such choice may be placed in one-to-one correspondence with the ends defined by any other choice.

An infinite graph

G

{\displaystyle G}

may be made into a topological space in two different but related ways:

In either case, every finite subgraph of

G

{\displaystyle G}

corresponds to a compact subspace of the topological space, and every compact subspace corresponds to a finite subgraph together with, in the Hausdorff case, finitely many compact proper subsets of edges. Thus, a graph may be covered by a nested sequence of compact sets if and only if it is locally finite, having a finite number of edges at every vertex.

If a graph

G

{\displaystyle G}

is connected and locally finite, then it has a compact cover in which the set

k

i

{\displaystyle \kappa _{i}}

is the set of vertices at distance at most

i

{\displaystyle i}

from some arbitrarily chosen starting vertex. In this case any haven

b

{\displaystyle \beta }

defines an end of the topological space in which

U

i

=

b

(

k

i

)

{\displaystyle U_{i}=\beta (\kappa _{i})}

. And conversely, if

U

0

⊃

U

1

⊃

U

2

…

{\displaystyle U_{0}\supset U_{1}\supset U_{2}\dots }

is an end of the topological space defined from

G

{\displaystyle G}

, it defines a haven in which

b

(

X

)

{\displaystyle \beta (X)}

is the component containing

U

i

{\displaystyle U_{i}}

, where

i

{\displaystyle i}

is any number large enough that

k

i

{\displaystyle \kappa _{i}}

contains

X

{\displaystyle X}

. Thus, for connected and locally finite graphs, the topological ends are in one-to-one correspondence with the graph-theoretic ends.

For graphs that may not be locally finite, it is still possible to define a topological space from the graph and its ends. This space can be represented as a metric space if and only if the graph has a normal spanning tree, a rooted spanning tree such that each graph edge connects an ancestor-descendant pair. If a normal spanning tree exists, it has the same set of ends as the given graph: each end of the graph must contain exactly one infinite path in the tree.

An end

E

{\displaystyle E}

of a graph

G

{\displaystyle G}

is defined to be a free end if there is a finite set

X

{\displaystyle X}

of vertices with the property that

X

{\displaystyle X}

separates

E

{\displaystyle E}

from all other ends of the graph. (That is, in terms of havens,

b

E

(

X

)

{\displaystyle \beta _{E}(X)}

is disjoint from

b

D

(

X

)

{\displaystyle \beta _{D}(X)}

for every other end

D

{\displaystyle D}

.) In a graph with finitely many ends, every end must be free. Halin (1964) proves that, if

G

{\displaystyle G}

has infinitely many ends, then either there exists an end that is not free, or there exists an infinite family of rays that share a common starting vertex and are otherwise disjoint from each other.

A thick end of a graph

G

{\displaystyle G}

is an end that contains infinitely many pairwise-disjoint rays. Halin's grid theorem characterizes the graphs that contain thick ends: they are exactly the graphs that have a subdivision of the hexagonal tiling as a subgraph.

Mohar (1991) defines a connected locally finite graph to be "almost symmetric" if there exist a vertex

v

{\displaystyle v}

and a number

D

{\displaystyle D}

such that, for every other vertex

w

{\displaystyle w}

, there is an automorphism of the graph for which the image of

v

{\displaystyle v}

is within distance

D

{\displaystyle D}

of

w

{\displaystyle w}

; equivalently, a connected locally finite graph is almost symmetric if its automorphism group has finitely many orbits. As he shows, for every connected locally finite almost-symmetric graph, the number of ends is either at most two or uncountable; if it is uncountable, the ends have the topology of a Cantor set. Additionally, Mohar shows that the number of ends controls the Cheeger constant

Every group and a set of generators for the group determine a Cayley graph, a graph whose vertices are the group elements and the edges are pairs of elements

(

x

,

g

x

)

{\displaystyle (x,gx)}

where

g

{\displaystyle g}

is one of the generators. In the case of a finitely generated group, the ends of the group are defined to be the ends of the Cayley graph for the finite set of generators; this definition is invariant under the choice of generators, in the sense that if two different finite set of generators are chosen, the ends of the two Cayley graphs are in one-to-one correspondence with each other.

For instance, every free group has a Cayley graph (for its free generators) that is a tree. The free group on one generator has a doubly infinite path as its Cayley graph, with two ends. Every other free group has infinitely many ends.

Every finitely generated infinite group has either 1, 2, or infinitely many ends, and the Stallings theorem about ends of groups provides a decomposition of groups with more than one end. In particular: