# iRoute--An Adaptive Route Planning Solution for Commercial Vehicle Fleets
## Appendix A Pseudocode of the Adaptive Algorithm for Route Planning Using Historical Tracks  
currentOptimalRoute = get_current_optimal_route();  
relevantHistoricalRoutes[] = get_relevant_historical_list_routes(currentOptimizalRoute);  
function historical_adapted_optimal_route0 do  
for i \(<=\) 0, currentOptimalRoute.visits do  
optimalPath = optimizedTrack(i,i + 1);  
//get the initial optimized track if (check_historical_data(optimzedRoute.visit[i], optimzedRoute.visit[i + 1]) ) do //check if we have sufficient (N >=10 tracks) historical data trails between the two visits  
if (historicalPath = calculate_common_historical_path (currentOptimalRoute.visit[i], currentOptimalRoute.visit[i + 1])) do  
//calculate the common historical path and check that the majority of the historical paths contain it  
if (shapeSimilarity(optimalPath, historicalPath) < 0.8) do  
//shapeSimilarity is an external function from curve matcher of [PERSON]  
Github repository)  
currentOptimalRoute.path[i,i + 1] = historicalPath;  
//overwrite the current optimized route path with the historicalRoute  
end for i  
**end function**  
**function calculate_common_historical_path(index1, index2)** do  
maxSimilarHistoricalPaths = 0; bestCommonHistoricalPath = 0; for i <= 0, relevantHistoricalRoutes [],size do  
for j <= i + 1, relevantHistoricalRoutes [],size do  
numberSimilarPaths = 0; historicalPathSimilarity[i,j] = shapeSimilarity(relevantHistoricalRoutes[i].path(index1, index2), relevantHistoricalRoutes [j].path(index1, index2); //save the similarity ratio for the two paths in a matrix;  
if (historicalPathSimilarity[i,j])  
numberSimilarPaths ++; end for j  
if (maxSimilarHistoricalPaths < numberSimilarPaths) do  
maxSimilarHistoricalPaths = numberSimilarPaths  
bestCommonHistoricalPath = i; end if  
end for i;  
if (maxSimilarHistoricalPaths >= relevantHistoricalRoutes[].size/2)  
return relevantHistoricalRoutes [bestCommonHistoricalPath].path(index1,index2); else  
return null;//no common historical path was found for the current segment  
**end function**  
**Appendix B. Quantitative Survey**  
Method of completion: Online  
Respondents: 68  
**Description:**  
This is a survey for a research and development project targeted to find the interest of the business for an adapted route planning solution for commercial vehicle fleets. Your answers are anonymized and will be used only in statistical reports, without any references to your set of answers. By continuing to complete this survey you agree that you understand the terms previously described and consent to use the results of the survey in the research work of the project such as scientific articles, dissemination materials, project website information, or any other documented related work. Thank you for your feedback! iRoute team  
**Appendix note:**  
We will show 2 random answers--respondent 16 and respondent 50, to better illustrate the received feedback. **Questions:**  
1. Where are you from? * Romania  
* Slovenia  
* Other  
_Answer R16:_ Romania  
_Answer R50:_ Slovenia  
2. Do you use a software solution for planning and monitoring the execution of your fleet routes? * Yes  
* No  
_If Yes, go to question 3. If No, go to question 8._  
_Answer R16: Yes_  
_Answer R50: Yes_  
3. How often do you visit most of your customers? * Daily  
* Weekly  
* Monthly  
* Once every 3 months  
* Once every 6 months  
* Once every year  
* Once (one-time customers)  
_Answer R16:_ Weekly  
_Answer R50:_ Monthly  
4. Do your drivers use a mobile application to get details about the route he/she needs to execute? * Yes  
* No  
_Answer R16:_ Yes  
_Answer R50:_ No  
5. What average difference in terms of distance or duration do you get between planned routes and executed routes? they are almost the same  
* \(\pm\)5-10%* I don't know
* \(\pm\)10-20%
* \(\pm\)20-30%
* more than 30%  
_Answer R16:_ \(\pm\)10-20%  
_Answer R50:_ I don't know  
6 What are the reasons for getting differences between planned and execution?