Application of the Genetic Algorithm at Initial Stages of Ships Design Primjena genetičkog algoritma u početnim etapama nacrta broda

The main tasks for which the genetic algorithm is currently applied in shipbuilding are shown. The possibility of applying the genetic algorithm for determining the optimal characteristics of ships at the initial stages of design is considered. The formulation of the problem of parametric optimization for the initial stages of design is given. The features of such a problem and possible approaches to its solution are considered. Using the example of the problem of parametric optimization of small waterplane area twin hull ships, it is shown that the traditional methods of non-linear programming are not very effective. It is shown that one of the possible options for increasing the efficiency of searching for the optimal solution is the application of genetic algorithms. The mathematical bases of GA are considered and the scheme for finding the optimal solution using this method is described. The examples of test functions show the effectiveness of the genetic algorithm in comparison with traditional optimization methods. The results of solving the problem of parametric optimization of high-speed SWATH passenger ships are presented.


INTRODUCTION / Uvod
In recent years, with the appearance of powerful computing methods new effective methods of optimization were developed.This is a large number of variants of neural network algorithms, evolutionary, genetic algorithms and so forth [1,7,8,17,18,23,26].
Each of these methods has the advantages and disadvantages and is applied depending on features of the considered optimizing problem.
In shipbuilding evolutionary and genetic algorithms are applied to solve various tasks, such as optimization of ship parameters, optimization of ship structure, etc.So, for example, in [15,20,25,27] application of a genetic algorithm for optimization of hull design with the aim to minimize the total weight is described.In paper [14] the genetic algorithm is applied for general arrangement design, in [2,3,5,11,24,29] for optimization of ship parameters, in [4] for characterization of Ro-Ro ships, and in [9,12,16,28] -for ship hull form optimization.
Theoretical bases of these methods applied to shipbuilding are to be found in papers [3,5,21].
Parametrical optimization -the choice of optimum ship characteristics is of great importance for the initial design stages.The best values of design characteristics provide the efficiency of the ship for its entire life cycle.This is especially important for new types of ships for which the design experience is still little.
First of all, such vessels include Small Waterplane Area Twin Hull ships (SWATH ships) One of the features of the problem of optimizing the characteristics of SWATH ships is that the objective function is a complex function of many random variables.For example, the speed of a ship in a voyage depends on the random combination of wind and a wave characteristic, the loading coefficient depends on daily distribution of passenger traffic and the season.In case when the factors determining the properties of the system are random variables or the evaluation of the system depends on the random environment of functioning, randomized criteria are used.At the same time, the criterion itself can be considered as the probability of the vessel realizing its qualities under certain conditions.In addition, the problem due to the specific of the shape of the hull, the non-linearity of the dependences entering the constraints and the objective function is multidimensional and nonlinear.
When solving the problem of optimizing the characteristics of SWATH ships, traditional methods of nonlinear programming are not very effective.One of the possible options for increasing the efficiency of searching for the optimal solution is the application of genetic algorithms.However, the effectiveness of the genetic algorithm for the solution of the stochastic optimization problem with a large number of independent variables and the nonlinear structure of the objective function and constraints is still poorly studied.
Therefore, the purpose of this article is to justify the expediency of using the genetic algorithm to select the optimal characteristics of ships, taking into account the stochastic character of the environmental impact.

Problem Statement / Postavka problema
The choice of the optimal characteristics of the ship, as well as any other design subject, in a general view can be written as follows [2,29,30]: subject to where is an objective function; is a vector of the parameters forming the design task; ( ) 1 ,..., n X x x is vector of the desired characteristics of the ships (the vector of independent variables); m is a number of the C vector parameters; n is a number of independent variables; k is a total number of optimization problem constraints; p is a number of optimization problem constrains in the form of inequalities; R n is n-dimensional Euclidean space.
The considered task belongs to the class of nonlinear programming problems with constraints.
To account for constraints , the authors suggest to use the method of penalty functions.
The main idea of the Penalty Functions method is to convert constrained problems into unconstrained problems by replacing the objective function [6,22,30]: where r l is the penalty coefficient, which value decreases from one stage to another; l is calculating optimization process cycle number; n is the degree, in this research n = 2; ( ) ∑ is penalty for limitations violation (penalty function): Search of the minimum or maximum value of objective function of F l (X, C, r l ) can be carried out by various methods of nonlinear programming depending on features of the considered problem.
For example, if the dimension of search space is large, it is, on the one hand, leads to a sharp increase of the number of calculations of the objective function, on the other handto the increase of time required for a single calculation objective function.As a result, the direct solving of the optimization problem using classical methods of optimization theory is associated with great difficulties and requires huge expenditures of computer time and does not give the optimal solution or is not applicable at all.
To solve such multidimensional (multiparameter) problems firstly we can apply methods of reduction of dimensionality of problems or, secondly, solve the multidimensional problem using special algorithms that work with a lot of variables.
The first approach uses a known mathematical modelling method of decomposition of complex structure that allows you to split the original problem into several problems of smaller complexity requiring simple algorithms.At the same time for searching the global optimum an iterative scheme of consistent solution of individual problems, each of which is solved by using different search methods of nonlinear programming possible solutions (for example, Cyclic Coordinate Descent Method), based on the iterating, or methods using analysis of function relief (different options for gradient methods) [6,22].In order to find a global optimum starting point should be changed, although it does not guarantee its finding.
Having analysed the existing approaches to the solution of complex optimization problems, the authors offer to use the genetic algorithm.
Let us examine in more detail the mathematical basics of the genetic algorithm.

