Initial implementation for topological sort to solve the dictionary order sorting problem.