Project
1
1.[40 points] Given the following directed weighted
graph, make a python list for it. Make matrices for vertices V and edges E.
Your code must implement the following
functions:
Test:
Input: input a node (say C)
Output:
(1) nodes connecting to this node
(2) related edges (eg. Node C to
F, and E to C, etc)
(3) the weight and direction for
each edge.
2. Find
the shortest and longest edge in your matrix. Analysis the running time (big O)
for each case.
Sun | Mon | Tue | Wed | Thu | Fri | Sat |
---|---|---|---|---|---|---|
27 | 28 | 29 | 30 | 1 | 2 | 3 |
4 | 5 | 6 | 7 | 8 | 9 | 10 |
11 | 12 | 13 | 14 | 15 | 16 | 17 |
18 | 19 | 20 | 21 | 22 | 23 | 24 |
25 | 26 | 27 | 28 | 29 | 30 | 31 |