Docsity

Graph Theory: Understanding Simple Undirected Graphs and Their Properties - Prof. Edward B, Study notes of Programming Languages

Toggle sidebar
bg1
TERMINOLOGY AND BASIC GRAPH THEORY
Introduction
This chapter presents an overview of basic graph theory, including its association with set
theory. Graphs can be shown to be quite useful, especially as a mathematical tool for
studying network problems. We shall begin our study with graph theory as applied to
static problems in network theory, which are those problems that are related to the
structure of the network. Static problems include the assessment of the impact of the loss
of one or more communicating nodes or one or more communication links. We use
graph theory in an attempt to create networks that are less vulnerable to such loss.
In another chapter of these notes, we shall consider the application of graph theory to
dynamic problems, such as dynamic load balancing. We shall show that certain
algorithms become unstable under dynamic conditions, in that they present alternating
optimal solutions: try this, no try that, etc. This observation should serve as a caution not
to trust results from static graph theory to work in all dynamic problem areas.
But first we must get started with the basic graph theory. We begin with the definition of
sets and develop the idea of a graph as a set of vertices and a set of edges.
Terminology and notations used
A graph G is a finite non-empty set of objects called vertices together with a (possibly
empty) finite set of unordered pairs of distinct vertices of G called edges. The vertex set
of G is commonly denoted by V(G), and the edge set commonly denoted by E(G). The
cardinality of the vertex set of a graph G is called the order of G, and the cardinality of
the edge set is called the size of G. An (n, m)-graph G is a graph with n vertices and
m edges; |V(G)| = n and |E(G)| = m. Although graphs are formally defined in terms of
sets, they are commonly depicted by figures in which the nodes are depicted as circles (or
ellipses) and the edges as lines between the circles.
The formal definition of a graph is based on set theory and utilizes the Cartesian product
of sets, for which we present the standard definition. We begin by recalling that a set is
an unordered collection of elements. For a set A, we write a A if element a is an
member of set A and a A if it is not. We sometimes define sets by a complete listing
of the members of the set and sometimes by a description of the form {x | p(x)}, to be
read as the set of all x such that p(x) is true. Although it would be a bit strange, one can
define the set of all odd integers as { x | (x is an integer) and (x is an odd number) }.
Let A and B be two arbitrary sets, defined over the same type of elements. We say that A
is a subset of B, denoted as A B, if every element that is in A is also in B; more
formally: A B if and only if a A implies a B. Two sets A and B are equal if and
only if both A B and B A. We say that A is a proper subset of B, denoted A B,
if A B, but A B.
Page 1 of 22 CPSC 3115 Version of December 14, 2004
Copyright © 2005 by Ed Bosworth
pf3
pf4
pf5
pf8
pf9
pfa
pfd
pfe
pff
pf12
pf13
pf14
pf15
pf16

Partial preview of the text

Download Graph Theory: Understanding Simple Undirected Graphs and Their Properties - Prof. Edward B and more Study notes Programming Languages in PDF only on Docsity!

TERMINOLOGY AND BASIC GRAPH THEORY

Introduction

This chapter presents an overview of basic graph theory, including its association with set

theory. Graphs can be shown to be quite useful, especially as a mathematical tool for

studying network problems. We shall begin our study with graph theory as applied to

static problems in network theory, which are those problems that are related to the

structure of the network. Static problems include the assessment of the impact of the loss

of one or more communicating nodes or one or more communication links. We use

graph theory in an attempt to create networks that are less vulnerable to such loss.

In another chapter of these notes, we shall consider the application of graph theory to

dynamic problems, such as dynamic load balancing. We shall show that certain

algorithms become unstable under dynamic conditions, in that they present alternating

optimal solutions: try this, no try that, etc. This observation should serve as a caution not

to trust results from static graph theory to work in all dynamic problem areas.

But first we must get started with the basic graph theory. We begin with the definition of

sets and develop the idea of a graph as a set of vertices and a set of edges.

Terminology and notations used

A graph G is a finite non-empty set of objects called vertices together with a (possibly

empty) finite set of unordered pairs of distinct vertices of G called edges. The vertex set

of G is commonly denoted by V(G), and the edge set commonly denoted by E(G). The

cardinality of the vertex set of a graph G is called the order of G, and the cardinality of

the edge set is called the size of G. An ( n , m )-graph G is a graph with n vertices and

