bfs: Added shortcut to frequency map to handle graceful descendingvalues iteration.