Heuristic time-dependent personal scheduling problem with electric vehicles

In this paper, a heuristic method which contributes to the solution of the Daily Activity Chains Optimization problem with the use of Electric Vehicles (DACO-EV) is presented. The DACO-EV is a time-dependent activity-scheduling problem of individual travelers in urban environments. The heuristic method is comprised of a genetic algorithm that considers as its parameters a set of preferences of the travelers regarding their initial activity chains as well as parameters concerning the transportation network and the urban environment. The objective of the algorithm is to calculate the traveler’s optimized activity chains within a single day as they emerge from the improved combinations of the available options for each individual traveler based on their flexibility preferences. Special emphasis is laid on the underlying speed-up techniques of the GA and the mechanisms that account for specific characteristics of EVs, such as consumption according to the EV model and international standards, charging station locations, and the types of charging plugs. From the results of this study, it is proven that the method is suitable for efficiently aiding travelers in the meaningful planning of their daily activity schedules and that the algorithm can serve as a tool for the analysis and derivation of the insights into the transportation network itself.


Introduction
While traditional transportation demand models are often built on a trip-based approach, in the last few decades, transportation demand has been connected to and analyzed based on the need of individuals to participate in some activities by using the transportation network. Under the terms of activity-based modeling, an innovative scientific framework is utilized for the analysis of transportation problems, such as activity scheduling problems (Esztergár-Kiss et al. 2018;Liao et al. 2010), the analysis of travel behavior (Bhat and Koppelman 2006;Sierpiński et al. 2016) and travel demand forecasting (Bowman and Ben-Akiva 2001;Cantelmo et al. 2017).
In the case of the current research and the Daily Activity Chains Optimization problem with the use of Electric Vehicles (DACO-EV), activity-based analysis of transportation is utilized for the solution of an optimization problem that can provide guidance to travelers within metropolitan areas, considering the multiple aspects of their potential trips. Travelers are usually not aware of the wide variety of available choices that they have concerning their activity chains (i.e., programs, schedules, solutions) that they need to conduct on a daily basis. A single activity in the chain can take place at several locations (spatial aspect) and at different time windows (temporal aspect) within a single day, which are the two main reasons that enable a wide variety of alternative candidate chains (i.e., solutions) and create a corresponding solution space. This solution space can be searched to find the optimal solution for the users according to different criteria and optimization approaches. Optimization algorithms that can be used are divided into two major categories. The first group includes the exact algorithms (Saharidis et al. 2014;Xu et al. 2021) which search the solution space exhaustively and guarantee that the final solution is a globally optimal one. The other category consists of heuristic algorithms, which employ rules to speed up the search for optimized solutions. In the latter case, the solution is not guaranteed to be globally optimal but can be proven to be acceptable and suitable for real-world applications (Delling et al. 2013).
For the optimization of daily activity chains, the Genetic Algorithm (GA) framework, which belongs to the category of heuristic approaches, has been demonstrated to be especially efficient (Esztergár-Kiss et al. 2018) by presenting total travel time reductions of up to 15%. A GA is inspired by biological operators and mechanisms based on Darwin´s theory of evolution. In essence, it emulates those biological mechanisms and the evolutionary process, as they were described by Darwin, in an attempt to produce efficient solutions to computational problems across multiple scientific fields. Especially in the case of transportation-related problems, the GA framework is successfully applied to a series of important problems such as activity scheduling problems (Charypar and Nagel 2005), the Traveling Salesman Problem (TSP) (Freisleben and Merz 1996), the Traveling Salesman Problem with Time-Windows (TSP-TW) (Nygard and Yang 1992), and the Vehicle Routing Problem (VRP) (Hwang 2002). The family of TSP-related problems is classified as NP-hard problems (Archetti et al. 2011), where solving the problems is getting more challenging as the size of the network grows. By utilizing the GA framework in the context of transportation problems, heuristic solutions can be calculated in a reasonable amount of time.
As a predecessor problem to the DACO-EV, the Daily Activity Chains Optimization (DACO) problem is one of the fundamental optimization problems whose solutions can address activity-scheduling challenges in the daily life of individuals residing in vast metropolitan environments. Given a set of activities that the traveler needs to conduct at several locations, the priorities of the traveler, the timeframe of conducting the activities, and the opening hours of the activity locations are considered. The objective of the method for the solution of the DACO problem is to calculate a proper sequence of visits for the activities and the shortest path between them. An additional aspect of activity chains in DACO is the mode of transport used. In earlier definitions of the DACO problem (Esztergár-Kiss et al. 2018), multiple modes of transport are utilized in order to synthesize optimized activity chains. In the context of the current work, the DACO-EV is introduced as a new problem, including Electric Vehicles (EVs), which, as an emerging mode of transport, pose several challenges that render the calculation of real-world solutions to the activity chain optimization problem more demanding, as compared to the DACO problem. DACO-EV requires additional modeling constraints that regard specific characteristics of EVs, mainly their limited driving range and their refueling (based on regenerative braking and the connection to a Charging Stations (CS) network).
The DACO-EV problem is of great importance since electric mobility is an emerging market that contributes to sustainable transportation. A market boost is foreseen in urban environments, where the current EV technologies offer a real alternative for travelers (Meszaros et al. 2021). Additionally, problems like the DACO-EV, when efficiently solved and provided as planning tools to EV users, can help to deal with the psychological concerns of EV drivers regarding the range of their vehicles and their ability to cover their daily transport needs. As discussed in the literature, range anxiety is one of the most significant concerns of EV users and probably one of the most critical obstacles towards the universal adoption of EVs (Statharas et al. 2019). In that context, the need for advanced urban solutions and EV navigation systems has been previously highlighted in the literature (Cuchý et al. 2018b). Other factors can also affect EV adoption, such as the technical specifications of the EV, individuals' characteristics and opinions (Konstantinou et al. 2021), or even network and peer influence (Rasouli and Timmermans 2016). In Table 1, a list of abbreviations is provided.
The main goal of this research is to present the method and the underlying mechanisms that enable the realistic solution (i.e., practically usable activity chains in real-world settings by everyday travelers) to the DACO-EV problem by exploiting activity-based modeling and the GA framework. In Sect. 2 of this paper, a literature review is provided on the related topics. Section 3 presents a definition and a graph-based formulation of the DACO-EV and its basic instance, the DACO problem. Section 4 provides a detailed description of the solution method derived for the DACO-EV. Section 5 discusses the implementation of the method and several mechanisms that contribute towards realistic solutions in real-world transportation networks. Section 6 presents the optimization results in several instances of the problem. Finally, Sect. 7 summarizes the final remarks and the possibilities for future work.

