# Multi-Objective Routing and Categorization of Urban Network Segments for Cyclists
## 2 Materials and Methods
### Experiments
#### 2.3.3 Implementation of NSGA-II  
Having the objective functions, their constraints, and the table of links \(N_{\text{i,j,k}}\) with the values of the parameters, our multi-objective optimization problem was solved with the use of the NSGA-II algorithm. The NSGA-II algorithm was implemented in this study because of its efficiency in solving multi-objective problems and generating a diverse Pareto-optimal solution set [41]. While alternative algorithms like R-NSGA-II and particle swarm optimization (PSO) also offer robust optimization capabilities, NSGA-II's elitism and diversity-preserving mechanisms were particularly suited to capture the complexity of the multi-criteria urban cycling network. The implementation was conducted in Python 3 using the pymoo's library [42] on a Windows 11 OS environment, with a 2.6 Ghz, 14 Core processor. The NSGA-II algorithm, being a genetic algorithm, after constructing a list of continuous paths from the start node to the end node, recombines them in each generation (crossovers). However, their construction is subject to randomness in which continuity is not guaranteed. To address this, all the objective functions were assigned random weights (from 0 to 1) and recombinations of the algorithm were performed by changing the weights of each objective function. The idea for this transformation is borrowed from the logic of the A* algorithm. In so doing, the algorithm now finds all the possible combinations of nodes starting from node 1 (origin point) and ending at node 206 (destination) with a dependent link from each node and with continuation.  
In our problem, between two nodes i and j, there are (mostly) at least 2 links \(\text{N}_{\text{i,j,k}}\). To represent this diversity of the problem, for each possible combination of nodes i and j, all possible combinations of links \(\text{N}_{\text{i,j,k}}\) with their particular index k are also constructed. Then, by imposing the function constraints and evaluating the objective functions, sets of viable solutions are constructed for each node sequence. After that, for each set of possible combinations of links \(\text{N}_{\text{i,j,k}}\), each sequence of nodes i and j is sorted to construct the Pareto fronts of each group individually. Finally, the final Pareto front is constructed by sorting all the solutions from the constructed fronts. Because we have nine partially conflicting objectives, the algorithm forms a plethora of paths that all belong to the front. To address this, a restriction is placed on the total route length to tighten further the Pareto front. Specifically, by examining the study area, it is estimated that the two largest possible routes that could belong to the Pareto front pass through the southern sidewalks of Vasilissis Olgas Avenue and from the northern sidewalks of Vasilissis Sophias Avenue. Measuring the total lengths of these routes, the longest route is the one via Vasilissis Sophias Avenue with a total length of 1136.38 m, which is set as the restriction. In this way, the number of solutions that now belong to the Pareto front is reduced to 28. These solutions are finally ranked based on their performance on each objective function.