Sie sind auf Seite 1von 3

Daniel Colson

2/24/14
NETS 150 Homework 2

1. This is true. By definition, in DFS, a node can only finish if all nodes discoverable from that node
have been finished. Consider the following graph:

In order for a to finish, b, c, and d must have already finished. Lets say for example that we
begin a DFS on the above graph at node c. First c is discovered, then d is discovered; d then
finishes, and then c finishes. If we next move to node a and conduct a DFS from there, a and
then b are discovered. Following this, b and then a finish. Finally, we move to discover f and e,
and then finish e and f.
Node: A B C D E F
Discovery 5 6 1 2 10 9
Finish 8 7 4 3 11 12

This upholds the idea that if there is a path from node A to B, the start time of B must be <= the
end time of A. This is true in the above graph regardless of starting position. The only way this could be
broken is if we interpret path to include go against the direction of edges. For instance, the start time
of a could be greater than the end time of e if DFS begins at either nodes e or f, even though there is a
path between e and a (but it does go against the direction of the directed edges). If we do not
interpret path in such a way, then the conjecture indeed holds.
2. Topological Sort answer:
Using the invariant that the response should choose the earliest available alphabet letter, the ordering
is: m, n, p, o, q, s, r, u, t, y, v, w, x, z

3. The paths and their costs are shown in the following table. If multiple shortest paths are
available, then the various paths are given. Also note that the s path refers to the shortest
path to return to s. Naturally, by starting at s, the shortest path would technically be zero. As
this is a truism, I provide the shortest return path as a separate case for the sake of being
thorough.
Node Letter Cost Path 1 Path 2 Path 3
S 14 S, y, z, s S, t, x, z, s S, y, x, z, s
T 3 S, t n/a n/a
X 9 S, t, x S, y, x n/a
Y 5 S, y S, t, y n/a
z 11 S, y, z S, t, x, z S, y, x, z

4. Below is a graph for which Dijkstras method fails:

Due to the -10 value between nodes b and c, the distance value decreases each time one loops
around the b c d triad. This means that the distance, according to the given lengths of each edge,
will approach negative infinity if iterated k times as k approaches infinity. As such, no distance can
be determined.

5.

Under the Strong Triadic Closure Property (STCP), the b-c edge can be either strong or weak. The
only way the STCP can be violated is if an edge fails to exist between two nodes which both have strong
ties to the same third node. The only way this could be the case in this example is if the a-b edge or the
c-d edge were strong. If one of these were the case, then the b-c would have to be weak in order to not
violate the STCP, because otherwise either an a-c edge or a b-d edge would be required. In this case,
since a-b and c-d are both weak, b-c can be either strong or weak without violating the STCP.

Das könnte Ihnen auch gefallen