















Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
Prepare for your exams
Study with the several resources on Docsity
Earn points to download
Earn points by helping other students or get them with a premium plan
Community
Ask the community for help and clear up your study doubts
Discover the best universities in your country according to Docsity users
Free resources
Download our free guides on studying techniques, anxiety management strategies, and thesis advice from Docsity tutors
Graph Basic Concept,Walks,Connectivity and Distance,Eulerian and Hamiltonian Graphs.
Typology: Exercises
1 / 23
This page cannot be seen from the preview
Don't miss anything!
Bachelor Degree in Informatics Engineering
Facultat d’Inform`atica de Barcelona
February 2019
Departament de Matematiques Universitat Polit
ecnica de Catalunya
The problems of this collection were initially gathered by Anna de Mier and Montserrat Mau- reso. Many of them were taken from the problem sets of several courses taught over the years by the members of the Departament de Matem`atica Aplicada 2. Other exercises came from the bibliography of the course or from other texts, and some of them were new. Since Mathematics 1 was first taught in 2010 several problems have been modified or rewritten by the professors involved in the teaching of the course.
We would like to acknowledge the assistance of the scholar Gabriel Bernardino in the writing of the solutions.
Translation by Anna de Mier and the scholar Bernat Coma.
This problem list has been revised during the academic year 2018/2019.
The following are some important families of graphs that we will use often. Let n be a positive integer and V = {x 1 , x 2 ,... , xn}.
The null graph of order n, denoted by Nn, is the graph of order n and size 0. The graph N 1 is called the trivial graph.
The complete graph of order n, denoted by Kn, is the graph of order n that has all possible edges. We observe that K 1 is a trivial graph too.
The path graph of order n, denoted by Pn = (V, E), is the graph that has as a set of edges E = {x 1 x 2 , x 2 x 3 ,... , xn− 1 xn}.
The cycle graph of order n ≥ 3, denoted by Cn = (V, E), is the graph that has as a set of edges E = {x 1 x 2 , x 2 x 3 ,... , xn− 1 xn, xnx 1 }.
The wheel graph of order n ≥ 4, denoted by Wn = (V, E), is the graph that has as a set of edges E = {x 1 x 2 , x 2 x 3 ,... , xn− 1 x 1 } ∪ {xnx 1 , xnx 2 ,... , xnxn− 1 }.
Let r and s be positive integers.
A graph is r-regular if all vertices have degree r.
A graph G = (V, E) is bipartite if there are two non-empty subsets V 1 and V 2 such that V = V 1 ∪ V 2 , V 1 ∩ V 2 = ∅ and, for every edge uv ∈ E, we have u ∈ V 1 and v ∈ V 2 , or vice versa. That is, there are no edges uv with u, v ∈ V 1 or u, v ∈ V 2. The sets V 1 and V 2 are called the stable parts of G. If every vertex from V 1 is adjacent to every vertex of V 2 , we say that the graph is complete bipartite and we denote it by Kr,s, where |V 1 | = r and |V 2 | = s. The graph K 1 ,s is called a star graph.
1.2. Exercises 3
1.1 For each of the graphs Nn, Kn, Pn, Cn and Wn, give:
a drawing for n = 4 and n = 6;
the adjacency matrix for n = 5;
the order, the size, the maximum degree and the minimum degree in terms of n.
1.2 For each of the following statements, find a graph with the required property, and give its adjacency list and a drawing.
A 3-regular graph of order at least 5.
A bipartite graph of order 6.
A complete bipartite graph of order 7.
A star graph of order 7.
1.3 Find out whether the complete graph, the path and the cycle of order n ≥ 1 are bipartite and/or regular.
1.4 Give the size:
of an r-regular graph of order n;
of the complete bipartite graph Kr,s.
1.5 Let V = {a, b, c, d, e, f }, E = {ab, af, ad, be, de, ef } and G = (V, E). Determine all the subgraphs of G of order 4 and size 4.
1.6 The following five items refer to the graph G defined as follows. The set of vertices is V = { 0 , 1 , 2 , 3 , 4 , 5 , 6 , 7 , 8 }, and two vertices u and v are adjacent if |u − v| ∈ { 1 , 4 , 5 , 8 }. Determine the order and the size of the following subgraphs of G:
The subgraph induced by even vertices.
The subgraph induced by odd vertices.
The subgraph induced by the set { 0 , 1 , 2 , 3 , 4 }.
A spanning subgraph with as many edges as possible but without cycles.
1.7 Consider the graph G = (V, E) with V = { 1 , 2 , 3 , 4 , 5 } and E = { 12 , 13 , 23 , 24 , 34 , 45 }. Give the set of edges, the incidence and adjacency matrices, and a drawing of the graphs Gc, G − 4, G − 45 and G + 25.
4 Chapter 1. Graphs: basic concepts
1.8 Consider a graph G = (V, E) of order n and size m. Let v be a vertex and e an edge of G. Give the order and the size of Gc, G − v and G − e.
1.9 Find out whether the complement of a regular graph is regular, and whether the comple- ment of a bipartite graph is bipartite. If so, prove it; if not, give a counterexample.
1.10 Give the set of edges and a drawing of the graphs K 3 ∪ P 3 and K 3 × P 3 , assuming that the sets of vertices of K 3 and P 3 are disjoint.
1.11 Consider the graphs G 1 = (V 1 , E 1 ) and G 2 = (V 2 , E 2 ). Give the order, the degree of the vertices and the size of G 1 × G 2 in terms of those of G 1 and G 2.
1.12 Prove or disprove the following statements:
If G 1 and G 2 are regular graphs, then G 1 × G 2 is regular.
If G 1 and G 2 are bipartite graphs, then G 1 × G 2 is bipartite.
1.13 Draw all the graphs that have V = {a, b, c} as set of vertices.
1.14 Consider graphs whose set of vertices is [7] = { 1 , 2 , 3 , 4 , 5 , 6 , 7 }. Compute how many of them are there...
1)... with exactly 20 edges.
2)... with exactly 16 edges.
3)... in total.
1.15 For each of the following sequences, find out if there is any graph of order 5 such that the degrees of its vertices are given by that sequence. If so, give an example.
3, 3 , 2 , 2 , 2.
4, 4 , 3 , 2 , 1.
1.16 Prove that if a graph is regular of odd degree, then it has even order.
1.17 Let G be a bipartite graph of order n and regular of degree d ≥ 1. Which is the size of G? Could it be that the order of G is odd?
1.18 Prove that the size of a bipartite graph of order n is at most n^2 /4.
1.19 Let G be a graph with order 9 so that the degree of each vertex is either 5 or 6. Prove that there are either at least 5 vertices of degree 6 or at least 6 vertices of degree 5.
6 Chapter 1. Graphs: basic concepts
1.26 A graph is self-complementary if it is isomorphic to its complement. Prove that there are no self-complementary graphs of order 3, but there are such graphs of order 4 and 5.
1.27 A graph is self-complementary if it is isomorphic to its complement.
How many edges does a self-complementary graph of order n have?
Prove that if n is the order of a self-complementary graph, then n is congruent with 0 or with 1 modulo 4.
Check that for n = 4k with k ≥ 1, the following construction yields a self-complementary graph of order n: let us take V = V 1 ∪ V 2 ∪ V 3 ∪ V 4 , where each Vi contains k vertices; the vertices of V 1 and V 2 induce complete graphs; also, we have all edges between V 1 and V 3 , between V 3 and V 4 , and between V 4 and V 2.
How could we modify the previous construction to build a self-complementary graph of order 4k + 1?
1.28 Let G be a graph of order n ≥ 6.
Show that either G or Gc^ has a vertex v of degree at least 3.
Prove that G or Gc^ contains a cycle of length 3. (Consider the adjacencies between the neighbours of vertex v above.)
Prove that at a meeting of at least 6 people, there are always 3 that mutually know each other, or 3 that mutually do not know each other.
2.1 In each of the following graphs, find paths of length 9 and 11, and cycles of length 5, 6, 8 and 9, if possible.
1
2
3
5 4
(^1 )
10 9
11 8
7 1
2
3
5 4
6
10 9
8
7
G G 2
2.2 Prove that if G is a graph of minimum degree d, then G contains a path of length d.
2.3 A graph has order 13 and 3 connected components. Prove that one of the components has at least 5 vertices.
2.4 Use the algorithm DFS to find out whether the following graphs, given by their adjacency lists, are connected, and otherwise determine their connected components. Consider that the set of vertices is alphabetically ordered.
a b c d e f g h i j d d h a a a b c b b e g b d d i g g f i e j j f
a b c d e f g h i j k l m b a f b b c b b c a c g j d i h g e d k b i e k m g h j
9
2.15 Find the diameter of the following graphs.
Kn.
Graphs of exercise 2.1.
Kr,s.
Cn.
Wn.
Pn.
2.16 For each of the following statements, give a connected graph G = (V, E) and a vertex u ∈ V that satisfies it.
Note: D(G) is the diameter of G.
2.17 Let G = (V, E) be a connected graph and v ∈ V. Let us introduce the following concepts:
I The eccentricity of the vertex v, e(v), is the maximum of the distances from v to any other vertex of the graph, that is, e(v) = max{d(v, x) : x ∈ V }.
I The radius of G, r(G), is the minimum of the eccentricities of the vertices of G, that is, r(G) = min{e(v) : v ∈ V }.
I A central vertex of G is a vertex u such that e(u) = r(G).
Answer the following questions.
Find the eccentricities, the radius and the central vertices of: a) the graphs from exercise 2.1; b) G = ([8], { 12 , 14 , 15 , 23 , 34 , 38 , 46 , 47 , 56 , 67 , 78 }).
Give an example of a graph with the same radius and diameter.
Give an example of a graph whose diameter is twice its radius.
Prove that, for each graph G, r(G) ≤ D(G) ≤ 2 r(G), where D(G) is the diameter of G.
2.18 Let G be a graph of order 1001 so that each vertex has degree ≥ 500. Prove that G has diameter ≤ 2.
3.1 For each of the following graphs, either find an Eulerian circuit or prove that there is not one.
G 1 G 2 G 3 G 4 G^5
G 6 G 7 G 8 G 9 G 10
3.2 Find out if the following figures can be drawn without lifting the pencil from the paper and without repeating any line.
3.3 Determine the minimum number of times that one needs to lift the pencil from the paper to draw each of the figures below without repeating any line.
4.1 For each integer n ≥ 1, let an be the number of non-isomorphic trees of order n. Check the values in the following table:
n 1 2 3 4 5 6 7 an 1 1 1 2 3 6 11
4.2 Prove that a tree of order n ≥ 2 is a bipartite graph.
4.3 Let T 1 be a tree of order n and size 17, and let T 2 be a tree of order 2n. Find n and the order and the size of T 2.
4.4 Find how many trees of order n there are with...
1)... maximum degree n − 2.
2)... maximum degree n − 3.
4.5 Let T be a tree of order 12 that has exactly 3 vertices of degree 3 and exactly one vertex of degree 2.
Find the degree sequence of T.
Find two non-isomorphic trees with this degree sequence.
4.6 Find a connected graph that is not a tree but in which every vertex of degree ≥ 2 is a cut vertex.
2 +
d(u)≥ 3
(d(u) − 2).
13
n 1 = 2 +
i=
(i − 2)ni.
n 1 = 2 +
i=
(i − 2)ni,
implies that G is a tree.
4.8 Let G be a connected graph where each vertex has degree either 1 or 4. Let k be the number of vertices of degree 4. Prove that G is a tree if, and only if, the number of vertices of degree 1 is 2k + 2.
4.9 Let T be a tree of order n ≥ 2 and maximum degree ∆. Prove that T has at least ∆ leaves.
4.10 Let T be a tree of order n ≥ 3. Prove that the following statements are equivalent:
a) T is isomorphic to the star K 1 ,n− 1.
b) T has exactly n − 1 leaves.
c) T has maximum degree n − 1.
d) T has diameter equal to 2.
4.11 Let G be a graph of order n and size m. Prove that the following statements are equivalent:
a) The graph G is connected and has only one cycle.
b) There is an edge e of G such that G − e is a tree.
c) The graph G is connected and n = m.
4.12 Compute the number of spanning trees of the cycle graph Cn and of the complete bipartite graph K 2 ,r.
4.13 Give two non-isomorphic graphs of order n ≥ 4 that have the following property: when we apply the algorithm BF S with initial vertex v, we obtain a star graph K 1 ,n− 1 in which v is a leaf. Point out which is vertex v in each of the two graphs.
A.1 Find the adjacency matrix and the incidence matrix of the graph G = (V, E) where V = {a, b, c, d, e} and E = {ab, ac, bc, bd, cd, ce, de}.
A.2 Give the adjacency list and a drawing of the graph G = ([5], E) whose adjacency matrix is (^)
A.3 Prove that if the order of a graph is a multiple of 4 and the size is odd, then the graph is not regular.
A.4 Prove that if a graph G has minimum degree 1, maximum degree k and order n > 2 k, then G has at least 3 vertices with the same degree.
A.5 Let G be a graph of order ≥ 7 such that each vertex has degree > 5. Prove that G has size ≥ 21.
A.6 Let n ≥ 3 and 0 ≤ k ≤ n be integers, and consider the complete graph Kn with [n] as set of vertices.
Compute the size of the subgraph induced by [k].
Compute how many edges have an end in [k] and the other in [n] \ [k].
Compute the size of the subgraph induced by [n] \ [k].
Using the previous results, prove that ( n 2
k 2
n − k 2
A.7 Find, up to isomorphism, all 4-regular graphs of order 7.
16 Review exercises
A.8 Let G be a self-complementary graph of order n, for n ≡ 1 (mod 4). Prove that there is an odd number of vertices of degree (n − 1)/2 and, therefore, that G contains at least one vertex of degree (n − 1)/2.
A.9 Consider the graph G = (V, E) where V = { 1 , 2 ,... , 15 } and two vertices i, j are adjacent if, and only if, their greatest common divisor is different than 1. Give the number of connected components of G and a path of maximum length.
A.10 Let G be a graph of order n and size m that does not have any cycle of length 3.
Prove that if u and v are adjacent vertices of G, then d(u) + d(v) ≤ n.
Prove that if n = 2k, then m ≤ k^2. Hint: Induction on k ≥ 1.
A.11 Prove that in a connected graph two paths of maximum length have at least one vertex in common, but not necessarily an edge in common. Hint: Assume that two paths of maximum length do not have any vertex in common and see if you can construct a path longer than the starting two.
A.12 Let G be a connected bipartite graph of order n ≥ 3 and d-regular. Prove that G is bridgeless.
A.13 Let G be a non-bipartite connected graph. Prove that between any two vertices of G there is a walk of odd length and a walk of even length. Hint: the characterization of bipartite graphs can be useful.
A.14 Prove that if a graph is regular with even order and odd size, then it is not Eulerian.
A.15 Let G be a graph of odd order such that G and Gc^ are connected. Prove that G is Eulerian if, and only if, Gc^ is Eulerian.
A.16 In each of the following cases, find out if it is possible to draw a closed continuous line that crosses exactly once each interior segment of the rectangle.
A.17 Let G be a bipartite graph that has a Hamiltonian path and let V 1 and V 2 be the stable parts. Prove that
A.18 Prove that if n ≥ 1 and m = n + 1, then the complete bipartite graph Km,n has a Hamiltonian path.