This algorithm is correct because it based from an algorithm that enumerates every single possible ordering of the tasks and compares them all. I know that that algorithm enumerates all orderings because the tree it creates and traverse is a complete tree, that is that length of the path from the root to all the leaves is the same. The backtracking algorithm is correct from this because is will compare every possible ordering if necessary, and will only skip groups of schedules that are known from unfinished schedulings to be more costly than those already found.