Connectivity in Graphs

st-CON

Given: A directed graph G=(V,E) and vertices s,tV
Return: YES if t is reachable from s in G, NO otherwise

STRONG CONNECTIVITY

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

Depth First Search on Graphs

(this algorithm assumes the graph is represented as out lists)

begin DFS(G, v)
	mark v
	for each w in G.edges(v) do
		if w unmarked
			DFS(G, w)