5 - Graphs and Trees
Published online by Cambridge University Press: 06 July 2010
Summary
Graphs
A graph consists of a set of elements V called vertices (or nodes) and a set A of pairs of distinct vertices called edges (or arcs). It is usual to represent such a system graphically by drawing circles for vertices and drawing lines between vertices i and j when (i, j) is an edge. For instance, the graph having V = {1, 2, 3, 4, 5, 6} and A = {(1, 2), (1, 4), (1, 5), (2, 3), (2, 5), (3, 5), (5, 6)} is represented in Figure 5.1.
It should be noted the edges have no direction – for instance, the edge (1, 3) can also be written as (3, 1) – and also that we allow neither edges from a vertex to itself nor multiple edges connecting the same pair of vertices.
A sequence of vertices i, i1, i2, …, ik, j for which (i, i1), (i1, i2), …, (ik−1, ik), (ik, j) are all edges is called a path from vertex i to vertex j. Figure 5.2 shows a path from vertex 1 to vertex 6.
A path i, i1, i2, …, ik, i from a vertex back to itself in which all of the edges (i, i1), (i1, i2), …, (ik−1, ik), (ik, i) are distinct is called a cycle; see Figure 5.3.
- Type
- Chapter
- Information
- Topics in Finite and Discrete Mathematics , pp. 124 - 149Publisher: Cambridge University PressPrint publication year: 2000