private State DeleteEdges(State state, int row, int col) { state.GetCityTo()[row] = col; state.GetCityFrom()[col] = row; state.SetCitiesInSolution(state.GetCitiesInSolution() + 1); if (state.GetCitiesInSolution() < _cities.Length - 1) { int start = row; int end = col; while (state.GetCityFrom()[start] != -1) { start = state.GetCityFrom()[start]; } while (state.GetCityTo()[end] != -1) { end = state.GetCityTo()[end]; } while (start != col) { state.Matrix.GetMatrix()[end, start] = double.PositiveInfinity; state.Matrix.GetMatrix()[col, start] = double.PositiveInfinity; start = state.GetCityTo()[start]; } } return(state); }