m edges; |V(G)| = n and |E(G)| = m. Although graphs are formally defined in terms of

sets, they are commonly depicted by figures in which the nodes are depicted as circles (or

ellipses) and the edges as lines between the circles.

The formal definition of a graph is based on set theory and utilizes the Cartesian product

of sets, for which we present the standard definition. We begin by recalling that a set is

an unordered collection of elements. For a set A, we write aA if element a is an

member of set A and aA if it is not. We sometimes define sets by a complete listing

of the members of the set and sometimes by a description of the form { x | p( x )}, to be

read as the set of all x such that p( x ) is true. Although it would be a bit strange, one can

define the set of all odd integers as { x | ( x is an integer) and ( x is an odd number) }.

Let A and B be two arbitrary sets, defined over the same type of elements. We say that A

is a subset of B, denoted as A  B, if every element that is in A is also in B; more

formally: A  B if and only if a  A implies a  B. Two sets A and B are equal if and

only if both A  B and B  A. We say that A is a proper subset of B, denoted A  B,

if A  B, but A  B.

Page 1 of 22 CPSC 3115 Version of December 14, 2004

Definition : For any two sets A and B, the Cartesian product of A and B, denoted

by A  B, is the set of pairs of elements defined by A  B = { ( a , b ) | a  A, b  B}; thus it is

the set of pairs of elements ( a , b ) for which the first element is a member of set A and the second

element is a member of set B.

As we shall soon see, one may take the Cartesian product of a set with itself. Thus we have

A  A = { ( a 1

, a 2

) | a 1

 A, a 2

 A}. This work will use the Cartesian product sets for which the

elements of the pair are distinct and unordered; thus a 1

a

2

and ( a

1

, a

2

) is considered the same

element as ( a 2

, a 1

). For example, consider A = {1, 2, 3, 4}, The set A  A has 16 elements; our

work focuses on a subset of A  A, E  A  A, that can be listed as

E = { (1, 2), (1, 3), (1, 4), (2, 3), (2, 4), (3, 4) }.

Let X be an arbitrary set with a finite number of elements. The cardinality of X, denoted by |X|,

is the number of elements in the set. If |X| = 0, the set is said to be the empty set , denoted by .

If |X| > 0, the set is said to be non-empty. We now define the basic set operations. For two sets

A and B:

the set intersection , denoted A  B, is A  B = { x | x  A and x  B},

the set union , denoted A  B, is A  B = { x | x  A or x  B}, and

the set difference , denoted A – B, is A – B = { x | x  A and x  B}, and

the set symmetric difference , denoted A  B, is A  B = (A  B) – (A  B);

that is, the set of elements either in set A or in set B, but not in both sets.

As an example, consider the following two sets, each a subset of the integers.

A = {2, 4, 6, 8, 10, 12, 14, 16, 18}

B = {3, 6, 9, 12, 15, 18}

Then A  B = {6, 12, 18}

A  B = {2, 3, 4, 6, 8, 9, 10, 12, 14, 15, 16, 18}

A – B = {2, 4, 8, 10, 14, 16}

A  B = {2, 3, 4, 8, 9, 10, 14, 15, 16}.

These set operations are often illustrated using Venn diagrams, which are probably self

explanatory. The following figure shows some Venn diagrams.

Figure 1: Venn Diagrams for Common Set Operations

Page 2 of 22 CPSC 3115 Version of December 14, 2004

The student should note that it is always possible to create a directed graph that is equivalent to

an undirected graph; one need only “double up” each edge in the undirected graph. The

following figure shows an undirected graph and its equivalent directed graph.

Figure 4: An Undirected Graph and the Equivalent Directed Graph

For the moment we shall restrict our discussions to undirected simple graphs, which we shall call

“graphs” with no further distinction. As noted above, the edge set for an undirected graph with

vertex set given by V(G) = {1, 2, …, n }. E(G) is a subset of V(G)  V(G) that contains only

unordered pairs of distinct elements. For a set of n objects, there are

n n n

unordered

pairs of distinct objects, this is the maximum size of the edge set for an ( n , m )-graph. Thus we

have the following limits on the number of edges in a simple undirected graph G.

Proposition 1: Let G be a simple undirected graph, with |V(G)| = n.

Then 0  |E(G)| 

n

n n

The complement of a graph G, denoted G C

, is the graph with the vertex set V(G) and edge set

defined by E(G C

) = { ( u , v ) | u  V(G), v  V(G), ( u , v )  E(G) }. If G is an ( n , m )-graph, then

