Cycles in Graphs

CYCLICITY

Given: A directed graph G=(V,E)
Return: YES if G is cyclic, NO otherwise


Lemma: Let G be a directed graph. If G has no cycles, then there is some vertex with zero in-degree.

Proof: Let there be a vertex v0, this must have a vertex pointing to it since it has a non-zero in-degree. $$v_j \rightarrow \ldots v_i \rightarrow \ldots \rightarrow v_0$$ since the graph is finite at some point, vj=vi thus creating a cycle .