Question: 1 . ( 1 5 points. ) Suppose that ( G ) is a directed graph. It has an adjacency structure G .

1.(15 points.) Suppose that \( G \) is a directed graph. It has an adjacency structure G.Adj, a set of edges \( G . E \), and a set of vertexes \( G . V \). Each vertex \( v \in G . V \) has an attribute \( v . m a r k \in\{\) TRUE, FALSE \}. It has no other attributes! In particular, it has no color, \( d, f \), or \(\pi \) attributes like Cormen's vertexes do.
A vertex \( v \in G . V \) is an origin vertex in \( G \) if there is exactly one path from \( v \) to every other vertex in G.V. The word origin is meant to suggest that every vertex in \( G \) is reachable starting from \( v \). Don't bother looking for origin vertex online: the only hits you will get are irrelevant to this question: they deal with parabolas from high-school algebra.
Write a procedure IS-ORIGIN \((G, u)\) that returns TRUE if the vertex \( u \) is an origin in the graph \( G \), and returns FALSE otherwise. Your procedure must always terminate, even if \( G \) has cycles or self edges. You will lose many points if it uses vertex attributes other than mark.
1 . ( 1 5 points. ) Suppose that \ ( G \ ) is a

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!