def evaluate_population(population, toolbox):
    """
    Evaluate the individuals with an invalid fitness
    """
    invalid_ind = [ind for ind in population if not ind.fitness.valid]
    fitnesses = toolbox.map(toolbox.evaluate, invalid_ind)
    evaluations = 0
    for ind, fit in zip(invalid_ind, fitnesses):
        ind.fitness.values = fit
        evaluations += 1
    return evaluations