Literature review
In our effort to solve the DACO-EV problem, insights and research directions can be extracted from the literature on activity-based modeling of travel demand, its forecasting, the analysis of activity-travel behavior, and works on activity-travel scheduling, which are all interrelated topics that are studied in the context of transportation science.
As an attempt to provide more behavioral realism in transport modeling, as compared to traditional trip-based approaches, the activity-based analysis approach to travel demand has been proposed since the 1990s (Axhausen and Gärling 1992). In the fundamental articles by Timmermans et al. (2002Timmermans et al. ( , 2003, the authors study activity and travel diary data and prove that travel behavior is not directly linked to spatial context except for the case where hard constraints exist in the transportation systems. The analysis (Timmermans et al. 2003) includes data from several parts of the world, such as the United States of America (USA), Canada, Japan, the United Kingdom (UK), and the Netherlands. In more recent years, other interesting studies have been enabled by modern technology, which allows the massive collection of data that, in turn, allows the further study of activity-travel phenomena (Ortega et al. 2020). Such a work is the article published by Phithakkitnukoon et al. (2010), which tries to characterize mobility and activity patterns by using mobile phone data. The scholars introduce an activity-aware map, and their conclusion is that the travel patterns of people who share a common type of work area are correlated and similar. However, this similarity decreases as the distance from the center of the area under study (i.e., spatial window) increases. In addition, recent articles have demonstrated the use of activitybased modeling in the study of electromobility. One such work is realized by Kontou et al. (2017), where two schemes for centralized charging management of EVs are evaluated based on National Household Travel Survey data. The study showcases the differing nature of interests regarding the two schemes that are assessed, with the first scheme regarding the preferences of individuals and the second regarding the government's perspective on charging. In agreement with other studies (Neubauer and Wood 2014), the work by Kontou et al. (2017) also presents that the availability of charging stations at the workplace can greatly affect the charging profiles of EV travelers. An activity-based method is also used by Dong et al. (2014), who, in an attempt to promote EV usage, they evaluate charging infrastructure deployments according to travel patterns and the impact of charging infrastructure on miles traveled.
Optimization of locations of electric vehicle stations is another problem in transportation science that is connected to the DACO-EV and aims to calculate optimized distributions of charging stations within an area. Although the CS locations optimization problem does not concern the guidance of travelers within the transport system but rather the setup of the transport system itself, several attributes of electromobility connect two types of problems. Insights can be derived from articles, such as the one by Zhou et al. (2022), who provide a genetic algorithm that solves the problem based on economic and environmental criteria. Another approach to the problem is the one by Kim et al. (2022), who propose a framework for the CS location problem which includes an out-of-home charging demand forecasting component (in conjunction with Albatross) and a second two-stage stochastic mixed-integer programming model to solve the CS location-allocation problem, where the number of charging slots and locations of charging stations are determined. In a previous article by Kim et al. (2017), the authors have analyzed a four-year dataset of charging transactions data in order to extract insights about EV drivers' behavior. In the study it is shown that 90% of the drivers charge their car randomly at public charging stations, while it has been estimated that the weather conditions have a direct impact on the charging decisions.
Other important works exist in the field of simulation frameworks that utilize activitybased modeling. To begin with, the ALBATROSS framework (Arentze and Timmermans 2004), which belongs to the group of rule-based approaches (Bellemans et al. 2010;E. Miller and Roorda 2003). ALBATROSS utilizes machine learning, including a series of decision trees, to represent the choice heuristics of travelers and then calculate these heuristics from activity-travel data. Activity-based models have been developed and utilized in combination with one of the leading micro-simulation tools, MATSim (Axhausen 2016), in order to study transportation demand. MATSim is an open-source transport simulation tool that can serve as a link between large-scale agent-based network simulations and activitybased models. MATSim can be used to generate activity schedules that can then be provided to the dynamic traffic assignment functionality of MATSim. An illustrative example of the efficient use of MATSim in combination with activity-based modeling is the work by Ziemke et al. (2015), who utilize the Comprehensive Econometric Microsimulator for Daily Activity-Travel Pattern (CEMDAP) to generate a set of daily activity patterns for agents that are then fed to MATSim in order to simulate a representative travel demand for the Berlin area. Other notable works (Drchal et al. 2019;Hörl and Balac 2021) have been presented in the last few years that can derive synthetic populations that can serve as great input for agent-based simulation frameworks.
Connecting discrete choice models and agent-based microsimulation in MATSim has been discussed by Hörl et al. (2018), where an explicit choice model is utilized in order to improve the convergence speed of the simulation tool. Another important study is the one by Ziemke et al. (2019), who showcase that the modeling of real-world traffic in large metropolitan areas is possible based on openly available data and that travel diary data surveys are not required as input. By combining several sources of data and by utilizing the CEM-DAP model to create initial daily activity-travel patterns, the authors are able to generate a simulation scenario for the Berlin area through MATSim that produces sufficient quality results as compared to survey data. In the article by Ziemke et al. (2021), another approach is presented for the creation of simulation scenarios in MATSim, where Origin-Destination (O-D) matrices for a population are calculated through cell-phone-based data. Another direction of research in the last few years is based on MATSim's demand-responsive transport module, which has been used (Bischoff et al. 2019;Viergutz and Schmidt 2019) in order to compare the several facets of the operation of conventional public transport as compared to more innovative public transport systems, with on-demand availability and autonomous vehicles.
Furthermore, we proceed to present a series of articles that combine activity-based modeling and optimization methods and are connected to the current research. In the case of the Household Activities Scheduling Problem (HASP) and the Household Activity Pattern Problem (HAPP), travelers are to be navigated through the transportation system as a group of people who possibly share the same accommodation (i.e., household) (Hilgert et al. 2018). The connection between HASP and HAPP is that HAPP can be considered as an interpretation of HASP based on an extension of the pickup and delivery problem with time windows (Recker 1995). As an extension of HAPP, in an 1 3 article by Kang and Recker (Kang and Recker 2013), the authors deal with the Location Selection Problem (LSP), where they try to calculate the best location for the activities according to various criteria. However, in their study, the scholars ignore the socioeconomic influences, personal preferences, and habitual behaviors. In another study by Kang and Recker (2015), further improvements are introduced to activity-based analyses, with the authors presenting a hydrogen refueling station siting model that employs a tour-based approach and household travel activity data. The same authors in another article (2014) assess the inconvenience of operating alternative fuel vehicles (including EVs) based on the California Statewide Household Travel Survey. The researchers simulate the additional constraint of refueling needs based on usage patterns. It is analyzed how travel patterns change if range and fuel limitations apply, and as a result, the monetary cost of the inconvenience of operating alternative fuel vehicles is quantified.
Recent developments in HAPP concern the inclusion of EVs and AVs into the modeling of the problem. In work by Khayati et al. (2020), who extend HAPP to the Household Activity Pattern Problem with Electric Vehicle (HAPPEV) model, which aims to test the different levels of scheduling flexibility and travel behavior based on several important parameters of electromobility such as electricity price, EV range and charging location availability. Important contributions as described in the article are also the new heuristic method to solve the HAPPEV, the quantification of the monetary cost of the replacement of internal combustion engine vehicles with EVs in households. In addition, Khayati et al. (2021a, b), further introduce the Household Activity Pattern Problem with Autonomous Vehicles (HAPPAV) as another extension to HAPP, where the focus is to assess the impact of using Avs instead of regular internal combustion cars. Several conclusions are reached in the study after the new model is solved with a decomposition method, where it is estimated that 60% of households as included in the California Statewide Travel Survey can perform their daily activities with only one AV. However, the study finds that travel time and distance are increased as compared to the household's travel patterns with regular vehicles. Finally, another recent extension to HAPP is the one by Khayati et al. (2021a), who introduced another extension, the Household Activity Pattern Problem with Autonomous Vehicles and Ride Sourcing (HAPPAV-RS), where the households can own AVs or can rent shared AVs in order to perform their daily activity schedules.
In a direct connection to the DACO problem, the basic version of the DACO-EV problem, Chow (2014) analyzes activity-based travel scenarios by applying the HAPP with reoptimization. This method uses another optimal solution for a similar problem to reduce computation time. Additionally, a destination and schedule choice are presented. The solution is provided with a GA and applied to synthetic households. It is shown that the reoptimization techniques are effective and provide faster computational time. Chow and Nurumbetova (2015) extend the activity routing problems over multiple days. The scholars consider household activities, destination choice, departure time, and the scheduling of activities. Activities over five days are analyzed, and it is found that more evenly distributed outputs can be achieved, and more activities can be conducted on average, but TT is higher on specific days. Chow et al. (2012) are able to calibrate the HAPP with a parameter estimation method. Inverse optimization is applied to a Household Travel Survey sample from the USA. The results indicate a good match of the scheduling of activities related to the observed pattern. Another work (Chow and Djavadian 2015) focuses on the market equilibrium model, which considers both activity schedules and network constraints. In this case, multi-modal choices and capacity constraints are taken into account with Lagrangian relaxation. Charypar and Nagel (2005) deal with a similar problem to DACO and introduce an approach that shares common characteristics with the one presented in this article. However, the authors consider several simplifications as the computation of distances according to the geometric distance, and not based on the real transportation network. Another similar work is conducted by Abbaspour and Samadzadegan (2011), where the researchers tackle the problem with a specific focus on the touristic aspect of the optimization of activity chains. Based on their approach, the GA maximizes the overall utility of the tour by including activities with high priority values and by leaving out the optimized activity chain activities with low priority. Although such an approach is very similar to the DACO problem, the touristic version incorporates different parameters to comply with the needs of tourists (e.g., only six activity types are considered). In addition, Abbaspour and Samadzadegan do not include the desired time windows of the attendance of the travelers to each of the locations in their approach.
A modern approach in the activity scheduling topic is introduced by Liao et al. (2013), who model the problem as a graph super-network based on the space-time prism concept. The researchers include space-time constraints to allow a valid selection of locations for activities in time. The scholars offer multi-modal transport options and model parking choices. While their activity-travel scheduling algorithm computes the final solutions to the problem in minimal time, in the modeling, the priorities and the flexibility of the activities are not included, as in DACO (possibility for four combinations of spatial and temporal flexibility). Based on the multi-state super-network representation, in another article by the same authors (Liao et al. 2014), they further extend the representation to model activity-travel time uncertainty and utilize an α-shortest path algorithm in order to calculate the most reliable travel pattern with an a confidence level. Another more recent extension by Liao (2019), a goal-directed search method, is introduced as a systematic approach that enables the construction of efficient super-networks for multiple activities (three outof-house activities). Another interesting extension on the topic is conducted by (Fu et al. 2020), who attempt to maximize space-time accessibility in a multi-modal transit network by utilizing a bi-level mathematical programming model and by extending activity-based accessibility measures.
Finally, there is a series of articles that are directly connected to our work since they address the problem of optimization of activity chains that include an EV as a mode of transport. As it is explained, considerable differences exist between problem definitions and solutions approaches, as presented in each of these articles and the current work. Liao et al. (2016) work on a similar problem and corresponding approach, but they do not solve the DACO-EV problem, as presented in this article. The authors provide a solution to the EV shortest TT path and the fixed tour EV problem. In their study, the flexibility of locations is not implemented, and the tests are run on a theoretical network. Cuchý et al. (2018aCuchý et al. ( , 2019 share many common attributes with the approach of current research. The definition of the problem is similar to the DACO-EV, but the scholars include fewer parameters than in the problem definition of the current paper. This might lead to very different solution spaces and computational results; thus, the two problems and methods cannot be directly compared.
The main contribution of the current article is the elaboration of a flexible method that addresses the DACO-EV problem, including all the necessary real-world parameters and speed-up techniques that allow the solution of the problem to be personalized to the needs of travelers in real-world settings. As regards, the method presented in this article renders adequate results concerning both the quality of solutions delivered to travelers and the computation times. All of the aforementioned attributes potentially enable this method to be applied at the backend of a web platform that aids travelers in their daily needs or a simulation framework. Consequently, this article presents: • The rigorous definition and modeling of the DACO-EV, including parameters and decision variables according to travelers' preferences and value-adding criteria. • The solution method for the DACO-EV based on the Genetic Algorithms framework.
• Heuristic rules and mechanisms that are included in the implementation for the efficient search of the solution space for alternative locations of activities by using a Points of Interest (POI) network of 57,351 available locations clustered in 935 activity types. • Optimization and transportation-related insights about the operational level of the CS network and EV usage as derived from the application of the introduced method in Budapest, Hungary.

The DACO problem
The DACO problem is a modern problem that falls under the umbrella of TSP-related problems. Given an initial schedule of the daily activities of travelers and their priorities, an optimized plan is calculated for those activities by introducing alternative locations to be visited by the traveler and alternative time windows of visiting the locations of the activities within the operating hours of the facilities. According to whether the user can attend other locations for an activity or can conduct an activity in different periods of the same day, better schedules may be created. Multiple objectives exist for the problem, but the main focus is to aid travelers in reducing TT in their daily activity chains in metropolitan areas.
Next, for descriptive purposes, a formal graph-based formulation is provided for the DACO problem: consider a graph G(V, E) , where E is the edges of the graph, and V is its vertices. While V can be considered as the locations or venues at which activities can be conducted within the transportation network, the set of edges E represents the multi-modal transportation links connecting the locations. In addition, every vertex V i ∈ V is associated with three labels: A i , which indicates the type of the activity conducted at any V i out of a wider set of activity types A, TWOO i and TWOE i , which correspond to the opening and closing time of the operation of the venue facilitating activity A i at V i . Regarding the indices used in Sect. 3 of this article, all vertices are indicated by i ∈ N , where N is the number of vertices in V , j ∈ M , which is used to indicate activities, where M is the number of activities in A . Moreover, k ∈ K is used for the activities in the activity chain as defined by the user, where K is the number of activities in the daily chain, and e ∈ L , where L is the number of edges in E.
Furthermore, each edge of the graph is associated with a Travel Time label function TT (u, v) , where u and v are two different vertices of the graph with u, v ∈ V . Given an Earliest Starting Time (EST) and a Latest Ending Time (LET), an activity chain within the transportation network as modeled by graph G is a cyclic path P, which contains a set of vertices V e,k ∈ V e ⊆ V , where V e is a non-empty set that contains at least three elements: i) the starting vertex, ii) the ending vertex, and iii) at least one out-of-the-house activity. The starting and ending vertices can be the same location, usually the traveler´s home, and can be called the starting and ending positions of the traveler, as well. If the set V e contains K activities/vertices, then the traveler follows these activities in a specific order as indicated by the set O = {1, 2, 3, .., k, .., K} . Additionally, there are several temporal properties that are associated with each activity A e,k at vertex V e,k , where A e,k ∈ A e are the types of activities included in the activity chain. Those temporal properties are the Start ( TWAS k ) and End ( TWAE k ) of the Time Window of Attendance and the Processing Time PT k for that activity.
The optimization of daily activity chains requires several sets of input parameters from the travelers that concern their preferences regarding alternative locations for activities and temporal scheduling options. In order to include the degree of flexibility of the travelers concerning how their initial activity chains change, four levels of flexibility that are believed sufficient to cover the flexibility needs of the travelers are considered. Those flexibility levels, or rather Priority Labels PL e,k , as included in Table 2, serve as parameters to the problem, and their values as decided by the travelers can vastly affect the problem´s solution space.
The solution to the problem is affected in the following ways. When an activity has priority label 1, it means that the user considers it as both spatially and temporally fixed. Priority label 2 is assigned by the travelers to activities that are spatially flexible, which means that they can be conducted at several locations, but temporally are not flexible, meaning that the algorithm is bound to calculate the visit to the activity with that label within the desired time windows. With priority label 3, the traveler indicates that the activity must be conducted at the provided location, but it can happen in any time window within the day (i.e., temporally flexible). The last case is priority label 4 when the traveler indicates that the activity is totally flexible, which means that it can be both conducted at another location (providing the same type of service) and at any time (within the operating hours of the service).
Regarding the relationship between the priority labels and the solution space of the problem, one can understand that the more flexibility is introduced into the problem by the travelers and their priority labels, the vaster the solution space is; thus, the instance of the problem is harder to solve. In other terms, if, for example, a traveler has an initial set of three activities assigned with priority label 1 to all of them, the solution space is restricted to only three locations (i.e., zero alternative locations for each activity) and to very few alternative solutions that primarily include the reordering of the visit to the activities if that is allowed by the constraints mentioned above (M.E. 1-18) and the time-windows of operations and the attendance of the traveler. In contrast, if all three activities are assigned with priority label 4, a more significant solution space is created, and the GA has to explore more alternative solutions that satisfy the constraints and yield better results for the traveler. Of course, the combinations of the priority labels are a significant number (i.e., 4 K ), allowing the spaces of solutions that significantly differ from one another. Generally, and as it is confirmed from the computational experiments provided later on in this document, Spatially and temporally flexible ✔ ✔ spatial flexibility, which allows multiple locations to be considered for activities, can lead to bigger solution spaces, thus to better solutions. However, temporal flexibility allows a better reordering of the solutions, but it does not affect solution spaces and the optimized solutions in a significant way. Furthermore, the parameters of the problem can be clustered into two groups. Group A includes all the static parameters of the problem that depend on the transportation network and the urban environment. Group B includes parameters that refer to the preferences of the travelers and are defined by them. The combination of the parameters of Groups A and B creates a unique instance of the problem depending on the values of the parameters of Group B. An outline of the parameters is included in Table 3.
The decision variables of the DACO problem are included in Table 4, and a graphical representation of the optimization of an activity chain in the spatial context is given in Fig. 1.
The decision variables included in Table 4 are the independent variables of the DACO problem. By manipulating those three sets of variables, a full solution to the problem can be elaborated and described. Depending on the modeling approach to the problem, other dependent variables (e.g., the start and end time of the tour) can be considered. Additionally, for the temporal properties of the activities and the activity chain, the following Mathematical Expressions (M.E., i.e., constraints) have to hold: Table 3 The parameters of Group A and B  Table 4 The decision variables of the DACO problem Decision variable Description Nomenclature The order of the activities in the chain The order of the activities in the tour in relation to their initial order The locations of the activities The selected locations for the activities out of all the available locations in V The time windows of the attendance to each activity This variable is used to specify the arrival and departure times of the traveler at each activity and location Besides, time continuity has to be reassured to hold within this graph-based formulation; thus, the model is subject to the following constraints, as well: The goal of the DACO problem is to calculate an optimized activity chain such that the total travel cost is minimized. According to this article's definition of the problem, the initial and optimized activity chains should include the same number of activities, the ones that the travelers want to conduct within their day. The travel cost function has several components (e.g., according to criteria included).

Criterion
Calculation formula Arrival Time (AT) at the final activity's location AT = TWAS K = TWAE K (20) Given that the two criteria can be weighted, the objective function for the optimization of the DACO problem is the following: where U is the Fitness Function, X is a candidate solution, and parameters a and b are weights that can be adjusted according to the priorities of the travelers.
The graphical representation of an activity chain and an improved one by including an alternative location for the activity It can be noticed that several similarities exist between the DACO problem, the TSP, and the TSP-TW. Similarities are especially noticeable in the case of the TSP-TW. While the parameters of the two problems (i.e., the DACO and the TSP) differentiate to a considerate degree, the DACO problem and the TSP-TW have two identical decision variables, which is the order of the visits to the locations (i.e., the activities in case of the DACO) and the time windows of the attendance to each location. In the case of the DACO problem, there is an additional decision variable that represents the spatial locations for the activities/visits since activities can be conducted at multiple locations. A noteworthy difference to mention here is that in the DACO problem, not all nodes in the graph are visited but rather only one vertex per type of activity A e,k ∈ A e , where A e is the types of activities included in the initial activity chain.

The DACO-EV problem
In this section, an extension of the basic instance of the DACO problem is discussed, which is called the DACO-EV (i.e., the Daily Activity Chain Optimization with the use of Electric Vehicles). The major difference from the basic instance of the problem is that when travelers utilize the EV instead of a conventional vehicle to complete their tour, they must be reassured that the vehicle has enough fuel so that it can cover the distance needed to complete the tour. While the vehicle´s battery storage can acquire more energy through the charging of the battery at private or public CS and through regenerative braking, the consumption of the vehicle can vary according to the covered distance and altitude as well as other parameters, such as the vehicle's weight and the EV model-specific consumption.
In order to extend the graph-based DACO model appropriately, several newly introduced parameters need to be considered. As discussed above, the motivation behind adding the parameters presented here is to model the problem after the real needs of passengers. Such parameters are the Starting State of Charge ( SSoC ) for the EV, which corresponds to the amount of energy available in the battery of the vehicle when the tour begins and the Final State of Charge ( FSoC ), which corresponds to the desired level of energy by the travelers when they reach their final destination. SSoC and FSoC take the values of the percentages of the available energy according to the EV model-specific capacity and are optional input parameters for the travelers that can default to initial values (such as SSoC = 100% and FSoC = 0% ). Another set of parameters (Table 5) must be included to be able to describe the energy loss and the recuperation mechanisms in the DACO-EV and are fully defined by specifying the EV model the travelers utilize while extracting the information from databases.  (CSN) , which can be a set of CSs' vertices V CS ⊆ V , where V is all the vertices of the extended graph G . A final parameter to the DACO-EV is the availability of CS in the CSN , which is modeled as a label AL i assigned to each CS vertex V CS,i . Labels AL i take percentage values that correspond to the likelihood the CS has to be occupied at a point in time. Although the values of AL i are considered static labels at the time of calculating the solution (pre-calculated), they can be calculated in real-time, too, based on the analysis techniques on occupation data.
Finally, the aforementioned definition of the DACO problem is extended to describe the DACO-EV. The DACO-EV is the optimization problem where a graph G(E, V) is given, in which V contains all vertices V V that represent venues at which activities in A can be conducted and vertices V cs that represent CS, an EST and a LET , like in the DACO, the goal is to calculate a cyclic path P EV . Path P EV is different to path P of the DACO in the way that it possibly includes K activities, but on some occasions, it possibly contains an extra activity, which corresponds to a charging activity. The deviation from the main tour to charge the EV (i.e., charging activity) is also called the charging subtour and is subject to additional constraints, as described later in this section. Additionally, in this definition of the DACO-EV problem, two alternative ways (i.e., scenarios) of conducting the subtour are considered to model a realistic EV driver's behavior. The first scenario, which is called the classic charging scenario, is the case where the traveler visits any vertex of the V CS ⊆ V of graph G and does so in-between conducting two other activities while waiting in the car until it charges to the desired level. In the second scenario, which is called the en-passant scenario, the traveler has the option to go to the same CS, leaves the car there to charge, and while the EV is charging, the traveler can conduct an activity. While both scenarios are integrated into the definition of the DACO-EV and are integral parts of it, it is up to the optimization method utilized for its solution to decide which of the two needs to be included in the candidate solutions to each instance of the problem. Below in Figs. 2 and 3, the classic and en-passant charging scenarios are presented, respectively.
Regarding the decision variables of the problem, while in the DACO, there are three sets of decision variables (as seen in Table 3), in the DACO-EV, a fourth set, which is utilized to describe this subtour as a part of the solution, has to be added. This fourth set contains the binary variable for the Charging Scenario CSC (equals zero for the classic scenario or Fig. 2 The graphical representation of an optimized activity chain for the DACO-EV demonstrating the classic scenario one otherwise) and the continuous non-negative variable for Charging Time ( CT) . Thus, in Table 6, the decision variables for the DACO-EV problem as defined in Sect. 3 of this paper are summarized.
In the optimized activity chain, a label is introduced to associate the Remaining Energy (RE) labeled RE k ∀k ∶ k ∈ K , which represents the percentage of battery power in the EV´s energy storage mechanism, the following constraints have to hold: In order to consider consumption and recuperation, the function g E e , m is introduced, where E e is the traversed edge, and m is the EV model used by the traveler. Depending on the traversed edge, the consumption, and the recuperation capabilities of the vehicle utilized by the traveler, function g provides the overall energy lost or gained per leg of the tour.
Furthermore, some additional criteria can be considered for the optimization of the activity chain. Alongside the criteria, as described in M.E.   Table 6 The decision variables of the DACO-EV problem Decision variable Description Nomenclature The order of the activities in the chain The order of the activities in the tour in relation to their initial order The locations of the activities The selected locations for the activities out of all the available locations in V The time windows of the attendance to each activity This variable is used to specify the arrival and departure times of the traveler at each activity and location

Subtour information
In the case where the EV needs extra energy to complete the tour, given the parameters SsoC, FsoC, the consumption, and recuperation, a charging detour might be described by two independent variables ) calculated. As in the case of M.E. 19 and parameters a and b, a sensitivity analysis of the effect of the parameters on the produced solutions is one of the future steps to take. Although the DACO-EV method has more degrees of freedom compared to TSP (C. E. Miller et al. 1960;Christofides 1976) and TSP-TW (Ascheuer et al. 2001;Dumas et al. 1995), several GA approaches as presented in the literature (Freisleben and Merz 1996;Nygard and Yang 1992), are among the building blocks for the research presented in this article and allow the meaningful solution of the DACO and DACO-EV problems within acceptable computation time.

