In some cases the vertex visit queue would exceed its max length, visiting the same vertex multiple times.