###### Abstract
A method based on the average daily activity time variability is defined to enrich the inferred activity patterns with time-related information. For the selection process of the parent chromosomes, we have used a tournament-based strategy, and the population evolution is ensured by applying crossover and mutation operators. To avoid premature convergence a roulette wheel selection strategy is used for the dynamic selection of the operators to be used in generating the next generation of offspring. The genetic heuristic has good results for constraint-based optimization problems that can be translated into digging for the best solutions in the search space, as in the case of the routine detection problem. The length of the daily activities has a certain degree of flexibility and is bounded by upper and lower values, while the transition among activities can happen with different probabilities. Moreover, this type of constraint is rather personalized as they depend on the wishes and needs of each person. Consequently, the space and datasets for searching the routine are large and hard to explore. The genetic heuristic is more suitable compared to the deterministic algorithms as it uses the history encoded in the chromosomes of the previous population to guide the search. Therefore, our genetic-based solution can identify more than one routine for a person, while most state-of-the-art deterministic approaches [16; 17; 18] can identify only one rigid routine. This solution is more realistic since a person can have several variations of recurrent daily activity patterns that differ slightly depending on contextual factors. For the duration of activities, we use an interval determined by the dispersion of the duration values of that activity around the average value, which is a more flexible approach than deterministic ones [16], which use only one value namely the average time. Finally, the tournament-based strategy combined with roulette wheel selection for generating new populations of chromosomes guides the search process with a good balance between exploitation and exploration of the search space for routine detection. As reported in other literature works [19], the balance is important to identify regions in the areas that are closer to daily routines with good quality and to dismiss the parts already explored or with poor quality solutions. The novel contributions of this paper are the following:  
* A heuristic approach based on a genetic algorithm for identifying the recurrent activity patterns of a person and constructing the daily routine. The chromosomes are encoded using the person's ADL and a probability-based fitness function is used to evaluate the quality of the population. Thus, it allows the extraction of several patterns of activities that differ slightly from each other capturing the day-to-day contextual variations that occur in a person's daily routine. * A tournament-based strategy for dynamic selection of operators applied for generating the offspring, while the time variability of activities of daily living is addressed using the dispersion of the duration values of that activity around the average value. * Study the impact of the population size and number of generations on the fitness function evolution and convergence by using multiple linear regression analysis. The paper is structured as follows: Section 2 reviews the state of the art and presents the progress beyond, Section 3 presents the genetic solution for detecting recurrent activity patterns forming the person's daily routine using genetic algorithms, Section 4 presents the experimental results, Section 5 discusses the impact of the adjustable parameters on the performance of the genetic algorithm, and Section 6 presents conclusions and possible further developments.