Solution approach and method description
For the optimization of the DACO-EV, an extension of the methodology presented in previous approaches (Esztergár-Kiss et al. 2018) is elaborated. The method is comprised of the GA based on Darwin´s evolution principle (Fig. 4), which is applied to solve the TSP-TW problem for the different combinations of the possible solutions' characteristics. After running the algorithm for several iterations, a better solution for the initial schedule of the user is derived. Except for stochastically examining the different combinations of the locations and time windows of the activities, which may lead to more convenient solutions for the users, the algorithm ensures that after the whole tour, the EV has the desired State of

The genetic operators
By defining the properties of an individual (i.e., solution) of the problem, the populations of solutions in the solution space can be formed. Afterward, the genetic operators of the selection, mutation, and crossover are utilized in several generations (i.e., turns) to search the solution space and derive solutions efficiently. The utilized genetic operators are based on the Distributed Evolutionary Algorithms in Python (DEAP) framework (Fortin et al. 2012), but they are modified to match the needs for the solution of the DACO & DACO-EV problems. For the crossover operation, the ordered crossover (cxOrdered module) is utilized as a foundation; for the mutation operation, an index shuffling operator (mutShuffleIndexes module) is used; and finally, for the selection operation, the DEAP tournament selection operator (selTournament module) is applied. The ordered crossover operator is modified in a way that the operation could apply to all of the variables of the DACO and DACO-EV, but the primary function of the operator does not change. In contrast, in the case of the mutation operator, its primary function is modified in two ways: (1) to solve the DACO problem and, (2) to address the DACO-EV specific attributes.
The first way in which the mutation operator is extended includes the mechanism that changes the spatial distribution of the activities in the space. In other terms, according to the mutation probability, some locations of the activities in the chain are swapped for other random locations from the available locations in vertices V of graph G, as it is presented in Sect. 3. In technical terms, due to the extension, the method is able to search through a POI database of 57,351 locations of 935 activity types.
Additionally, the second extension of the mutation operator includes a repair heuristics mechanism that works based on a forward lookup of the energy needs in the travel chain (i.e., solution). Once the first three sets of decision variables from Table 6 are calculated, the solution is "repaired" -if needed-by adding the necessary detour and CT at a CS. In the approach of this article, while CT is an independent variable of the problem, it is a deterministic one and a function of the other aspect of the activity chain and the subtour. The amount of time spent at the CS is calculated with a forward lookup of the energy requirements of the EV to cover the full tour. This calculation occurs by comparing the SSoC, the FSoC, and the RE of the vehicle's battery at every location. The candidate solutions (i.e., individuals) to the problem fully describe the locations to visit and the order of the attendance to the activities. From those two attributes, the exact routes between the locations of the activities as well as the kilometric distance, the elevation gained and lost, and consequently, the CT at the CS can be calculated. The modifications to the mutation operator in correspondence to each problem are described in Table 8.
Readers are encouraged to study the documentation of the DEAP and David Goldberg´s book (Goldberg 1989) for further insights on the function of the operators that are utilized in this approach. Except for the applied genetic operators, the method is characterized by a set of configuration parameters, such as: • Population size-the number of the solutions created at first during the solution space initialization phase and kept by the selection operator at the end of each iteration of the algorithm. • Base mutation probability-how much to search for solutions with totally new attributes compared to the initial population of the solutions. • Crossover probability-how many new solutions (i.e., individuals) are produced at each iteration of the algorithm based on the previous populations. • Generations-the iterations of the GA that run until getting a final solution. No other termination criterion is used, which means the number of generations defines the final optimality gap of the solution calculated by the run of the algorithm.
Different values of the configuration parameters can be utilized for the various operators of a GA. The values for the best performance of the GA should be acquired through extended testing and convergence tests. However, as it has already been widely discussed (Weise et al. 2019), this choice of values for the parameters can further vary according to the approach of the researcher/modeler.

