## 4 Optimal TWM Assignment  
Once the TWM maps have been designed favoring the different traffic flows according to their possible best disjoint routes, the question to be solved is what will be their best allocation to achieve the system's optimum, measured as the minimum mean travel time.  
Optimal distribution strategies minimize average travel time from a system-wide perspective. Different algorithms based on GA were preliminarily introduced in [12] for accomplishing this goal, applying two strategies: per vehicle optimal assignment (OTV) and per path flow optimal assignment with linearly constrained or unconstrained (LCTV/UCTV).  
All of them use the mean travel time evaluation procedure \(computeMTTS\) (24), which uses the network view \(\mu_{i}\), the network occupancy is expressed as the trips (routes) assigned to each vehicle \(\left\{p_{i}^{d}\right\}\), a reference to a volume-delay function \(\Psi\) (VDF), and its specific VDF arguments \(\Psi_{args}\). It computes the aggregated edge occupancy based on the individual routing decisions, which are then used for the VDF evaluation with the edge weight, the edge capacity, and the corresponding VDF arguments [5].  
\[computeMTTS:\mu_{i}\left\{p_{i}^{d}\right\}\Psi,\Psi_{args} \to mtts \tag{24}\] \[x_{e} \gets count(e),\forall e\in\left\{p_{i}^{d}\right\}\] (25) \[mtts \gets mean(\Psi(\mu_{i}(\beta_{e}^{d,i}),x_{e},\mu_{i}(W_{e}), \Psi_{args}),\forall e\in\left\{p_{i}^{d}\right\} \tag{26}\]  
As discussed in [12], OTV has significant drawbacks. First, the number of vehicles in the network directly influences the number of variables that need to be optimized (the chromosome size will shape the number of vehicles), leading to a demand for extensive computing resources that may be unaffordable even in small scenarios. Second, optimizing the microscopic assignment of TWM based on flows and path flows offers a macroscopic perspective of the traffic demand. As a result, it may not accurately represent traffic planning since it depends on specific trips.  
Considering the assignment of maps per path flow, we may surpass the pointed limitations. In this approach, each sub-flow \(x_{i}^{d}\) is assigned a fixed TWM map \(\mu_{i}^{d}\). The challenge now lies in solving the number of vehicles assigned to each sub-flow, that is, how many vehicles will use each \(\mu_{i}^{d}\) efficiently. The distribution is determined as a percentage of the traffic for every commodity \(d\). Consequently, each vehicle will be assigned the appropriate path flow map.  
The GA function generates the chromosome \(\aleph_{1}\) with a \(numPF\) size. Each value represents the percentage of vehicles from each flow allocated to a particular sub-flow \(x_{i}^{d}\). Two constraints are applied to ensure the validity of the chromosome. First, \([0,1]\) normalization is enforced. Second, flow conservation is maintained, which means that the sum of all vehicle percentages belonging to the same flow must equal 1. Both constraints are directly incorporated into the GA algorithm.  
The GA fitness function for LCTV is invoked during each population iteration to compute the mean travel time (MTTS). It receives the chromosome \(\aleph_{1}\) to evaluate the VDF function \(\Psi\), the physical network map \(\mu_{0}\), the traffic flows \(\left\{x_{i}^{d}\right\}\), the path flows \(\left\{p_{i}^{d}\right\}\), and the TWM \([\mu_{i}]\).  
The GA solver with linear constraints reduces the target population since it discards the individuals from the GA that do not fit them. This elimination of individuals evaluates the algorithm longer. It leads to worse results, as we will see in the case studies. The unconstrained solver UCTV applies the normalization step at the end of the process to the resulting values to compute the corresponding TWM distribution.