

Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
This page cannot be seen from the preview
Don't miss anything!


1
3
2
4
v 0 v
v
v
v
a) What is the set of vertices? V =
b) An edge can be represented by a tuple (from vertex, to vertex [, weight] ). What is the set of edges?
E =
c) A path is a sequence of vertices that are connected by edges. In the graph G above, list two different pathes from v 0 to v 3.
d) A cycle in a directed graph is a path that starts and ends at the same vertex. Find a cycle in the above graph.
Complete the following adjacency matrix for the above graph.
(from vertex)
(to vertex)
Lecture 26 Page 1
We can use a graph algorithm to solve this problem by constructing a graph such that a word represents a vertex an edge represents?
a word ladder transformation from one word to another represents?
foul
fool
foil
fail fall
pall
cool pool
poll
pole
pope
pale
sale
page
sage
a) List a different transformation from FOOL to SAGE
b) If we wanted to find the shortest transformation from FOOL to SAGE, what does that represent in the graph?
c) There are two general approaches for traversing a graph from some starting vertex s :
Breadth First Search (BFS) where you find all vertices a distance 1 (directly connected) from s, before finding all vertices a distance 2 from s, etc.
Depth First Search (DFS) where you explore as deeply into the graph as possible. If you reach a “dead end,” we backtrack to the deepest vertex that allows us to try a different path.
Which of these traversals would be helpful for finding the shortest solution to the word-ladder puzzle?
Lecture 26 Page 2