Solution encoding and the GA
For the efficient modeling of the candidate solution (i.e., individual) of the problem, the decision variables of the two problems must be included as genes to the individuals. Those genes fully describe all attributes of the solutions and are the quantities manipulated by the GA operators to calculate alternative efficient solutions.
While in the approach of this paper, the considered genes are the ones described in Table 4 for the DACO problem and in Table 6 for the DACO-EV, more genes can be examined depending on the choice of the modelers and the solution approach. Based on this, the GA elaborated for the efficient solution of the DACO-EV is provided in Fig. 5.
While the algorithm above is the one used to derive solutions to the DACO-EV, a similar algorithm, based on the same method and genetic operators, can be derived for the solution of the DACO problem. This algorithm (addressing the DACO problem) is implemented and used in this article to show the effectiveness of the method and the speed-up mechanisms. The algorithm for the DACO, which is utilized in the results section, is the one depicted in Fig. 5 but without steps 3.2.3, 3.4.3, and 3.4.4, which are the extensions needed to solve the DACO-EV.

Speed-up mechanisms for the implementation of the method
For the implementation of the method, the Python programming language and the DEAP framework (Fortin et al. 2012) are utilized. The OpenTripPlanner (OTP) engine (McHugh 2011) is the primary tool for the calculation of the road distances and TT, and calculations with the CS are conducted based on the data from an EV charging network operator. For the evaluation operator and the fitness function, the applied criteria are the overall TT for the DACO and DACO-EV problems.
To address the practical solution of the DACO and DACO-EV, a series of pre-optimization and speed-up techniques are adopted to lead to an efficient solution. In the following subsections, these techniques are explained in further detail.

