Tutorial 3

advertisement
SUBJECT: DISCRETE STRUCTURE & APPLICATIONS
CODE: BCT2083
FACULTY OF INDUSTRIAL
SCIENCES & TECHNOLOGY
TOPIC: Chapter 3 Graphs
TUTORIAL 3
DURATION: 3 weeks (week 9-11)
Week 9
1.
Draw graphs models, stating the type of graph used, to represent airline routes where every day
there are four flights from Boston to Newark, two flights from Newark to Boston, three flights
from Newark to Miami, two flights from Miami to Newark, one flight from Newark to Detroit,
two flights from Detroit to Newark, three flights from Newark to Washington, two flight from
Washington to Newark and one flight from Washington to Miami, with
(a) an edge between vertices representing cities that have a flight between them (in either
direction)
(b) an edge between vertices representing cities for each flight that operates between them (in
either direction)
(c) an edge between vertices representing cities for each flight that operates between them (in
either direction), plus a loop for a special sightseeing trip that takes off and lands in Miami.
(d) an edge from a vertex representing a city where a flight starts to the vertex representing the
city where it ends.
(e) an edge for each flight from a vertex representing a city where the flight begins to the vertex
representing the city where the flight ends.
2.
Determine whether the graph shown has directed or undirected edges, whether it has multiple
edges, and whether it has one or more loops. Use your answers to determine the type of the graph
a
b
(a)
(b)
c
(c)
a
a
b
c
d
d
e
(d)
d
a
f
c
e
b
c
b
d
BCT2083
Tutorial 3
3.
For each in question 2 that is not simple, find a set of edges to remove to make it simple.
4.
Find the number of vertices, the number of edges and the degree of each vertex in the given
undirected graph. Identify all the pendant and isolated vertices.
a
b
c
e
d
(a)
f
a
(b)
e
b
c
d
(c)
i
5.
a
b
c
h
g
f
d
e
Find the in-degree and out-degree of each vertex for the given directed graph.
a
b
(a)
d
c
(b)
a
d
b
c
2
BCT2083
6.
Tutorial 3
Determine whether the graph is bipartite.
a
b
(a)
e
d
c
(b)
b
c
a
d
e
f
b
(c)
a
c
f
d
e
7.
8.
Suppose that there are five young women and six young men on an island. Each woman is
willing to marry some of the men on the island and each man is willing to marry any woman who
is willing to marry him. Suppose that Ana is willing to marry Jason, Larry, and Matt; Barbara is
willing to marry Kevin and Larry; Carol is willing to marry Jason, Nick and Oscar; Diane is
willing to marry Jason, Larry , Nick and Oscar; and Elizabeth is willing to marry Jason and Matt.
(a)
Graph the possible marriages on the island using a bipartite graph.
(b)
Find a matching of the young women and the young men on the island such that each
young woman is matched with a young man whom she is willing to marry
Find the union of the given pair of simple graphs. (Assume edges with the same endpoints are the
same).
(a)
a
a
f
b
b
e
e
d
c
d
g
c
3
BCT2083
(c)
9.
a
b
a
b
c
d
c
d
Tutorial 3
Use an adjacency list to represent he given graph.
(a)
b
a
c
d
e
(b)
a
b
f
c
e
(c)
d
a
b
d
c
10. Represent the graph in question (9) with an adjacency matrix.
11. Draw a graph represented by the given adjacency matrix
1 3 2 


(a) 3 0 4


 2 4 0 
(b)
1 2 1 
2 0 0


0 2 2 
4
BCT2083



(c) 



0
1
3
0
4
1
2
1
3
0
3
1
1
0
1
4
0 
1

2
3 
0
a3
0
0
2
0
1

2

1
(d)
Tutorial 3
2 3 0
2 2 1 
1 1 0

