Topological Sort Using Decrease Size Of Image Without Changing