Material:
Textbook (Goodrich/Tamassia), Chapters 6 and 7.
HOMEWORK 3 PROBLEMS
In all problems, whenever you are asked to design or describe an algorithm,
show a pseudo-code and illustrate it with a simple example.
Chapter 6 Exercises.
V={1,2,3,4}, E={(4,1); (4,3); (3,2); (2,3); (2,4)}
Notation: (a,b) means a directed edge from node a to node b.
Show each step of your procedure.
Chapter 7 Exercises.
Note that Mk is a binary matrix, so you must follow the rules
of Boolean algebra in constructing the matrix.
Apply Floyd-Warshall algorithm to compute transitive closure for the following
directed graph G(V,E):
For parts (a) and (b), compute transitive closure for the following graph using
adjacency matrix approach.
Adjacency matrix M for the directed graph is defined as follows:
M(i,i) = 0, and
M(i,j) = 1, iff there is a directed edge (i,j) in G,
and i /= j.
Write a Floyd-Warshall algorithm to compute matrices Mk
and illustrate it on the following directed graph G(V,E),
for k=1, ..., n:
V={1,2,3,4}, E={(4,1); (4,3); (3,2); (2,3); (2,4)}
How many steps do you need to compute transitive closure of G for this graph?
Any comments about direted cyclic vs. directed acyclic graph (DAG)?