Clone priority_queue instead of calculate it each time.