The solution given by ShuggyCoUk is incomplete because it might not check all nodes.
def isDAG(nodes V):
while there is an unvisited node v in V:
bool cycleFound = dfs(v)
if cyclefound:
return false
return true
This has timecomplexity O(n+m) or O(n^2)