Pre-lab

advertisement
SGD 125-60, F12
Pathfinding
Prelab Exercises
This file must be submitted online before the beginning of class in order to
receive credit.
1. Given the graph G, consisting of nodes (or vertices V ) and links (or edges E):
3
1
b
1
d
3
a
9
c
e
1
2
4
g
2
f
where the numbers on each link indicate the cost or distance to traverse that node,
determine the following:
(a) Starting at node a, what is the shortest distance to node e and how do you get
there?
(b) Starting at node a, what is the shortest distance to node e when path costs are
uniform (e.g., assume that every link has a cost of 1)? How do you get there?
(c) Starting at node a, what is the shortest distance to node c, and how do you get
there?
(d) Starting at node a, what is the shortest distance to node c if you assume that all
path costs are uniform, and how do you get there?
2. Submit your answers in a plain text file called lastname.txt and submit the file on
Moodle.
v1.0
Download