Topological Sort Using Decrease Image Dimensions