14 Apr
2007
14 Apr
'07
10:42 a.m.
Hi! As I see, the algorithm is correct (but slow) anyway, and (n-1) steps are enough. I won't go into details, but one can think to this algorithm as if we ensure the order of foo[i] and its dependencies in the ith step, where foo[i] is the ith in the topological sorted list. So the graph contains a circle <=> n-1 steps are not enough. As a hotfix, plz change sqrt(n) to n-1 (or n) and remove libm; and you can replace "possible dependency cycle detected" to "dependency cycle detected". Bye, ngaba PS.: This function is not so important, because depcheck is done before this (I think we should merge the 2 functions to efficiency).