remove infinite loop from short path analysis