3
The pre-optimization phase The first addition to the method is the pre-optimization phase. In this phase, the goal is to decide on some aspects of the solution before starting the search for an optimized solution, thus creating a smaller solution space. The main benefit of this pre-optimization phase technique is that it allows creating a "personalized" searchable network for each traveler (and corresponding instance of the problem). By utilizing this technique, the initial problem of approximately 57,351 available locations clustered in 935 activity types can be reduced to a smaller network of alternative activities and locations that can be effectively searched.
This reduction of the solution space happens around the locations of the activities that the travelers consider as totally or spatially fixed. More specifically, this technique considers the activities with spatially fixed priorities to serve as gravity points for the optimization procedure. Based on these gravity points, we are able to decide prior to the main optimization phase (GA search phase) that the method does need to search through a huge part of the activity-travel space potentially leading to infeasible solutions or solutions with greater TT than that of the initial activity chain, as inputted by the traveler.

Input:
Parameters for the execution of the GA and the parameters of the problem Output: T he solution to the problem which is an optimized activity chain for the traveler Steps: 1: Read the data and the parameters, create appropriate data structures; 2: Initialize a population of feasible solutions (i.e., individuals) for the problem; 3: For generation I in the range [0, generations): 3.1: Apply the crossover operator to the individuals of generation i; 3.2: Apply the mutation operator to the individuals of generation i; 3.2.1: Randomly swap the order of two activities for any individual; 3.2.2: If there is a spatially flexible activity, then randomly change its location to a new suitable location; 3.2.3: If an EV is used and if the SoC at the final location is not at the desired level, or there is a negative number at any point in the tour, add a detour at a random CS. If the detour exists, change the location of the CS in the tour randomly; 3.3: Calculate the distances' matrix (and the kilometric distances, elevation gained, and elevation lost matrices if needed) for the locations involved in the individuals of generation i. If an EV is used, label infeasible all individuals, including CS, which are unlikely to be available; 3.5: Select the individuals to form a population and reproduce in the next generation i+1 based on the tournament selection operator; 4: Select the individual with the best fit from the population of the final generation; 5: Return the individual (i.e., solution) that is selected in Step 4; 6: Algorithm termination. In the case of the DACO-EV problem, the pre-optimization phase also applies to the CS network.
The following examples are provided to better articulate how priority labels, as described in section "The DACO problem", affect the pre-optimization technique, and the reduction of searchable solution space. If an activity is fixed (i.e., priority label 1) in the search for an optimized solution, all other temporal and spatial choices concerning this activity can be ignored. In the same manner, if the activity is temporally fixed, all alternative facilities (i.e., locations) are included, but it is not allowed the algorithm to search outside the time windows specified by the traveler. If the activity is spatially fixed, then those parts of the solution space that have to do with other locations of the facilities for the activity are cut out, and the algorithm is allowed to search for different time windows. If the fourth case of total flexibility is the case, the search needs to be performed for both the alternative facilities and time windows of the attendance, and pre-optimization is not possible. Further information about this relationship between priority labels and solution calculation is also provided in the results section.

