
Automata and Generating Trees 247
The graphs we will encounter when discussing automata are a bit more
general. They may have multiple edges between vertices, edges from a vertex
to itself, or vertices with a direction and a weight.
Definition 7.2 A directed graph or digraph is a graph in which the edges
have a direction, that is, the edge (i, j) is different from the edge (j, i).Anedge
is called a loop if it connects a vertex with itself. A multi-graph is a graph that
has multiple edges between a pair of vertices and also can have loops. A graph
without multiple edges and loops is called a simple graph.Theneighborhood of
avertexi in a digraph consists of out-neighbors N
+
(i)={j ∈ V | (i, j) ∈ E}
and in-neighbors N
−
(i)={j ∈ V | (j, i) ∈ E} , respectively. A vertex has both
an out-degree deg
+
(i)=|N
+
(i)| and an in-degree deg
−
(i)=|N
−
(i)|.
To depict a graph we use dots for the vertices, and lines connecting the
dots for the edges. If a graph is directed, then we indicate the direction by
an arrow on the edge, where the directed edge (i, j) is drawn with the arrow
pointing from i to j. When drawing a graph, it does not matter where the
vertices are located and how the edges are connected.
G
1
=
•
•
•
•
@
@
@
@
1
23
4
G
2
=
•
•
•
•
@
@
@
@
1
23
4
G
3
=
6
•
•
•
•
@
@
@
@R
41
23
i
FIGURE 7.1: Simple graph, multi-graph, and digraph.
Example 7.3 Figure 7.1 depicts a simple graph G
1
with V = {1, 2, 3, 4}
and E = {(1, 2), (2, 3), (2, 4), (3, 4)}. The degrees are given by deg(1) = 1,
deg(2) = 3,anddeg(3) = deg(4) = 2. The graph G
2
is a multi-graph, as
there are two edges connecting vertices 2 and 4. G
3
is a digraph with vertex
set V = {1, 2, 3, 4} and edge set E = {(1, 2), (2, 3), (2, 4), (3, 2), (4, 4)}.The
neighbors of vertex 3 in G
1
are the vertices 2 and 4, while vertex 3 in graph
G
3
has in-neighbor 2 and out-neighbor 2,andthus,deg
+
(3) = deg
−
(3) = 1.
The idea that the visualization of a graph is irrelevant to its structure is
made precise with the notion of graph isomorphism.
Definition 7.4 Two graphs G =(V,E) and G
=(V
,E
) are said to be
isomorphic if there exists a bijection f : V → V
such that (i, j) ∈ E if and
only if (f(i),f(j)) ∈ E
. In other words, two graphs are isomorphic if they
are really the same graph labeled or drawn in two different ways.
Figure 7.2 presents the four nonisomorphic simple graphs on three vertices.
© 2010 by Taylor and Francis Group, LLC