You are on page 1of 6

Graph Theory

Anushka Aggarwal
25 December 2023

§1 Lecture 1
A graph G is a pair, G = (V, E), of a set V of vertices together with a class of subsets E
(possibly empty) made up of pairs of elements from V.

Theorem 1.1
Let V1 , V2 , V3 · · · Vn be vertices of an undirected graph G, and let d1 , d2 , d3 · · · dn be
their degrees respectively. If q denotes the number of total edges in G, prove that

d1 + d2 + d3 · · · + dn = 2q

Left as an exercise.

Example 1.2
Is there any graph with 7 vertices where every vertex has a degree of 5? Consequently
prove that in a graph G with odd vertices, there exists at least one vertex with even
degree.

Proof. Let us try to prove by assuming the contrary, say no vertex has an even degree.
Using Theorem 1.1,
2q = odd + odd + odd.... + odd
the RHS is clearly odd because we are adding an odd number of odd integers, which
implies a contradiction.

Example 1.3
Seven students go on vacations. They decide that each will send a postcard to three
of the others. Is it possible that every student receives postcards from precisely the
three to whom he sent postcards?

Walkthrough. Firstly prove that the graph can be assumed to be not directed.
Then use Example 1.2 to finish the rest.

Example 1.4
Prove that no graph has all degrees different; that is, prove that in a degree sequence
there is at least one repeated number.

1
Anushka Aggarwal — 25 December 2023 Graph Theory

Walkthrough. Consider the cases when there is an isolated vertex and when there isn’t.
Use PHP in each cases to show contradiction.

Example 1.5
(a) Prove that for every even number n ≥ 4 there exists a graph with n vertices, all
of which have degree 3.

(b) Prove that for every number n ≥ 5 there exists a graph with a vertices, all
of which have degree 4.

Left as an exercise.
Definition 1.6. A subgraph of a graph G is a graph H such that every vertex of H is a
vertex of G, and every edge of H is an edge of G also. In other words, V ( H ) ⊂ V ( G ) and
E( H ) ⊂ E( G ). Figure below shows a graph G with some of its subgraphs.

Two graphs G1 and G2 with p vertices are said to be isomorphic if the vertices of G1 and
G2 can be labeled with the numbers from 1 top such that whenever vertex i is adjacent to
vertex j in G1 , then vertex i is adjacent to vertex j in G2 and conversely. Such a labeling
is the same as a one-to-one correspondence between V ( G1 ) and V ( G2 ) that preserves
adjacency.

The graph with n+1 vertices labeled x0 , x1 , · · · , xn and edges x0 x1 , x1 x2 , x2 x3 , · · · , xn−1 xn


is called a path of length n, denoted Pn . We call x0 and xn the end vertices of the path,
and we say the vertices x0 and xn are connected by the path P.

The cycle of length n, Cn , is the graph with a vertices x0 , x1 , · · · , xn−1 and the edges
x0 x1 , x1 x2 , x2 x3 , , xn−1 x0 . The graphs P. and C, as graphs are not so interesting, but as
subgraphs of larger graphs they are very interesting.

Example 1.7
Find a graph with 5 vertices having exactly 22 cycles, 13 cycles and 12 cycles respec-
tively.

Home work.
A graph G is connected if for any two vertices a and b there is a path from a to b.
Notice that if a connected graph contains a cycle, removing an edge from the cycle will
not disconnect the graph.

2
Anushka Aggarwal — 25 December 2023 Graph Theory

Theorem 1.8
If G is a connected graph with p vertices and q edges, then p ≤ q + 1.

Proof. The proof is by induction on the number of edges in G. If G has only one or two
edges then the theorem is true. Assume the theorem is true for each graph with fewer
than n edges. Let G be a given connected graph with n edges and p vertices. We consider
two cases.

Case 1: If G contains a cycle then we remove one edge of the cycle. We obtain a graph H,
and H is still connected and has n-1 edges. The number of vertices of H is still p, and by
the induction hypothesis p ≤ n − 1 + 1. Thus p ≤ n, and certainly p ≤ n + 1.

