A self-adaptive key flow routing adjustment algorithm