The recalculation of distance matrices
Another technique is the recalculation of the Travel Time Distances' (TTDs) matrix, which includes the distance in time to get from the location of activity i to any other location of activity j. Given that in every iteration of the GA, the evaluation of the candidate solutions (i.e., individuals) is needed according to their attributes, a distance matrix, which includes the real road network distances between the locations of every particular potential solution that emerges from the exploration of the solution space, is required. There are cases where a new location is added that does not exist in the previous populations, and it is required to calculate a new distance matrix to solve the order for this set of locations.
To avoid unnecessary computation requirements, a technique for recalculating the distances matrix is introduced. This means that when a new location is included, the whole matrix is not recalculated but only a smaller portion, where the new TTD is required and is combined with previously calculated results. In algebraic terms, there is a given matrix TTD i,j , when a new candidate solution emerges with an alternative location for an activity, according to the approach of this research, a new matrix TTD′ i,j with the new TTD have to be recalculated. Both the initial and the recalculated matrices have the same dimensions (i.e., the same number of activities before and after), but the new matrix has a maximum of one new location. Given the technique described here, instead of calculating for pairs of (i, j) in the matrix, a mechanism is implemented where only those pairs of (i, j) that include the new locations are calculated with the rest remaining the same. In essence, given that the new location is inserted for activity k in the travel chain, the quantities of TTD i,j , which are transferred into TTD′ i,j , are described by the following equation: Consequently, for all pairs (i, j) where i = k or j = k, the TTDs have to be recalculated. An illustrative example is given below, where Table 9 is the initial table of an individual before adding a new location, and Table 10 is the distances' matrix for the individual with the new locations.
Let us consider that a new solution emerges that utilizes Location 6 instead of Location 3 for Activity 3. The new individual, instead of utilizing Locations 1, 2, 3, 4, 5, includes Locations 1, 2, 4, 5, 6. Thus, Table 9 cannot be used to evaluate the new individual. A new (26) TTD i,j = TTD� i,j ∀(i, j) ∶ i ≠ k and j ≠ k Activity 5/ Location 5 TTD from Loc. 5 to 1 TTD from Loc. 5 to 2 TTD from Loc. 5 to 6 TTD from Loc. 5 to 4 0 matrix (Table 10) needs to be calculated, but it is done by only discarding Row 4 and Column 4 and by calculating a new set of distances to insert into the new columns.
This idea provides a considerable improvement for the approaches to the DACO or DACO-EV problems. While the example emulates the recalculation of the TT distances' matrix, this recalculation is implemented for the matrices needed for the calculation of the energy requirements of the EV, which are the elevation-gained matrix, the elevation-lost matrix, and the kilometric-distances matrix.

The scaled ranking of the infeasible solutions
The next rule adopted is the scaled ranking of the infeasible solutions. While in the GA, a set of feasible solutions is calculated for the DACO problem in the first iteration, in the DACO-EV, several iterations of the algorithm might be needed until a feasible solution for the problem is reached. The reason why the solution space is not populated initially with feasible solutions to the DACO-EV is that this technique is proven costly in terms of computation time compared to calculating the DACO feasible solutions for both cases of the problems. The DACO solutions can be derived by creating permutations that correspond to the order of the activities of the initial tour. In the DACO-EV, extra effort is required to guarantee that the solutions comply with the electromobility constraints. This can be considered as a high-level Lagrangian relaxation of constraints for the creation of the initial population in the case of the DACO-EV, where the electromobility constraints are not only applied in the penalty function of the iterations of the GA but also in the creation of the initial population. In this manner, the populations of the GA may remain with infeasible solutions for the first few iterations of the GA. It is noticed that the infeasibilities occur due to the following reasons: 1. Lack of CS near the locations of the activities. 2. Low sSoC and high FsoC are demanded by the traveler. 3. High energy is needed because of the significant distances or elevation levels of the tour. 4. High occupancy of charging stations. 5. Demanding overall tour with many activities, high travel distances between the locations of the activities, and high processing time at the activities.
Thus, the GA might need several iterations until it finds feasible solutions for the population leading the approach to solutions of lesser quality (i.e., more considerable optimality gap from a globally optimal solution). For this reason, a ranking system is adopted, where infeasible solutions for the DACO-EV are not just assigned with a specific fitness value or are discarded, but they are categorized into two groups, as well. The first group of infeasible solutions satisfy the DACO and DACO-EV temporal constraints but do not fulfill the energy equilibrium constraints due to reasons 1-3 stated above. The infeasible solutions are assigned a fitness value according to how much energy is missing at the end of the tour. This fitness value can be considered as the degree of the infeasibility of a solution that violates the DACO-EV constraints. In this way, when all solutions are infeasible, less infeasible individuals are kept and passed on to the next generations and allow an indirect repair heuristic to take place in the next generation. However, this mechanism described above is not a repair heuristic, as usually referenced in the literature, because the GA does not explicitly take the steps needed to repair the solution. It only does so by mutation and crossover, which are stochastic processes that apply to all solutions, either feasible or infeasible. The solutions that violate temporal restrictions (i.e., reason 4) are directly discarded at each iteration.
In correspondence to the formal specification of the GA, in Fig. 6, a graphical representation of the method is presented, where the steps of the algorithm are shown in green while the parts of the implementation are shown in white rectangles.