Case 2: If G does not contain a cycle, then we find a longest path in G. Let a and b
be the vertices at the end of the path. The vertex a must be of degree 1; otherwise the
path could be made longer, or there would be a cycle in G. We remove the vertex a and
the edge incident with a. We obtain a graph H; H is still connected, and H has p-1 vertices
and n-1 edges. Hence by the induction hypothesis, p − 1 ≤ (n − 1) + 1. It follows that
p ≤ n + 1, and therefore the theorem is true.
Definition 1.9. A tree is a connected graph that contains no subgraph isomorphic to a
cycle. For instance, a path of length n, P., is a tree. A forest is a graph that contains no
cycle. Every connected subgraph of a forest is a tree. Every subgraph of a forest is a
forest, and strangely enough, all subgraphs of trees are forests. Notice that every tree is
also a forest.

Theorem 1.10
If G is a tree with p vertices and n edges, then p = n+1.

Proof. The proof is by induction on the number of edges. If G is a tree with one edge,
then the theorem is true for G. Assume that the theorem is true for all trees with fewer
than n edges. Let G be a tree with n edges. Again we select a longest path in G with a
and b the ends of the path. Vertex a must have degree 1, since otherwisethe path could
be made longer or there would be a cycle in G. Then we subtract vertex a from G together
with the edge incident with a. We obtain a tree H with p-1 vertices and n-1 edges. By the
induction hypothesis, p − 1 = (n − 1) + 1. It follows that p = n + 1.

Theorem 1.11
If G is connected and p = n + 1 then G is a tree

Proof. Assume the theorem is not true. Then there must be a connected graph G with
p = n + 1 such that G is not a tree. If G is not a tree, then G contains a cycle, and thus
we can subtract an edge from G and obtain a graph H that is still connected and has p
vertices and n-1 edges. Also, p ≤ (n − 1) + 1, so p ≤ n, which is a contradiction since
we assumed p = n + 1. Therefore G is a tree.

3
Anushka Aggarwal — 25 December 2023 Graph Theory

Theorem 1.12
Every tree with at least one edge has at least two end vertices.

Homework.

Theorem 1.13
A graph G is a tree if and only if there exists exactly one path between any two
vertices.

Proof. We must prove two things since the theorem says ”if and only if.” First we as-
sume G is a tree. Let v1 and v2 be vertices of G. Since trees are connected there is a
path from v1 to v2 . Suppose there are two paths from v1 to v2 , P1 = v1 u1 u2 · · · un v2 and
P2 = v1 w1 w2 · · · wm v2 . If u1 is distinct from w1 , then we follow P1 until we find a vertex
contained in P1 that is also in P2 . (This may be v2 .)

Then we have a cycle. If u1 = w1 , then we look at u2 . For some i, ui ̸= wi , since


there are two v1 v2 paths by assumption. Then we follow P1 from ui−1 until we find a
vertex contained in P1 that is also in P2 , and then take P2 back to ui−1 , and again we
obtain a cycle. But G is a tree, so there are no cycles. Thus our assumption that there are
two v1 v2 paths is false.

Now we assume G is a graph with exactly one path between any two vertices. First
we observe that G is connected. Suppose that G contains a cycle, v1 v2 · · · vn v1 . There
are clearly two paths from v1 to vn . This is a contradiction, since G has exactly one path
between any two vertices. Hence G contains no cycles, and G is a tree.

Exercise

1. Let the average degree of a connected graph G be greater than two. Prove that G
has at least two cycles.

2. Let T be a tree with vertices of degree only 3 or 1. If T has 10 vertices of degree 3,


how many vertices of degree 1 are in T?

3. Let G be a connected graph with a vertices and n edges. How many cycles does G
have?

4. Let the average degree of the vertices of a connected graph G be equal to two. How
many cycles does G have?

5. Show that if G is a tree, and all the degrees of vertices in G are odd, then the number
of edges is odd.

6. Show by an example that the statement of the problem above is not true if G is not
a tree.

7. Prove that if q > ( p− 1


2 ), then G is connected.

8. Prove that Pn is the only tree with n + 1 vertices and only two vertices of degree 1.

9. Let F be a forest with 100 vertices and 90 edges. How many new edges must be
added without adding vertices to obtain a tree?

4
Anushka Aggarwal — 25 December 2023 Graph Theory

Solutions

1. Let G be a connected graph, and let d1 , d2 , · · · , d p be the degree sequence of G.


Then if the average degree is greater than two, we have

d1 + d2 + · · · + d p
2<
p

By Theorem 1.1, the sum equal 2q, so