Algorithm Description / Opis algoritma
Genetic Algorithm (GA) is a simple model of evolution in nature, implemented as a computer program.In the genetic algorithm, the analogues of mechanism of genetic inheritance and natural selection are used.
For the first time a similar algorithm was proposed in 1975 by John Holland at the University of Michigan [13].It was named "The reproductive Holland's plan" and was the basis for almost all versions of genetic algorithms.Basic GA terminology represents in simplified form, the terminology of evolutionary biology.
The main differences of GA from traditional methods for searching maximum or minimum of the goal function are following [7,23].
1. Genetic algorithms work with codes, in which a set of parameters that directly depend on the objective function arguments is represented.Moreover, the interpretation of these codes is only before the algorithm starts and after its work for the result.In the process the manipulations with the codes take place regardless their interpretation.The code is considered just as a bit series.
For example: coding real-valued independent variable x i (figure 1) The received value c with is transferred to a binary system, decoding ( ) , b i is lower and upper bounds on the i-th independent variable; s is the number of bits per one element of chromosome (gene); x i is the decoded real value from bit string of lengths; c is the coding representations of x i .; d is the decimal value of the sub-string corresponding to x i 2. To find the optimum the genetic algorithm uses several points simultaneously (population) and does not move from point to point, as it is done in traditional methods.This allows to overcome one of their deficiencies such as the danger of falling into local extrema of the objective function if it is not unimodal, that is it has several such extrema.
3. Genetic algorithm in the process does not use any additional information and that increases the speed.The only information may be the range of parameter and objective function admitted values at an arbitrary point.
4. When searching for the optimum the genetic algorithm only calculates the objective function, not its derivatives or other additional information.
5. The genetic algorithm uses probabilistic rules for the generation of new points of analysis as well as deterministic rules to move from points to points.
The work of genetic algorithm is an iterative process that lasts as long as the criterion for termination of the search is completed.The scheme of finding the optimal value of the objective function in the genetic algorithm includes the following steps [7,23] (Figure 2).
On the first iteration the initial "population" (set of variants of design decisions) is formed.Next, for each "person" (problem solution) the value of the fitness function is calculated.The best "person" is determined by its value.Then GA generates a new "population" using the genetic operators of selection, crossover, mutations and strategy of elitism (if necessary).
The selection of individuals (parents) participating in the formation of descendants is performed using selection operators.There are several options for implementing the selection mechanism: on the basis of roulette (roulettewheel selection), tournament selection, ranking selection and others.Detailed information on each of the selection options is given in works [7,13,23].In this article the authors used tournament selection in which all the populations are divided into subgroups consisting of two individuals.Then in each of these subgroups the individuals with the best fitness are selected.The figure 3 shows a scheme that illustrates the method of tournament selection for subgroups consisting of two individuals.Crossover is used to change the structure of population.This operator carries out the exchange of parts of chromosomes between two (maybe more) chromosomes in the population.Crossover is single-point or multipoint.
The action of the single-point crossover operator is illustrated by the following example (figure 4).
The realization of the operator depends on the class and dimension of the solving problem, but in any case, the probability р с is usually chosen rather large to provide continuous appearance  The mutation operation changes the values of genes in chromosomes with the given probability р т .It leads to inverting the values of the selected genes from 0 to 1 and back.The value of р т , as a rule, is very small, so only a small number of genes are mutated.
Crossover and mutation play a different role.The crossover is usually most effective at the beginning of a search while the mutation allows finding more exact solution at the end of it.The joint use of selection and crossover operators leads to the fact that the areas of space that have the best on average optimality contain more members of the population, than others.Thus, the evolution of the population is directed to the areas containing the optimum with a greater probability than others.
Inversion (inversion operations) is the rotation of the site or the entire chromosome by 180 degrees.Inversion is carried out on a single chromosome.When it is implemented, the sequence of alleles (the last gene changes the position with the first, the penultimate -with the second, etc.) between two randomly chosen positions in the chromosome.The example of inversion is illustrated at figure 5.For the newly formed population the fitness function values for all chromosomes of the current population are calculated.Then the condition for completing the algorithm is checked and either the result in the form of a chromosome with the greatest fitness function value is fixed, or transition to the following step of a genetic algorithm, i.e. to selection is carried out.
The choice of the "best" chromosome.If the condition for terminating the algorithm is satisfied, then from the final population, that individual is chosen that gives the maximum (or minimum) value of the fitness function and is, therefore, the result of the work of the genetic algorithm.
For the new "population" the value of the fitness function is calculated and so on.
The process is repeated as long as one of the stopping criteria is completed.
The criterion to stop the search (stopping criteria) may be: 1.An upper limit on the number of generations is reached.2. Allocated budget of computational time reached.3. When successive GA iterations no longer produce better results 4. A optimal solution is obtained that satisfies the optimization criteria The condition of the population when all rows are in the area of some extremum and are almost the same is called the convergence.Thus, the convergence of the population means that the achieved the solution is close to the optimum.The final solution of the problem may be the most adapted individual of the last generation.
The efficiency of the GA is determined by the choice of parameters of the "genetic" operators (selection, mutation, crossover) as well as a number of other characteristics (population size, the number of generations until the stop and so forth).The indicators of the efficiency of the GA are reliability, speed, number of iterations.Due to the fact that the GA is a stochastic procedure, the assessment of its effectiveness is performed by averaging and multiple runs.

