## 3 Materials and Methods
### Optimization Methods and Methodology  
Optimal network load can be achieved in different ways. In the case of a transition to electric propulsion, each of the solutions proposed below would probably be used to a greater or lesser extent depending on the specifics of a particular ferry line:  
* Change of navigational schedule,
* The introduction of additional vessels on certain lines;
* Installation of diesel generators;
* Application of a battery ESS on the shore;
* Construction of electric energy charging stations on island piers;
* Charging optimization. By changing the navigational schedule, the ship's available time for battery charging can be optimized. However, the sailing schedule is designed to meet the needs of the island's population first and foremost. Furthermore, the sailing schedule considers the availability of ships, the workload of the crew, and the possibility of docking ships in the City Port of Split. By introducing additional ships that maintain certain lines, it is possible to charge one ship while another sail maintains the line. Consequently, this represents additional investment and operating costs. By installing diesel generators, it is possible to charge the ship's battery ESS when the ship is not available for charging from shore. However, the use of diesel generators ultimately has a negative impact on the environment, which is exactly what should be avoided by electrifying ferries. If the infrastructure on shore does not meet the energy needs of ship charging stations, electricity storage facilities on land are used. If the needs are of low intensity, the shore ESS is charged. When the ship is connected to the charging station, energy is used from the shore connection as well as from the shore ESS. At right, most of the fleet of ships are stationed at the island's docks. The shore energy infrastructure of the City Port of Split can be alleviated in such a way that the ship's ESS is charged at night while they are docked on the islands. Considering the limitations in the capacity of the electrical infrastructure on the islands, this model is difficult to implement. The scientific research is divided into three phases: the restriction stage, the problem formulation stage, and finally, the optimization stage. Due to legal restrictions caused by the negative impact on the environment, a transition to RES is necessary. In accordance with the availability of a certain type of RES, the most suitable solution is selected. After choosing the electrification of ferries, it is necessary to analyze the energy needs of the fleet of ships and create a daily energy profile. After that, the creation of a model is approached. In this way, the transition to RES is achieved with the aim of fulfilling legal regulations and reducing emissions on the environment. The most important part of the presented methodology is the creation of an optimization model based on PSO and a greedy algorithm. A greedy algorithm was introduced to narrow the search area when it comes to a situation where there is a ferry with dominant charging needs, as shown in Figure 7. In an imaginary multidimensional space, using a greedy algorithm, the search area is narrowed down to a specific area (rectangle shaded blue in the figure). In this way, the required number of search particles is reduced, as well as the number of iterations required to reach the global optimum solution. Search particles vectors are displayed as black arrows defined by speed and direction of movement. The description of the programming code is presented in the following paragraph, as shown in Figure 8. When generating the initial population, three classes of units were used: an individual generated by a greedy algorithm, a special individual generated by the initial schedule, and individuals generated by Poisson distribution. Figure 7: Applying a greedy algorithm with the aim of reducing searched space. The specific steps in the process of population initialization are as follows:  
1. Creating initial solution particles using a greedy algorithm;
2.