Problem instances and their description
A series of experiments are conducted to provide the necessary scientific evidence for the adequacy of the proposed research for addressing the real-world daily needs of passengers in urban environments. The two criteria considered for the suitability of the presented method are the reduction of the TT, when compared to the TT in the initial schedule, and the computation time of the method. Instances of the problems for both the DACO and DACO-EV are included in the tests; particular emphasis is put on cases where the precomputation techniques are applied and where they are not.
To map out the performance of the algorithm against several representative flexibility levels of the activity chains, ten types of problems (i.e., cases, instances) are included in the experiments. For all of the cases used for the tests of this study, the activity chains contain a maximum of four out-of-the-house activities. For the first six instances of the problems (i.e., cases 1 to 6), also referred to as the balanced cases of the problem, the attributes of the problem instance (i.e., locations, the types of activities, and flexibility) are based on the actual activity chains of the travelers. With those examples, the expected travel behavior that would be close to the inputs of users is attempted to be emulated. For the rest of the problem instances, cases 7 to 10 (i.e., the "extreme priorities" cases), the set of the initial locations and the types of the activities are kept the same as in case 6, but Fig. 6 The graphical representation of the overall solution approach the potential outlier (i.e., extreme) combinations of priority labels are included for outof-house activities (since the first and the last activities being indicated as "Home", and being spatially fixed). With this second group of "extreme priorities" cases, it is attempted to test the adequacy of the method for the potential outlier solutions, where the input may be unrealistic but is still crucial for testing to evaluate the performance of the algorithm. In Table 11, more case-specific information is given for each of the cases run for this results section to promote the reproducibility of the results. These ten instances are used for testing the method for both the DACO and DACO-EV problems. However, for the DACO-EV, while the initial shared parameters remained the same, extra necessary parameters regarding the use of the EV are considered. SSoC is considered 70% and FSoC 85%, rendering the need for charging across all those problem instances in the DACO-EV, independently of the rest of the input attributes for each example. The EV model used across all of the experiments is a modern vehicle, a model of 2017 with 28.0 kWh of useable battery. For all the results presented in the next few subsections, the execution time, as well as the values of the objective functions or other metrics (i.e., the duration of the subtour in the DACO-EV), are based on an Average Case Analysis. For every case (i.e., instance) of the problem presented, 12 runs of the algorithms are executed. Afterward, the average value of the metric is calculated with the minimum and maximum outlier cases being excluded from this calculation (i.e., the average across ten runs of the algorithm for each metric).

Convergence analysis for the algorithm
In this section, some indicative results are given on the convergence analysis for the algorithm of this research and the underlying optimization mechanisms presented in this article. The results include two cases: Cases 1 and 2 (Figs. 7 and 8). The cases display the convergence that the algorithm presented for both the DACO and DACO-EV. The y-axis represents the Travel Time (TT), while the x-axis is the number of iterations (iter.).
From the results presented above, it can be noticed that the convergence for Case 1 and both the DACO and DACO-EV problems can be considered very satisfying with the algorithm converging to solutions with very similar fitness values for each case of the problem

Results for the DACO problem
The results presented in this section demonstrate the efficiency of the pre-optimization technique as well as the suitability for addressing the DACO problem. Since different cases 1 to 10 (Table 11)  A set of values has been considered for the configuration parameters of the GA. The population size selected for the solution of the DACO problem includes 30 individuals, and the selected mutation probability is 20%. The selected crossover probability is 10%. From the convergence analysis, it is obtained that the number of generations for the calculation of a sufficiently optimized solution with the best ratio of solution quality to computation time is 30 generations/iterations. Finally, for the running of these experiments, the computer system used uses an Intel Core i7-6700HQ CPU, 8 GB of RAM and an SSD.
In Table 12, the effectiveness of the method calculating the improved activity chains for the DACO is displayed. While the trips before and after the optimization consist of the same number of activities, the optimized tours include more suitable locations and time windows of attendance for the activities and the overall reduced TT. By following the optimized plans for the daily schedules of their activities, travelers can gain reductions in the TT that range from 10.47 to 69.77% in all categories of the calculations. The results, in the case when pre-optimization is utilized, are derived on an average of 15.45 s (11.39 s for real-world cases). For the optimized tours, when pre-optimization is applied, travelers can get a 31.42% reduction (excluding case 7, where all activities are spatially and temporally fixed) in their overall TT on average compared to their initial tours. Additionally, the effects of pre-optimization can be noticed in the solution process in Table 13.
When pre-optimization is applied, the calculated tours include less TT and require less computation time than in the cases when pre-optimization is not applied. It can be noticed that the reduction in the overall TT is 14.47%, while in the case of the computation time, it is reduced by 47.41% on average for the DACO problem. From the above results, it can be stated that the reduction of the computation time is the main benefit when it comes to the application of pre-optimization for the case of the DACO problem. Please note that for Case 10, which can be considered as a "fully flexible" case, all of the out-of-house activities are labeled with Priority label 4, which does not stop the pre-optimization procedure from calculating a smaller personalized network of alternative locations based on the location of the home of the traveler (what can be considered as starting and ending activity/ location and is spatially fixed).

Results for the DACO-EV problem
In the case of the DACO-EV, an extra attribute of the trips needs to be calculated, i.e., the duration of TTST, if it is needed according to the values of the parameter of the problem. Therefore, the columns of the tables are extended, as well.
• Subtour (no pre): The average TTST (any charging scenario) for a DACO-EV tour (without pre-optimization applied to the solution process) (min) • Subtour (pre): The average TTST (any charging scenario) for a DACO-EV tour (with pre-optimization applied to the solution process) (min) For the calculation of the following results, the same configuration parameters are for the GA as in the case of the DACO problem calculations.
In Table 14, it can be noticed that the developed approach is efficient for the case of the DACO-EV. The results presented here can be analyzed in three ways. First, the overall TT is not necessarily reduced in all cases. That is because in the DACO-EV, and for the tests run with the given SSoC and FSoC levels, an extra charging activity or charging session is needed to be added. As a result, it is reasonable that although activity chains are optimized to reduce TT, in some cases, such as Cases 1 and 2, the TT is raised due to the extra stop at a CS and the detour needed to get there. However, when pre-optimization is applied, in Case 1, the algorithm still finds a solution with more TT than the initial one, but in Case 2, solutions that have less TT than the initial one are calculated. Secondly, it can be noticed that the calculated TT for the subtours is, in most cases, a significant part of the overall TT, and in a few cases, it can be greater than the rest of the TT needed to complete the remaining part of the tour. Thirdly, the computation time for the DACO-EV is way more demanding than in the case of the DACO. A positive observation is that the average computation time is 24.99 s for all the cases, and in balanced cases, it is 19.51 s on average, which is a reasonable solution time if the method can possibly be reproduced to serve real travelers in their daily lives. The effect of pre-optimization can be more evidently noticed in Table 15, where the four cases of the problems have almost 50% or more reduction in TT for the subtour. The overall TT is reduced by 23.5% on average across the ten cases, and the duration of the subtours is reduced by 35.7%. Furthermore, it can be seen that except for the reduction of TT, the

