Topological Sort with Java FX