Assignment in Graph Theory 2024
Assignment in Graph Theory 2024
Topics from the textbook: GRAPH THEORY, chapters 11, 12 and 13.
Note that you can work in groups during the graph theory project, but each
student has to submit their own handwritten solutions.
1
Exercise 1. Definitions etc. from chapter 11. Make them short but accurate!
1. Give the symbolic way of expressing the connection between the graph G and the two sets V
and E that it consists of. What are the elements in E and V called?
2. What is the difference between a directed and an undirected graph?
3. What is typical for a walk, a trail and a path? What do we call the closed versions of these
respectively?
6. Explain as simply as possible what it means that two graphs are isomorphic.
7. How many paths of length 2 are there in K 4 ? (see task 11.2.8a in the textbook)
In general: How many paths of length m are there in
K n , m <n ?
10. What does it mean for a graph to be bipartite? (def.11.18) Give a sketch of
K2,3.
11. Explain with your own words what it means to have a graph that is planar (see Theorem 11.5)
(You may consider making a print card in electronics/computer science, where you want to
place all conductor-connections (the metal strips) – representing the edges – between the
components – that becomes vertices – without any of them crossing each other. One does
really want to know: Is it possible?)
12. What is typical for a ”Platonic solid”? (see Ex.11.22). How many different such likes are there?
13. An old problem is called the travelling salesman problem:
A travelling salesman leaves his home to visit shops/firms to sell his products. Then it
becomes important to find a sequence of visits to all the companies and then get back home
again without having to travel through places that has already been called upon earlier. I.e. find
the most efficient route. This is in graph theory called a Hamilton cycle.
Find the Hamilton cycle – if it exists – for the graphs in the figures below. If any of the graphs
do not have a Hamilton cycle, decide if it instead has a Hamilton path.
2
i) ii)
Exercise 2 Also from chapter.11
1. (Task.11.1.5 in textbook). How many paths are there in from a to h in the following graphG
(next page)?
2. Consider the graph in the previous task. How many (different) spanning subgraphs can be made
from this graph?
5. Example 11.12 (p. 531) deals with the problem of finding connections between a number of
CPUs in a computer. The ideal thing would be to have direct connection between all of the
processors, but that will give a too complicated system. Another possibility is to have all
processors connected to each other in a line (a long line), but then some will have too far
distance between them. A third option is to have a grid.
A compromise is to have a regular graph, called a hypercube.
The n-dimensional hypercube is denoted
Q n , (n is an integer) see fig. 11.35.
How many vertices (that for instance represents CPUs), are there in n ?
Q
How many direct connections – edges – are there?
What is the maximum distance between two CPUs (vertices)?
(Def. of ”distance” is given in task.11.1.6, p. 518)
6. In a network with many internal connections (a graph!), it will often be impossible to realise the
network without some edges crossing each other. We obtain a nonplanar graph. By closer
investigation, one can see that the actual problem may be re-allocated to one (or both) of two
sub-graphs that each are nonplanar. Which two graphs are these?
This is similar to the old problem of planning how to place electrical cables, water pipes and
telephone connections between three houses (from one central source) without having the
cables crossing each other. It is impossible!
7. A planar graph split the plane (”represented by the paper it is written on”) in certain regions.
We denote the number of edges |E|=e , the number of vertices |V|=v and the number of
regions r. Theorem 11.6 (p. 545, Euler theorem) then gives that v−e +r=2 .
Look at the graph in the figure on the next page and show that the formula from the theorem is
correct for this graph.
3
Exercise 3 From chapter 12 about Trees
1. Who used the concept trees first? When, and in what area?
2. Under what circumstances can we call a graph a tree? (def)
3. A graph that consists of a number of trees is called a …?
10. Make a sketch of a balanced, complete trinary tree (three branches) with height 2. Designate
letters/symbols to the vertices, so that when it is read in preorder sequence the result will be:
DETTE-GÅR-BRA (A Norwegian statement )
4
11. In example 12.8, p. 595 it is given a tree with letters on the vertices. Write down the letters in
the order obtained when you read the tree in postorder sequence.
1. In example 12.12 (p. 600) it is shown how a graph systematically may be traversed to
determine if it is connected. Human beings can see this only by looking at the figure and see if
there are any ‘loose parts’ that are not connected to the rest of the graph. But a computer
can not see things, thus it must have a method - an algorithm - to traverse the graph and
investigate this. It may of course be done in several ways. Two of these are depth first and
breadth first. We have an undirected graph G = (V, E) where the vertices are given numbers
v 1 to v 7 . Internal connections are given by the adjacency matrix A(G) as follows:
v1 v2 v3 v4 v5 v6 v7
v1 1
v2 1
v 3v 1 1 1
v4 1 1 1
v5 1
v6 1 1
v7 1 1 1
Use the technique of traversing the graph
by a breadth first search to determine if the graph is connected. Make a sketch of the tree that
is given when you use v 1 as root. Give a short explanation.
2. Make a sketch of the tree that is given when the graph in part 1. is traversed by a depth-first
search.
3. If a huge amount of data is to be sent, we must be able to separate each character. This may be
done in many ways. One method is to use what we call a prefix code.
What is typical for a prefix code? Give the name of a person that developed a technique for this.
4 (12.4.3) Construct a optimal prefix code for the symbols a,b,c,d,…,i,j that occur with
frequencies 78, 16, 30, 35, 125, 31, 20, 50, 80, 3, respectively.
1. Explain with own words (and not too detailed) what ”Dijkstra´s Shortest-Path Algorithm” do
and how it traverses through the graph. What do the numbers on the edges of the graph
represent?
5
2. As part 1. but with ”Kruskal´s Algorithm”.
3. As part 1. but with ”Prim´s Algorithm”. What is the difference between Kruskal’s and Prim’s
algorithms? Are both optimal (i.e. give the best solution)?
4. Is it possible that both Kruskal’s and Prim’s algorithms are optimal but still not necessarily
produce the same graph (tree)? (see ex.13.4 s.642).
5. We have a weighted graph G=(V , E ) where the vertices are given numbers
v 1 , v 2 , . . . .v 9 .
The matrix below shows the weight of the respective connections (edges).
v1 v2 v3 v4 v5 v6 v7 v8 v9
v1 - 13 4
v2 13 - 3 1
v3 3 - 10 12 2
v4 10 - 11 7
v5 4 - 5
v6 1 5 - 6
v7 12 6 - 8
v8 2 11 8 - 9
v9 7 9 -
b. Use Prim’s Algorithm (method) to find a minimal spanning tree. Explain shortly what you are
doing, and make a sketch of the tree with actual weights on the edges.
6. Use Dijkstra’s algorithm to find the length of a shortest path between the vertices
a and h in the following graph:
END OF SET😊