Discussion of the results
All in all, it can be noticed that the application of pre-optimization yields a significant reduction in TT and calculation time for both the DACO and DACO-EV problems. While the pre-optimization bounds the solution spaces and provides a smaller personalized network to search for an optimized solution, the recalculation of the matrices technique is utilized to avoid unnecessary calculations by retrieving previously calculated distances. In some cases, it can be noticed that the results of the method for 30 iterations and when pre-optimization is applied are better than in the case when the GA operators' configuration parameters are modified to search the solution space extensively. The following main takeaways can be extracted from the results section: • The method proposed in this article, when it is applied for the DACO problem, can yield a 31.42% reduction in their overall TT on average from their initial tours, a minimum 10.47% reduction up to a 69.77% maximum reduction. • In the case of the DACO-EV problem, the method is able to acquire reductions in the overall TT in the DACO-EV tours of about 17.5% on average once compared to the initial activity chain. • Concerning the effect of pre-optimization on the resulting optimized activity chains and in the case of the DACO problem, it can be noticed that the overall TT is reduced by 14.47% on average in the ten test cases once compared to the averages when preoptimization is not applied. The percentage of the reduction of computation time is 47.41%. • Concerning the effect of pre-optimization on the resulting optimized activity chains and in the case of the DACO-EV problem, it can be noticed that the overall TT is reduced by 23.5%. The duration of the subtour is reduced by 35.7%, and the computation time is reduced by 68.28% on average. • Realistic computation times are acquired for both problems given the size of the realworld instantiation of the two problems (the solution space accounts for alternative locations of activities using a POIs network of 57,351 available locations clustered in 935 activity types). The solution times were 15.45 s (11.39 for emulated real-world cases 1-6) for the DACO problem and 24.99 s (19.51 for cases 1-6) for the DACO-EV problem.
With the pre-optimization and speed-up techniques presented in this article, a heuristic method can calculate the optimized solutions for the DACO and DACO-EV in deterministic time due to the reduced size of the solution space. The pre-optimization procedure allows the reduction of the available solutions that are reachable during the search phase of the method (i.e., the GA exploration phase) primarily due to the elimination of POIs and EV CS. While those eliminated POIs and EV CS are available in the initial datasets, they are further away from the spatially fixed location of the activities in the personalized activity chain as it has been initially defined by the traveler. The reduced solution space is not guaranteed to have the globally optimal point of the initial solution space (due to the exploitation of the heuristic rules), but it is likely to include local optima that serve as realistic solutions for the travelers. Although the solutions calculated by the method presented in this article for both cases (i.e., when pre-optimization is used and when not) are not guaranteed to be the globally optimal ones, in realistic settings, the calculated local optima can yield great benefits (i.e., TT reduction) to the travelers for both problems.
This pre-optimization technique can be further expanded to reduce the solution space to even smaller sizes (according to temporal constraints), which can make the solution space exploration phase even more efficient. This is a phenomenon that is observed and confirmed by the current method and is common in heuristic algorithms that address NP-hard problems. In the DACO and DACO-EV, by fixing several of their parameters, the two problems can be easily reduced to TSP or TSP-TW thus can be considered to belong to the family of NP-hard problems.
Of particular interest are some transportation-related insights that can be derived from the results. The first set of observations regards the effectiveness of the pre-optimization of this approach, which treats the spatially fixed points as nodes of higher importance. In the preoptimization phase, a series of calculations are performed to reduce the solution space and the available options to revolve around the spatially fixed points. As a result, a personalized network is created for the traveler, and the method is able to converge to adequately optimized solutions faster than before when TT is considered as the main criterion. The research presented in this article further demonstrates that the spatial context of activity chains is related to TT, and when TT is one of the main evaluating criteria, the optimized decisions should revolve around the spatially fixed activities. This efficiency is not just a value-added result for the optimization of activity chains but provides considerable insight, which should be included in research efforts regarding the relationship between TT and the spatial context of activity chains.
The second set of observations deals with range anxiety and how it correlates to EV usage. In the ongoing debate between the psychological aspect and technical aspect of range anxiety, as it takes place in modern literature (Noel et al. 2019;Rauh et al. 2015), the findings of current paper validate the point that range anxiety is more of a psychological issue rather than a technical one. With the median EV range growing from 73 miles in 2011 to 125 miles in 2018 (Office of Energy Efficiency and Renewable Energy 2019), it becomes evident that EVs can be used successfully to run daily tours in a city. For Budapest, based on the experiments run in this article, it can be claimed that range anxiety is only a psychological phenomenon with no real-world technical substance for the daily needs of the travelers once the following conditions meet: • The traveler owns EV charging equipment at home (i.e., SSoC equals 100%). • The traveler owns a modern EV with fast charge plugs (i.e., CHAdeMO, CCS, Tesla Supercharger) and has access to fast charge CS. • The traveler performs a maximum of four out-of-the-house activities in the city during a single day.
Given well-sourced data for the CS network of any city, experiments should be run for other locations to derive the necessary insights and to produce comparative studies allowing the observation of how this phenomenon unfolds in different locations and its relationship to the CS network of each city.

Conclusion
In the current article, a series of important contributions are presented towards the rigorous definition and solution of the DACO-EV problem, which many EV drivers face in their daily lives. Given the initial schedule of a traveler's activities' program, their spatial and temporal flexibility, and characteristics of the EV usage, the presented solution method is able to calculate an optimized tour guiding the traveler through an improved activity schedule that includes less TT. Additionally, a series of speed-up techniques that make the efficient resolution of the problem possible are presented. The effect of pre-optimization techniques is highlighted for both the DACO and DACO-EV problems. All the statements above, as well as the suitability of the elaborated method for helping travelers in urban environments, are proven through a series of experiments. The scale of the algorithm's time complexity demonstrates that travelers can potentially utilize the algorithm through a web platform as a pre-trip planning tool.
The significance of this article lies in the fact that it is another step towards a body of knowledge on the intersection between activity-based modeling and optimization problems in transportation science. The exploitation of the results and insights, as presented in this work, can be further broken down into three sub-topics.
First, the rigorous definition of the DACO-EV problem and the method for its solution are introduced, with the scope of solving real-world instances of the problem. This is a significant contribution towards creating pre-trip planning tools for users of EVs that need them (Farag and Lyons, 2008;Pell et al. 2016) in order to execute their daily activity schedules.
Second, the results are valuable to researchers who are attempting to solve optimization problems in transport science and need to make use of data structures and optimization techniques in order to achieve feasible solutions in adequate computation times. The method is able to calculate improved activity schedules in real-world network environments (Budapest road network), with a vast number of alternative locations for the activity chains (POI network of 57,351 available locations clustered in 935 activity types).
Third, the method can be utilized for the analysis of travel demand based on an activitybased framework when applied on individuals' activity-travel data. As a long-term vision, the authors suggest that the method can serve as the backbone of a microscopic-simulation tool that can estimate demand based on real or synthetic populations and their daily activity chains. That simulation tool can be a significant contribution towards estimating travel demand for passenger transport (that utilize personal EVs) in urban environments, which in turn is an essential process in modern urban transportation planning.
Finally, some potential future research tasks are provided in this last paragraph. Regarding the modeling of the problem, an essential step is to quantitatively assess whether the four priority/flexibility labels for the input activities of an activity chain successfully reflect the needs and desires of the travelers. In addition, as an essential tool to fully utilize the method's capabilities, real or synthetic datasets of the population's activity chains should be exploited. This step can be essential to test the method's performance in different urban environments.
Continuing, while the solutions derived by the method present great improvements (~ 17.5% TT reduction on average for DACO-EV tours), this optimality assessment can be considered as a contradiction of this study. In that regard, an important future direction regards the theoretical optimality gap between the calculated realistic solutions (i.e., practically usable activity chain in real-world settings by everyday urban travelers) and the globally optimal ones. An exact approach to the DACO and DACO-EV problems would be an essential step to allow the comparisons of the solutions for each approach and gain further knowledge about the structure of the problem and its solution space. A final issue of the study is that travel times between real-world locations have been considered to be deterministic, while in real-world settings they are uncertain. This is another important research direction, where future work can be conducted, where stochasticity can be included in the calculation of travel times (due to network effects, such as congestion and traffic).