## 5 Methodology
### Development of the Two-Phase Heuristic  
To implement the heuristic algorithm, it was necessary to create a distance matrix, with the distance information (in kilometers) among the 44 dealerships, as shown in Table 1, the NCSY is represented by \(d_{0}\), e.g., a trip from the NCSY (\(d_{0}\)) to dealership 2 (\(d_{2}\)) has a cost of 1373 km, while the trip from dealership 2 (\(d_{2}\)) to dealership 44 (\(d_{44}\)) would represent a route of 1245 km. Figure 5: Constraint of vehicles with \(h>2.5\) m.  
Figure 6: Constraint of vehicles with \(1.8\)m \(<h<2.5\) m.  
Figure 7: Constraint of vehicles with \(h<1.8\) m.  
A time matrix is also required for the implementation of the heuristic algorithm. Table 2 shows the duration in minutes of the travel times between the dealerships, for example, the duration of the trip from NCSY (\(d_{0}\)) to dealership 1 (\(d_{1}\)) is 568 min, in other words, 9 h and 28 min. A route from the dealership 44 (\(d_{44}\)) to dealership 2 (\(d_{2}\)) is 13 h and 49 min of travel. The distances (Table 1) and times (Table 2) matrices are symmetric, but in the time windows, a matrix was created with the earliest (\(e_{i}\)) and the latest (\(l_{i}\)) time window, using a 24-h time format, as shown in Table 3. The NCSY (\(d_{0}\)) does not have a time window established, therefore, \(e_{i}=00\):00 and \(l_{i}=23\):59. Figure 1 shows an example of the dealerships who have established a time window, otherwise they do not have a time window established as the NCSY. The heuristic is described in Algorithm 1, first phase is responsible for generating the route for the auto-carriers and the second of the feasible load of vehicles in the auto-carrier. This algorithm is codified in JAVA language, it has as input a matrix \(M\) with the demand of vehicles to be transported and a matrix with auto-carriers \(K\) available for the delivery of vehicles. The first phase clusters the demand \(M\) according to the dealerships to visit (\(U\)), then perform the sorting of the dealerships with the shortest and earliest time window, considering that the execution time (_current time_, _CT_) of the algorithm influences this ordination, \begin{table}
\begin{tabular}{c c c c c} \hline \hline
**Dealership** & \(\mathbf{d_{0}}\) & \(\mathbf{d_{1}}\) & \(\mathbf{d_{2}}\) & \(\mathbf{d_{...}}\) & \(\mathbf{d_{44}}\) \\ \hline \(\mathbf{d_{0}}\) & 0 & 885 & 1373 &... & 114 \\ \(\mathbf{d_{1}}\) & 885 & 0 & 498 &... & 752 \\ \(\mathbf{d_{2}}\) & 1373 & 498 & 0 &... & 1245 \\ \(\mathbf{d_{4}}\) & \(\vdots\) & \(\vdots\) & \(\vdots\) & 0 & \(\vdots\) \\ \(\mathbf{d_{44}}\) & 114 & 752 & 1245 &... & 0 \\ \hline \hline \end{tabular}
\end{table} 
Table 1: Distance (in kilometers) between dealerships. \begin{table}
\begin{tabular}{c c c c} \hline \hline
**Dealership** & \(\mathbf{d_{0}}\) & \(\mathbf{d_{1}}\) & \(\mathbf{d_{2}}\) & \(\mathbf{d_{...}}\) & \(\mathbf{d_{44}}\) \\ \hline \(\mathbf{d_{0}}\) & 0 & 568 & 880 &... & 92 \\ \(\mathbf{d_{1}}\) & 568 & 0 & 319 &... & 490 \\ \(\mathbf{d_{2}}\) & 880 & 319 & 0 &... & 829 \\ \(\mathbf{d}\) & \(\vdots\) & \(\vdots\) & \(\vdots\) & 0 & \(\vdots\) \\ \(\mathbf{d_{44}}\) & 92 & 490 & 829 &... & 0 \\ \hline \hline \end{tabular}
\end{table} 
Table 2: Travel times (in minutes) between dealerships. \begin{table}
\begin{tabular}{c c c} \hline \hline  & \multicolumn{3}{c}{\(TimeWindow\)} \\ \hline \(Dealership\) & \(e_{i}\) & \(l_{i}\) \\ \hline \(\mathbf{d_{0}}\) & 00:00 & 23:59 \\ \(\mathbf{d_{1}}\) & 06:00 & 13:00 \\ \(\mathbf{d_{2}}\) & 08:00 & 12:00 \\ \(\mathbf{d}\) & \(\vdots\) & \(\vdots\) \\ \(\mathbf{d_{44}}\) & 22:00 & 09:00 \\ \hline \hline \end{tabular}
\end{table} 
Table 3: Time windows for the dealerships in 24-h time format. i.e., the execution of the algorithm at different times of the day with the same data produces different routing outputs and vehicle accommodation. ```
Data:\(M\) (demand), \(K\) (auto-carriers). Output: The \(K\) auto-carriers with \(A_{k}\) arrangement, \(R_{k}\) route and delivery schedules. A vector with the remaining \(M\), if any.