2q
2< p or 2p < 2q or p < q
thus G is not a tree, and hence G has at least one cycle. We subtract an edge of the
cycle from G. We obtain a connected graph G ′ with p′ = p vertices and q′ = q − 1
edges. p′ ≤ q and G ′ is not a tree, so it contains a cycle. Since we destroyed a cycle
in G by removing an edge to obtain G ′ , G must have contained at least two cycles.

2. Let the total edges in the graph T be n then the number of edges is n − 1. We know
that
2(n − 1) = 3 ∗ 10 + 1 ∗ (n − 10)
since there are n − 10 vertices with degree 1.

2n − 2 = n + 20 ⇒ n = 22

Hence, there are 12 vertices with degree 1.

§2 Practice
§2.1 Easy
1. How small/large can the degree of a vertex in a graph with n vertices be?

2. Is there a family of graphs such that every vertex has degree 0? 1? 2? 1 or 2?

3. Given integers p and q, is there a graph such that every vertex either has degree p
or q?

4. Let a vertex be even if it has even degree, and odd if it has odd degree. Does every
graph have an even vertex? An odd vertex? Is there a graph with exactly one even
vertex? Exactly one odd vertex?

5. How many components can a graph on n vertices have?

6. Can a connected graph have more vertices than edges?

7. Give an example of a graph with no cut vertices and no cut edges.

8. If every vertex in a connected graph has even degree, can there be a cut vertex? A
cut edge?

5
Anushka Aggarwal — 25 December 2023 Graph Theory

§2.2 Olympiad Problems


1. (2001 IMOSL) Define a k-clique to be a set of k people such that every pair of them
are acquainted with each other. At a certain party, every pair of 3-cliques has at
least one person in common, and there are no 5-cliques. Prove that there are two
or fewer people at the party whose departure leaves no 3-clique remaining.

Solution. If there exists only one 3-clique, remove anyone in that clique. (If
there are no 3-cliques, we are done!) Otherwise, consider the following cases:
Case 1: There exist a pair of 3-cliques that share 2 people.
Let these 3-cliques be { A, C, D } and { B, C, D }. If every other 3-clique contained
either C or D, then removing C and D will leave no 3-clique remaining.
Otherwise, if there was a 3-clique that did not contain C or D, then it would have to
contain A and B to satisfy the condition. Call this 3-clique { A, B, E}. First notice that
{ A, B, C } and { A, B, D } are also 3-cliques now since A and B are now acquainted.
We claim that removing A and B will now suffice; suppose there was another
3-clique not containing A or B. This 3-clique must contain C, D, and E (to share
with { A, B, C }, { A, B, D }, and { A, B, E}). However, this means { A, B, C, D, E} is a
5-clique; contradiction.
Case 2: Every pair of 3-cliques has at most one person in common.
There exist two 3-cliques that share a person whom we will call A: name the 3-
cliques { A, B, C } and { A, D, E}. We now claim that every 3-clique in this case must
contain A.
Suppose there existed a 3-clique not containing A. It must share one person with
each of { A, B, C } and { A, D, E}; without loss of generality, let this 3-clique con-
tain B and D. But this means B and D are acquainted, and due to their mutual
acquaintance with A, { A, B, D } is a 3-clique, which shares 2 people with { A, B, C },
contradicting the premise of this case.
Thus, every 3-clique contains A, and so removing A will remove every 3-clique
2. Let n be a positive odd integer. There are n computers and exactly one cable joining
each pair of computers. You are to color the computers and cables such that no two
computers have the same color, no two cables joined to a common computer have
the same color, and no computer is assigned the same color as any cable joined to
it. Prove that this can be done using n colors.

Walkthrough. Label the vertices 0, 1, · · · , n1. Give each vertex a different colour.
For any two vertices x ̸= y , since n is odd, there is a unique z ∈ {0, 1, · · · , n1} such
that x + y = 2z(mod n). Give the edge xy the same colour as the vertex z. .
3. An animal with n cells is a connected figure consisting of n equal-sized cells. A
dinosaur is an animal with at least 2007 cells. It is said to be primitive if its cells
cannot be partitioned into two or more dinosaurs. Find with proof the maximum
number of cells in a primitive dinosaur.
4. A simple polygon is one where the perimeter of the polygon does not intersect itself
(but is not necessarily convex). Prove that a simple polygon P contains a diagonal
which is completely inside P such that the diagonal divides the perimeter into two
parts both containing at least n3 − 1 vertices. (Do not count the vertices which are
endpoints of the diagonal.)

You might also like