Test the effectiveness of genetic algorithm / Provjera učinkovitosti genetičkog algoritma
To test the effectiveness of genetic algorithm compared to traditional methods of nonlinear programming (for example, Powell method) the authors performed a series of studies on the problems of searching optimum for 20 standard functions with constraints and without constraints [19].These functions have got "uncomfortable" properties in terms of optimization algorithms, such as multiple local extrema, an insignificant difference of objective function values at the points of local extrema and so on.
Characteristics of some of these functions are given in Table 1.
The comparative analysis of the efficiency of genetic algorithm and Powell method was implemented by following criteria: reliability, speed, number of iterations.Some results of this study are presented in Table 2. Reliability is the ratio of runs, in which optimum was found to the total number of test (standard) runs.The rate is the average number of fitness function calculations to the first detected extreme, that is the actual cost of searching.Number of iterations is the average number of calculations of the fitness function to find the maximum or minimum value.
Test results of GA and Powell method showed high reliability and speed of the finding optimum using genetic algorithm for most test functions.
To solve the problem of optimizing of the design SWATH ships characteristics the authors finalized the genetic algorithm in terms of accounting restrictions and adaptation to the solution of design tasks.In particular, for accounting restrictions to use dynamic fine function is suggested: with each generation the values of the fines change.For the first generation they are minimal and they increase with each subsequent generation.

An example of solving the problem of parametrical optimization of a small waterplane area twin hull ships / Primjer rješavanja problema parametrijske optimizacije malih brodova (SWATH)
In this article, the application of a genetic algorithm for determining the optimum characteristics of a small waterplane area twin hull ships is shown.
The problem of optimum parametrical design of a SWATH ships can be formulated as follows [2,30]: 1, 2,..., , 0, 1, 2,..., , where F(x)-an objective function; G i (x) -constrains in the form of inequalities; H j (x) -constrains in the form of equalities; n R -ndimensional vector set; m-number of constrains in the form of inequalities; k-number of constrains in the form of equalities ; x-vector of independent variables (ships characteristics, subject to optimize).
As the objective function for searching optimal characteristics of the ships the following criterion is proposed:    The problem of determining the optimal characteristics of small waterplane area twin hull ships has nonlinear and stochastic character and has a number of features related to the specific design of ships of this type [2,10,29,30].It has characteristics that greatly complicate its solution.They are the following: a large number of independent variables, algorithmically given objective function that is a complex nonlinear function of many random variables, the presence of restrictions in the form of equalities and inequalities.
Therefore, the genetic algorithm has been applied to the solution of a multidimensional problem of parametrical design of SWATH ships.
The SWATH mathematical model and the sequence of calculation of main characteristics of SWATH ships are described in detail by the authors in works [2].
The implementation of genetic algorithm developed by the authors as a software system to optimize the performance of passenger SWATH ships is shown in Figure 6.In the present software window the process of finding the optimal objective function value, the change of the independent variables values and the degree of the execution of restrictions are shown.
In the result of the optimization program the basic characteristics of passenger SWATH ships were received.The results are displayed in a user-friendly form, grouped according to the type of characteristics: main dimensions, hydrostatics, weight, resistance and power of the main engines, large angle stability, building cost, economic indicators and parameters of the fin.
The tab "Main dimensions" contains the value of the dimensions of the hull ship as a whole, as well as its structural elements: lower hulls, struts, box (platforms).The tab "Hydrostatics" shows the following characteristics: the volume displacement of

Figure 4
Figure 4 The action of the single-point crossing operator Slika 4. Djelovanje prijelaznoga operatora

C
where E[I e ] -expected value for an indicator of economic efficiency; P -probability of mission success; I e -indicator of economic efficiency of the ship.As a measure of economic efficiency the Net Present Value (NPV) was used: is initial investment; t C is annual net cashflow; T - lifetime of ship in years; d -discount rate of return.

Table 2
Test results of genetic algorithm and Powell method for standard functions Tablica 2. Rezultati testa genetičkog algoritma i Powell metoda za standardne funkcije