Faster calculation of visit order and reformulated contract, faster calculation of build schedule using tarjan