0 0 2
12. Represent graphs below by using incidence matrix
e1
a
(a)
b
e8
e2
e4
e7
a
e1
e13
(c)
a
e1
e6
e8
e7
d
b
e5
e6
e3
c
e9
e
e
e5
e10
e12
e2
e11
e12
b
e3
e11
f
e10
f
e2
e4
e9
e6
g
e13
h
(b)
d
c
e5
e3
e4
c
e7
e8
d
e
Week 10
13. Determine whether the given pair of graphs is isomorphic.
u1
(a)
u2
u3
u4
u5
v1
v2
v3
v4
v5
5
BCT2083
u1
(b)
v1
u2
u5
(c)
u1
v2
v5
u4
u3
u2
v4
u5
u3
Tutorial 3
u6
u4
v3
u7
v2
v1
u8
v4
v5
v3
v6
v7
v8
14. Does each of these lists of vertices form a path in the following graph? Which paths are simple?
Which are circuits? What are the lengths of those that are paths?
a
b
c
(a)
a
d
a, e, b, c, b
a, e, a, d, b, c, a
e, b, a, d, b, e
c, b, d, a, e, c
(i)
(ii)
(iii)
(iv)
a, b, e, c, b
a, d, a, d, a
a, d, b, e, a
a, b, e, c, b, d, a
e
d
(b)
(i)
(ii)
(iii)
(iv)
b
c
e
15. Determine whether each of these graphs is strongly connected and if not, whether it is weakly
connected.
a
b
b
(a)
(b)
a
c
g
d
c
e
d
f
e
6
BCT2083
b
(b)
Tutorial 3
b
a
(d)
c
c
a
d
g
d
f
e
f
e
16. Find the strongly components of each of these graphs
a
(a)
i
(b)
b
c
d
h
g
f
a
c
b
f
d
e
a
e
b
c
g
f
d
(c)
h
(d)
a
b
i
h
e
c
d
g
f
e
17. Find the number of paths of length n between two different vertices in K4 if n is
(a) 2
(b)
3
(c)
4
(d)
5
7
BCT2083
Tutorial 3
18. Determine if the following graph are isomorphic.
u1
(a)
u2
v2
v1
u8
u3
v8
v3
u7
u4 u3
v7
v4
u6
u1
(b)
v6
u5
u2
v5
v2
v1
u8
u3
v8
v3
u7
u4
v7
v4
u6
v6
u5
v5
19. Find all the cut vertices of the given graph
a
e
d
a
(a)
b
f
(b)
e
c
b
c
g
f
d
i
h
20. Find all the cut edges from the graphs in question (19)
21. Determine whether the given graph has an Euler circuit. Construct such a circuit when one exists.
If no Euler circuit exists, determine whether the graph has an Euler path and construct such path
if one exists.
a
(a)
b
e
d
g
a
c
(b)
h
b
f
f
d
i
e
a
c
b
d
c
e
(c)
g
f
k
l
i
h
m
n
j
o
8
BCT2083
a
(d)
Tutorial 3
b
d
c
a
b
c
(e)
e
d
22. Determine whether the given graph has a Hamilton circuit. Construct such a circuit when one
exists. If no Hamilton circuit exists, determine whether the graph has an Hamilton path and
construct such path if one exists.
(a)
a
e
d
c
b
f
a
(b)
b
c
e
(c)
d
a
b
j
i
d
o
p
n
e
c
k
h
q
m
f
l
g
9
BCT2083
Tutorial 3
Week 11
23. By using Djikstra’s algorithm, find a route with the least total airfare that visits each of the cities
in this graph, where the weight on an edge is the least price (RM) available for a flight between
the two cities.
(a)
from San Francisco to New York
Detroit
329
22
9
349
189
San Francisco
35
9
179
69
New York
27
9
379
209
Denver
Los Angeles
(b) from Seattle to New York
Seattle
109
409
Boston
389
239
429
379
119
New
York
319
229
Phoenix
309
New Orleans
24. Determine whether the given graph is planar. If so, draw it so that no edges cross.
a
(a)
a
b
c
(b)
b
e
e
d
d
c
10
BCT2083
(b)
a
b
(d)
c
a
b
c
h
d
g
e
f
d
Tutorial 3
e
f
25. Use Kuratowski’s Theorem to determine whether the given graph is planar.
(a)
a
b
b
c
d
(b)
g
a
h
g
c
d
e
f
f
e
26. Find the number of colours needed to colour the map so that no two adjacent regions have the
same colour.
(a)
B
A
D
C
E
(b)
E
A
F
B
D
C
a
(c)
b
d
c
11
BCT2083
Tutorial 3
ANSWERS CHAPTER 3: Graph
1.
2.
3.
4.
5.
6.
7.
13.
14.
15.
16.
17.
18.
19.
20.
21.
22.
24.
25
26.
Answer not unique
a) simple graph
b) pseudograph
c&d) directed multigraph
b) ({a}, {b}, {d}, {a,b}, {c,d})
c) ({a,b}, {b,c}, {c,d}, {c,d}, {a}, {e}, {a,e})
d) ({a,b}, {b,c}, {e,d}, {f})
pendant: a) c
b) 0
c) 0
isolated: a) d b) 0
c) d, i
a) in-degree: 2,1,2,1 out-degree: 0,2,1,3
b) in-degree: 2,3,2,1
out-degree: 2,4,1,1
a) yes
b) no c) yes
b) Ana&Matt, Barbara&Larry, Carol&Oscar, Dianne&Nick, Elizabeth&Jason
a) yes
b) no c) no
a) (i) path, not simple, not circuit, 4
(ii) not path
(iii) not path
(iv) path, simple circuit, 5
b) (i) path, simple, not circuit, 4
(ii) path ,not simple, circuit, 4
(iii) not path
(iv) not path
a) weakly
b) neither
c) weakly
d) neither
a) {a,b,h,i}, {c,d,f,g}, {e}
b) {a,b,f}, {c,d,e}
c) {a,b,c,d,e,h}, {f}, {g}
d) {a,b,d,f,g,h,i}, {c}, {e}
a) 2
b) 7
c) 20 d) 61
a) yes
b) not
a) c
b) b,c,e,i
a) none b) {a,b},{b,c}, {c,d}, {c,e}, {e,i}, {i,h}
a) euler circuit b) euler path c) euler circuit d) euler path e) euler circuit
a) Hamilton path
b) Hamilton circuit
c) neither
a) yes
b) no c) yes d) no
a) yes
b) no
a) 4
b) 4
c) 3
12
Download