This algorithm is correct because it enumerates all orderings of n tasks and compares them all. I know it enumerates all orderings because the recursion of the algorithm traces out a complete tree. Also the solutions it gives agree with the project description.