G

C

is an ( n , n ( n – 1)/2 – m )-graph.

In much of graph theory, the vertices of the graphs are labeled by integers, so that a four-vertex

graph would have V(G) = {1, 2, 3, 4}. The set of possible edges for such a graph would be { (1,

2), (1, 3), (1, 4), (2, 3), (2, 4), (3, 4) }. Consider two (4, 3)-graphs, a graph and its complement.

First we give a rather formal definition of the two graphs.

G = (V(G), E(G) | V(G) = {1, 2, 3, 4}, E(G) = {(1, 2), (1, 3), (1, 4)}

G

C

= (V(G), E(G) | V(G) = {1, 2, 3, 4}, E(G) = {(2, 3), (2, 4), (3, 4)}

While this is a sufficient definition of the two graphs, most people prefer the visual

representation of the graphs. Here are standard representations of G and G C

Figure 5: A Graph and Its Complement

Page 4 of 22 CPSC 3115 Version of December 14, 2004

Two graphs often have the same structure, differing only in the way their vertices and edges are

labeled or in the way they are drawn. To make this idea more exact and to develop a way to

focus on the essential structure of graphs, we introduce the concept of graph isomorphism.

Two graphs G 1

and G 2

are said to be isomorphic , denoted by G 1

 G

2

, if there exists a one-to-

one mapping  from V(G 1

) onto V(G 2

) such that the mapping preserves the adjacency, that is to

say that ( u , v )  E(G 1

) if and only if (( u ), ( v ))  E(G 2

). Were we to push a point, we would

note that graph isomorphism forms equivalence classes on graphs: if G 1

 G

2

and G 2

 G

3

, then

G

1

 G

3

. The next figure shows two graphs that are labeled and drawn differently, but are

isomorphic.

Figure 6: Two Isomorphic Graphs

The two graphs in Figure 6 are isomorphic under the following transformation: (1) = A, (2) =

B, (3) = C, and (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).

If we take the graph on left and apply the transformation to its vertex labels, we arrive at the edge

list (A, B), (A, D), (B, C), and (C, D). This is precisely the edge list of the graph on the right, as

expected. Thus, the two graphs are isomorphic.

The basic use of the idea of graph isomorphism is that we can view isomorphic graphs as

identical and ask questions only about graphs that are not isomorphic. We use isomorphism to

define a method of classifying graphs. For integers n > 0 and m  0, let  ( n ) denote the

collection of all non-isomorphic graphs with n vertices and  ( n, m ) denote the collection of all

non-isomorphic graphs on n vertices and m edges. The next figure shows the sets ( n ) for

1  n  4. Note that the set (1) has only one member – a single graph with one vertex and no

edges incident on it; an isolated vertex.

Figure 7: The sets(1),(2), and(3)

Page 5 of 22 CPSC 3115 Version of December 14, 2004

Figure 9: Illustration of Vertex Degrees

In this figure, d 1

= d( v 1

) = 2, d 2

= d( v 2

) = 4, d 3

= d( v 3

) = 3, d 4

= d( v 4

) = 2, and

d 5

= d( v 5

) = 3. Note that

n

j

j

d

1

= 2 + 4 + 3 + 2 + 3 = 14 = 2 m. This is not a coincidence.

A vertex of zero degree is called an isolated vertex in that it has no edges incident on it and thus

is not adjacent to any other vertex. At this point it will be convenient to state a prove a few

lemmas and theorems related to vertex degree.

Lemma 2 : Let G be an ( n , m )-graph and let v  V(G). Then 0  d( v )  ( n – 1).

Proof: The assertion that d( v )  0 comes from the fact that d( v ) is a counting number.

If v  V(G), there are only ( n – 1) other vertices in V(G) to which v may be adjacent, thus it

follows that d( v )  ( n – 1).

Theorem 3 : Let G be an ( n , m )-graph with V(G) = { v 1

, v 2

, …., v n

}. Let the degree of vertex v j

be

given by d j

= d( v j

). Then

n

j

j

d

1

= 2 m.

Proof: Every edge in G is incident on two vertices; hence, when the degrees of the vertices are

summed, each edge is counted twice. This completes the proof.

Theorem 4 : Let G be an ( n , m )-graph, with mn. Then G has at least two vertices of degree

d( v )  2.

Proof: Assume that G has only one vertex with degree d( v )  2. By Lemma 2, we have

d( v )  ( n – 1), so we let the one vertex of degree greater than 1 have degree ( n – 1). The

maximum value of

n

j

j

d

1

is then 1( n – 1) + ( n – 1)1 = 2( n – 1), being generated by the one

vertex of degree ( n – 1) and the ( n – 1) vertices of degree 1. As a result of theorem 3, we have

m  ( n – 1), which contradicts the assumption that mn.

A graph G is called regular if all of its vertices have the same degree and is called

pseudoregular if the degrees of its vertices differ by at most one. For a vertex v , define N( v ),

the open neighborhood of v , as the set of vertices adjacent to v. As each edge incident on a

vertex v connects it to an adjacent vertex, it follows immediately that |N( v )| = d( v ). The closed

neighborhood of a vertex, denoted N[ v ], adds the vertex itself to its open neighborhood; N[ v ] =

N( v )  { v }. Note that { v } is the set containing only one element – the vertex v.

Page 7 of 22 CPSC 3115 Version of December 14, 2004

A regular graph in which all vertices have degree k is called k -regular. The 3-regular graphs are

called cubic and have been studied extensively.

Figure 10: A 2-regular and a 3-regular graph

Note that in the above figure, that the 3-regular graph has been drawn so that its vertices appear

at the corner of a cube. This is one of the reasons for the name “cubic”. The next topic to be

discusses considers the number of vertices that are adjacent to each of two distinct vertices.

Let u and v be two distinct vertices in ( n , m )-graph G. The codegree of the two vertices, denoted

by codeg( u , v ) , is the number of vertices adjacent to both u and v. In set notation, we can write

codeg( u , v ) = |N( u )  N( v )|. We now give an upper limit on the codegree of two vertices.

Lemma 5: Let u and v be two distinct vertices in ( n , m )-graph G.

Then 0  codeg( u , v )  ( n – 2).

Proof: The assertion that codeg( u , v )  0 comes from the observation that it is a counting

number. The upper limit comes from the observation that there are only ( n – 2) other vertices in

G, so that |N( u )  N( v )|  ( n – 2).

We now place a lower limit on the codegree of two adjacent vertices.

Lemma 6: Let x and y be two adjacent vertices in an ( n , m )-graph G. Then

d( x ) + d( y )  Codeg( x , y ) + n.

Figure 11: The Degrees and Codegree of Two Adjacent Vertices

Page 8 of 22 CPSC 3115 Version of December 14, 2004

Definition: A tree is a connected acyclic graph.

Definition: A rooted tree is a tree in which one vertex has been distinguished and called the

root. Most trees of interest in computer science are rooted trees.

Trees play only a small part in the analysis of networks. The one tree of greatest importance for

networks is the star graph , also called K 1,n-

(see below). The next figure shows two of the

smaller star graphs K 1,

(also called a P

3

, see below) and K

1, 4

. Note that we, as computer science

people, see each tree as a rooted tree with the root vertex (or root node) being vertex 1.

Figure 13: Two Star Graphs

Recalling that a subgraph H of graph G is a spanning subgraph if V(H) = V(G) and E(H) 

E(G). If H is a spanning subgraph of G and H happens to be a tree, then H is said to be a

spanning tree of the graph G.

Upon reflection, one should realize that a graph G may have many distinct spanning trees; indeed

it is almost obvious that a graph G has a unique spanning tree if and only if G is itself a tree. The

next figure shows a graph and its three spanning trees.

Figure 14: A Graph G and Its Spanning Trees

In the example above, we see a (4, 4)-graph G (4 vertices and 4 edges) and its 3 spanning trees

T

1

, T

2

, and T 3

. As we shall prove soon, a tree on four vertices must have exactly three edges. In

the above example there are three edges that can be removed to yield a tree; removal of edge (1,

  1. will cause the graph to be disconnected. Note that each of T 1

and T 3

is isomorphic to the

graph P 4

  • a path on four vertices, while T

2

is isomorphic to K

1,

  • the star graph on three

vertices.

We will soon quote one of the basic theorems regarding trees, but need to begin with a definition

and a simple lemma. The definition serves to eliminate trivial exceptions from our theorems on

trees.

Definition: A nontrivial tree is a tree with at least two vertices.

Page 10 of 22 CPSC 3115 Version of December 14, 2004

Lemma 7: Every nontrivial tree has at least two vertices of degree 1.

Proof: Let P be a longest path in a nontrivial tree T and let u and v be the end-nodes of the path

P. Since T is acyclic, u and v each have only one neighbor in P, and since P is a longest path

each has no neighbors in T – P (else the path could be extended). Thus there must be at least two

vertices of degree one in a nontrivial tree.

Before we quote the “big theorem” we must explain a new bit of terminology. Let G be an

( n , m )-graph on at least two vertices, and let u and v be vertices that are not adjacent in G. Then

by G + ( u , v ) we denote the ( n , m + 1 )-graph formed from G by adding making the two vertices

u and v to be adjacent by adding the edge ( u , v ). Another term often used is G + e , denoting the

addition of a new edge to a graph G.

Theorem 8: The following statements are equivalent.

  1. G is a tree with n vertices and m edges.
  2. Every two distinct vertices of G are connected by a unique path.
  3. G is connected and m = n – 1.
  4. G is acyclic and m = n – 1.
  5. G is acyclic and if any two nonadjacent vertices of G are joined by an edge

e , then G + e , the graph with one edge added, has exactly one cycle.

Proof: This is a well-known result. The theorem as stated is a slight rewording of Theorem 1.

in reference [R01]. We shall adapt the proof from that reference and show the proof as an

example of how graph theorists think. If the statements are all equivalent, then they must either

be all true or all false for a given graph. The strategy for a proof of equivalence is quite simple;

we just prove that any one statement implies all of the other statements. In this case we shall

show a circular equivalence; thus 1  2, 2  3, 3  4, 4  5, and 5  1.

Proof that 12

Since G is a tree, it is a connected graph without cycles. Since G is connected, every two distinct

nodes in G are connected by a path. Suppose two distinct nodes u and v in G that are connected

by two distinct paths P and P*. Let w be the first node of path P (as we traverse from u to v )

such that w is on both P and P, but its successor on P is not on P. Note that w = v is allowed in

this proof. We then follow path P from u to w and path P* backwards from w to u to form a

cycle. Thus the assumption of two distinct paths between any two vertices implies that the graph

contains cycles and cannot be a tree.

Proof that 23

If every distinct pair of nodes in G is connected by a unique path, then G is connected by

definition. We prove that n = m + 1 by induction. Reference to figures 7 and 8 of this work will

show that the statement is true for n = 2, 3, and 4. It is also vacuously true for n = 1. Now

assume that the result is true for all graphs with fewer than n vertices.

Suppose that G is a graph with n nodes ( n  2), m edges, and let v be one of the nodes of degree

one in G (see Lemma 6). Then G – v , the graph obtained by removing the vertex v and the edge

incident on it from G, has ( n – 1) vertices, one less than G, and still satisfies property 2. By the

inductive hypothesis G – v has m = ( n – 1) – 1, thus the number of edges in G is m = ( n – 1).

Page 11 of 22 CPSC 3115 Version of December 14, 2004

Figure 15: A Graph with Radius 3 and Diameter 5

In order to compute the radius and diameter of the graph, we first compute the eccentricity of

each vertex. We construct the distance matrix for the graph.

Vertex d(v, 1) d(v, 2) d(v, 3) d(v, 4) d(v, 5) d(v, 6) d(v, 7) d(v, 8) d(v, 9) e(v)

Note that the maximum of the vertex eccentricities is 5; this is the diameter of the graph. The

minimum of the vertex eccentricities is 3; this is the radius of the graph. A central vertex is a

vertex with eccentricity equal to the radius of the graph. The center of a graph , denoted Z(G),

is the set of all central vertices; here Z(G) = {4, 5, 6}. Since the radius of the graph is defined to

be the minimum of the eccentricities of the vertices, it should be obvious that there is at least one

vertex of minimum eccentricity, and thus the center Z(G) has at least one element.

Theorem 10: For every connected graph G, rad(G)  diam(G)  2  rad(G).

Proof: The inequality rad(G)  diam(G) arises from the definition that the radius is the

minimum of a set of numbers while the diameter is the maximum of the same set of numbers. In

order to verify the second inequality, select vertices u and v in G such that d( u , v ) = diam(G).

Let w be any vertex in Z(G), the center of G. Then d( u , w )  e( w ) and d( v , w )  e( w ), where

e( w ) = rad(G). It can be shown that d( u , v )  d( u , w ) + d( w , v ) for any three vertices u , v , and w ,

so we have d( u , v )  d( u , w ) + d( w , v ) = 2  e( w ) = 2  rad(G).

An ( n , m )-graph G is called k -partite , 1 < kn , if the vertices of G can be partitioned into k

vertex sets V 1

, V

2

, ... , V

k

such that no two vertices in the same set are connected by an edge in G.

The vertex sets are called parts of V(G). For k = 2, we have a 2-partite graph, more commonly

called a bipartite graph. A 3-partite graph is also called a tripartite graph.

Page 13 of 22 CPSC 3115 Version of December 14, 2004

Figure 16: Some Bipartite Graphs and a Tripartite Graph

Fig 16a is K 2, 3

. Both fig 16b and 16c are K 3, - fig 16c is just drawn funny. Note that the

vertices on the left and right side in fig 16c are not adjacent. Fig 16d is not a complete graph.

Before continuing, we note that any tree is also a bipartite graph. We show this fact by

constructing the two vertex parts of the graph. Let T be a tree on n vertices and hence ( n – 1)

edges. Select one vertex, call it u , and place it in the vertex part called V 1

. Place every vertex at

distance 1 from u into vertex part V 2

, every vertex distance 2 from u into vertex part V 1

, and in

general every vertex at odd distance from u into V 2

and at even distance from u into V 1

. Since

Theorem 8 assures us that the path from any vertex to u is unique, we do not try to place any

vertex into both V 1

and V 2

. We now show that no two vertices in a vertex part can be adjacent.

Suppose that v and w are two vertices in a vertex part that are adjacent. We have paths from u to

both v and w , thus creating the cycle from the path from u to w , the edge ( w , v ) and the path from

v to u. But the tree T is acyclic, so that vertices in the same vertex part cannot be adjacent and T

is bipartite. In a rooted tree, think of one vertex part as all vertices at an odd distance from the

root vertex and the other vertex part as the rest of the vertices.

A graph G is called complete if every pair of its vertices is connected by an edge. By K n

we

denote a complete graph on n vertices. C n

denotes the cycle on n vertices , and P n

denotes the

path on n vertices. Note that for n  2, K n

has n ( n – 1)/2 edges, C

n

has n edges and P

n

has

( n – 1) edges. K 3

, which is isomorphic to C 3

, is called the triangle graph , or triangle. K 1

denotes the empty graph on one vertex, it is a graph with one isolated vertex and no edges.

G is called a complete k -partite graph if it is k -partite and whenever two vertices are in different

parts of the graph they are connected by an edge in E(G). A complete 2-partite graph is called

complete bipartite and is denoted by K a , b

, where the number of vertices in the two vertex parts

is a and b respectively. K 1, n -

denotes a star graph on n vertices with ( n – 1) edges. K 1, n -

is a

complete bipartite graph; it is also a tree. Note that K 1,

is isomorphic to P 3

. Note that there is

only one connected graph on two vertices; it can be called either K 1,

or K 2

or P 2

, but not C 2

as a

cycle must have at least three vertices.

For an arbitrary graph G, n G denotes n copies of the graph G. Let n K 1

denote the empty graph

on n vertices. Then we have m( n K 1

) = 0; n K 1

 ( n, 0). The maximum number of edges in a

graph in ( n ) equals m(K n

) = n ( n – 1)/2.

Page 14 of 22 CPSC 3115 Version of December 14, 2004

Proposition 11: Let G and H be two ( n , m )-graphs such that the degree sequence of G dominates

the degree sequence of H. Then DSS(G) > DSS(H).

Proof: Let D(G) = (d 1

, d 2

, …, d n

) and D(H) = (d' 1

, d' 2

, …, d' n

) denote the degree sequences of

( n , m )-graphs G and H, respectively. Since the degree sequence of G dominates that of H, there

must be at least one index k , 1  kn , such that d k

d’ k

Let k be the smallest index for which d k

d’ k

and let d k

= d’ k

  • d , with d > 0.

Since the degree sequence is ordered, we have d’ k

 d’ j

for all j > k. Since the two degree

sequences add to the same sum, we must have

d

d d'

n

i k 1

i

n

i k 1

i

We alter the degree sequence of H by adding the value to d to d’ k

, increasing DSS(H) by

2 d d’ k

  • d

2

. Decreasing d’ k+

to balance the sum then decreases the new value of DSS(H) by

d

2

  • 2 d d’

k+

, yielding a net change of 2 d d’

k

  • 2 d d’

k+

, which is a positive number. Thus by

modifying the degree sequence of H to make it look more like that of G, we have increased the

value of DSS(H). One can easily see that these changes to make the degree sequence of H

identical to that of G continually increase DSS(H). Thus we must have started with DSS(H) <

DSS(G).

A sparse graph is an ( n , m )- graph for which m   n

2

/4, and a dense graph is an ( n , m )-graph

for which m >  n

2

/4, where  x  is the largest integer not greater than the real number x.

n

2

/4 = ( n

2

/4) if and only if n is an even integer.

For graphs G and H, let *H(G) denote the number of induced subgraphs of G which are

isomorphic to H and #H(G) denote the number of (not necessarily induced) subgraphs of G

which are isomorphic to H. Thus #P 3

(G) and *P 3

(G) denote the number of subgraphs and the

number of induced subgraphs, respectively, of G isomorphic to P 3

, the path on three vertices.

#K

3

(G) denotes the number of subgraphs isomorphic to K 3

, the triangle. Because all triangles as

subgraphs are induced, #K 3

(G) = *K

3

(G); we use *K

3

(G) to denote the number of triangles in a

graph G. Any graph for which *K 3

(G) = 0 is said to be triangle-free or K 3

-free. We shall see

that bipartite graphs are K 3

-free.

Recall that a bipartite graph is an ( n , m )-graph G with the property that V(G) can be broken

into two disjoint sets V 1

and V

2

, such that a vertex in V

1

is adjacent only to vertices in V

2

and a

vertex in V 2

is adjacent only to vertices in V 1

. We now prove one result of major importance to

our work: that bipartite graphs do not contain a K 3

. We do this by first proving the more general

result and then applying an obvious definition.

Theorem 12: A graph G is bipartite if and only if all of its cycles are even.

Proof: This proof is quite important, so is quoted almost verbatim from Theorem 1.3 in

Distances in Graphs [R01]. If G is bipartite, then its vertex set V can be partitioned into two sets

V

1

and V 2

so that every edge of G joins a vertex in V 1

with a vertex in V 2

. Thus every cycle [of

length k ] v 1

, v

2

, …, v

k

, v

1

in G necessarily has its oddly subscripted vertices in V

1

, say, and the

others in V 2

, and so its length is even. [Otherwise, we would have the edge ( v k

, v 1

) connecting

two vertices in V 1

, contradicting our hypothesis.]

Page 16 of 22 CPSC 3115 Version of December 14, 2004

For the converse, we assume without loss of generality that G is connected (for otherwise we can

consider the components of G separately). Take any vertex v 1

 V(G) and let [vertex set] V

1

consist of v 1

and all vertices at even distance from v 1

, while [vertex set] V 2

= V – V

1

. Since all

cycles of G are even, every edge of G joins a vertex of V 1

with a vertex of V 2

. For suppose there

is an edge ( u , v ) joining two vertices of V 1

. Then the union of geodesics [shortest paths] from v 1

to v and from v 1

to u together with the edge ( u , v ) contains an odd cycle, a contradiction.

We now present the important result as a corollary to the above theorem.

Corollary 13: A bipartite graph does not contain a K 3

(triangle).

Proof: We have just shown that a bipartite graph does not contain any cycle of odd length.

Specifically, it does not contain a C 3

(a cycle on three vertices), which is isomorphic to a K 3

(complete graph on three vertices).

In terms that we shall use later, we have just shown that if G is a bipartite graph then

*K

3

(G) = #K

3

(G) = 0.

We now link sparse and dense graph to graphs containing triangles by use of a famous theorem

due to Turan. Turan’s work is considered the first theorem in an important area of graph theory,

called extremal graph theory, which we now discuss briefly.

Extremal Graph Theory

The study of extremal graphs is generally the study of the largest or smallest graphs that have

certain properties. The best reference on the topic is the book Extremal Graph Theory by

Bollobas [R03], a book that is rare and hard to find. The book contains references to many of the

original papers in the subject; unfortunately many of them were written in Hungarian and have

yet to be translated.

For these notes, we focus on extremal graph theory of complete subgraphs; that is subgraphs that

are isomorphic to a complete graph K n

. We quote from chapter VI of Bollobas [R03] to

introduce the subject.

Given a graph F

1

, what is ex( n ; F

1

), the maximum number of edges of a graph of

order n [having n vertices] not containing F 1

as a subgraph. … [The] best known

extremal result of graph theory [is] Turan’s theorem. This result, proved in 1940

and always considered to be the first extremal theorem, answers this question

above in the case F 1

= K

r

Turan’s theorem is based on specific complete q -partite graphs, denoted T q

(n).

Definition: Given natural numbers n and q , denote by T q

( n ) the complete q -partite graph with  n /

q , ( n + 1)/ q , … ( n + q – 1)/ q  vertices in each of the vertex sets. Note that T q

( n ) is the unique

complete q -partite graph of order n whose vertex sets have size as equal as possible. For

convenience, we number the vertex parts beginning with 0, so that vertex part k has size

( n + k )/ q , 0  k  ( q – 1).

Page 17 of 22 CPSC 3115 Version of December 14, 2004

Figure 18: A Graph and Its 3-Vertex Induced Subgraphs

In the example above, we see a (4, 4)-graph and the subgraphs induced on the three distinct

three-vertex subsets of {1, 2, 3, 4}. The subgraph <1, 2, 3> is a K 3

, which contains three non-

induced P 3

’s, one centered on each of its vertices. The graph <1, 2, 4> is K 1

 K

2

, also called a

K

1

K

2

. The subgraph <2, 3, 4> is an induced P 3

As was mentioned above, there are three non-induced P 3

’s in the above graph – one centered at

vertex 1, one centered at vertex 2, and one centered at vertex 3. As a result we have one induced

P

3

and three non-induced P 3

’s, for a total of four. Thus, for this graph we have *P 3

(G) = 1,

*K

3

(G) = 1, S

3

(G) = 2, and #P 3

(G) = 4.

Proposition 18: For any graph G, #P 3

(G) = *P

3

(G) + 3*K

3

(G).

Proof: Let u , v , and w be the vertices of a triangle in G. There is a P 3

centered on each of the

vertices u , v , and w. Since none of these is an induced P 3

, each triangle contributes 3 to the count

#P

3

(G) but 0 to the count *P 3

(G). The conclusion then follows by noting that each induced P 3

contributes 1 to the count of #P 3

(G) and 1 to the count of *P 3

(G). In order to drive this point

home, let’s take another look at figure 18, presented above, focusing on the triangle induced by

vertices 1, 2, and 3. Note that none of the P 3

’s defined on these 3 vertices is induced, as each

lacks one edge incident only on vertices in the set {1, 2, 3}.

Figure 19: A Graph and Some of Its 3-Vertex Subgraphs

Page 19 of 22 CPSC 3115 Version of December 14, 2004

WEIGHTED GRAPHS

We now introduce the concept of a weighted graph – a graph in which there are weights

associated with the edges. These weights can represent distances, costs, capacities, or any

other measure that is associated with an edge and that can be quantified as a real number.

For most weighted graphs, the weights are represented as non-negative integers, although

negative edge weights appear to be used for some applications. To this author’s knowledge,

no work has been done on graphs with edge weights represented as complex numbers.

We begin with a formal definition of a weighted graph, and then move on to a more natural

discussion of the concept in terms of drawings and adjacency matrices.

Definition: A weighted graph G is a triple (V, E, W) in which V is a non-empty set of

vertices, E  V  V is a set of edges (the graph can be directed or undirected), and W is a

function from the edge set E into R , the set of real numbers. For any edge e  E, w( e ) is the

weight of e. In networks, the edge weights often represent the link transmission capacities.

We shall immediately revert to the standard practice of representing all edge weights as non-

negative integers, most commonly using only positive integers. It can be proven that for

most cases, this restriction does not present any difficulties. We shall begin with a simple

undirected graph, in which all edges can be said to have a weight of one and then develop an

example of the same graph with weighted edges. This example is taken, almost verbatim,

from an excellent textbook [R04] by Sara Baase and Alan Van Gelder.

Figure 20: An Undirected Graph and Its Adjacency Matrix

We now add edge weights to this example, making it a weighted graph. Note that the only

change to the adjacency matrix representation is to replace the 1 by the weight of the edge.

Suppose that A is the adjacency matrix of a graph. We have two cases.

Unweighted Graph Weighted Graph

A

IJ

= 0 if no edge A IJ

= 0 if no edge

A

IJ

= 1 if (I, J) is an edge A IJ

= weight(I, J) if (I, J) is an edge

Page 20 of 22 CPSC 3115 Version of December 14, 2004