




















































Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
This page cannot be seen from the preview
Don't miss anything!





















































Graph theory provides a mathematical structure that is convenient for understanding a number of problems and writing algorithms to solve them. At one level, graphs are very simple. They are just dots connected by lines. The âdotsâ, generally drawn as labeled circles, are called âverticesâ (singular is âvertexâ) or ânodesâ. The lines are usually called âedgesâ, but may be called âlinksâ or âarcsâ. The vertices are generally labeled by positive integers, but can be labeled otherwise. In a graph that is read as a map, many of the vertices are labeled with city names. One special class of graphs is called âtreesâ, to be defined soon. For some reason, we tend to use the term ânodeâ when discussing trees and use the term âvertexâ when discussing general graphs.
We present two definitions of the mathematical object called a graph. Definition 1: A graph is a finite subset of the positive integers, denoted by V = { 1, 2, âŚ, N }, for N ďł 1, and a possibly empty subset E ď V ď´ V. WOW! That is a lot of help. Definition 2: A graph G is a finite non-empty set of objects called vertices (the word âverticesâ is the plural of âvertex) together with a (possibly empty) finite set of pairs of distinct vertices of G called edges. The vertex set is commonly denoted by V(G) = {1, 2, 3, âŚ, N}, where N is the number of vertices in the set. It is convenient to use integers to label vertices. The edge set, commonly denoted by E(G), is a subset of (V(G) ď´ V(G)), the set of all pairs of elements from the vertex set V(G). The cardinality of the vertex set of a graph G is called the order of G. The cardinality of the edge set is called the size of G. Commonly |E(G)| = M. An (N, M)-graph G is a graph with N vertices and M edges.
(4, 1), (4, 2), (4, 3), (4, 4) }. This set has 16 elements. A directed graph with vertex set V(G) would have its edge set as a subset of the following subset of V(G) ď´ V(G). { (1, 2), (1, 3), (1, 4), (2, 1), (2, 3), (2, 4), (3, 1), (3, 2), (3, 4), (4, 1), (4, 2), (4, 3) }. |E(G)| ďŁ 12. An undirected graph with vertex set V(G) would have its edge set as a subset of the following subset of V(G) ď´ V(G). { (1, 2), (1, 3), (1, 4), (2, 3), (2, 4), (3, 4) }. |E(G)| ďŁ 6.
So far, we have followed the strict mathematical definition of a graph. The problem is that most people (your instructor included) prefer a visual depiction of these mathematical objects. With the understanding that these depictions can occasionally be misleading, as we shall show later, we now begin with the simpler depictions. An (N, M)âgraph G is depicted with N circles denoting the N vertices and M lines connecting the circles and representing the edges. Labeled Graphs: While we often use subsets of the set of integers to denote the vertices in a graph, we note that this is just a convenience. A fourâvertex graph might have the vertex set {Atlanta, Memphis, Miami, Tampa}. As examples, letâs look at representation of some graphs on four vertices. V(G) = {1, 2, 3, 4}.
Letâs examine three undirected graphs with four vertices and three edges. Two of the graphs are connected; the one at the right is disconnected. E(G) = { (1,2), (1, 3) E(G) = { (1, 2), (1, 4), E(G) = { (1, 2), (1, 4) (1, 4) } (2, 3) } (2, 4) } Here are a number of undirected graphs on three vertices.
Here are two (4, 3) directed graphs. Note that they are different graphs. E(G1) = { (1, 2), (1, 4), (4, 3) } E(G2) = { (1, 4), (2, 1), (4, 3) } Note specifically that (1, 2) ď E(G1) but (1, 2) ď E(G2). also (2, 1) ď E(G1) but (2, 1) ď E(G2) In the directed graph, the edges are ordered pairs taken from the set V(G) ď´ V(G). For this reason (1, 2) ďš (2, 1).
Consider the following two graphs, one directed and one undirected. In what sense are they similar? Each graph has V(G) = {1, 2, 3, 4} The undirected graph has E(G) = { (1, 2), (1, 4), (2, 3), (3, 4) } more conventionally written as E(G) = { (1, 2), (2, 3), (3, 4), (4, 1) }. The directed graph has E(G) = { (1, 2), (2, 3), (3, 4), (4, 1), (1, 4), (4, 3), (3, 2), (2, 1) } The undirected graph can be seen as a simpler representation containing the same information as the directed graph. Nevertheless, they are not the same graph.
For every directed graph, there is an undirected graph that has a similar structure. These graphs are not equivalent. In some cases, the structure of the underlying undirected graph may yield insights into the structure of the directed graph. The main use of this concept arises when we discuss the idea of connectivity in directed graphs. While the idea of a connected graph is intuitive, we shall wait a while before giving a formal definition.
Let G be an (N, M)âgraph with vertex set V(G) = {1, 2, âŚ, N} and edge set E(G). The complement of graph G , denoted GC, is defined to be the graph with vertex set V(GC) = V(G) and edge set E(GC) defined by e ď E(GC) if and only if e ď E(G) Example: Define G by V(G) = {1, 2, 3, 4} and E(G) = {(1, 2), (1, 3), (1, 4)} Then GC is defined by V(GC) = {1, 2, 3, 4} and E(GC) = {(2, 3), (2, 4), (3, 4)} In pictures, we have:
We begin this section of the lecture by considering two questions related to the basic structure of undirected graphs. Similar considerations can be applied to directed graphs; it is just that the presentation is simpler in the undirected case. Look at the following two graphs. How do they differ? How are they similar? Each of the two graphs contains a triangle and an isolated vertex. Obviously, the two graphs are not the same graph, in that the one on the left has vertex 3 isolated while the one on the right has vertex 1 isolated. We shall develop a concept that describes the basic structural level at which these two graphs are essentially the same graph.
Two graphs G1 and G2 are said to be isomorphic , denoted by G1 ď G2, if there exists a one-to-one mapping F from V(G1) onto V(G2) such that (u, v) ď E(G1) if and only if (F(u), F(v)) ď E(G2). Consider the following two graphs, with different vertex labels. These two graphs are isomorphic under the following transformation: F(1) = A, F(2) = B, F(3) = C, and F(4) = D. The edge lists of the two graphs show this. Graph on left: (1, 2), (1, 4), (2, 3), and (3, 4) Graph on right: (A, B), (A, D), (B, C), and (C, D). In a sense, two isomorphic graphs represent the same graph.
The idea of graph isomorphism allows us to focus on the basic structure. If two graphs are nonâisomorphic , they have basically different structures. Here are three nonâisomorphic graphs on three vertices. For any value of N, there are only a finite number of nonâisomorphic graphs on N vertices. We can view these as a finite set. Define ď (N) as the set of nonâisomorphic graphs on N vertices. Define ď (N, M) as the set of nonâisomorphic graphs on N vertices and M edges. For smaller values of N (N ďŁ 4) we may easily display the entire sets ď(N).
Certain graph structures appear with sufficient regularity to be given names. The Path The path on N vertices is a connected graph with (N â 1) edges in the form of a path. It has (N â 2) vertices of degree 2 and two vertices of degree 1. The path on N vertices is denoted by PN. Here are depictions of the graphs P 2 , P 3 , and P 4.