{"id":1719,"date":"2025-10-21T11:35:00","date_gmt":"2025-10-21T09:35:00","guid":{"rendered":"https:\/\/xeddixx.cluster029.hosting.ovh.net\/?page_id=1719"},"modified":"2025-10-26T18:08:01","modified_gmt":"2025-10-26T17:08:01","slug":"2d-ga","status":"publish","type":"page","link":"https:\/\/www.francq.info\/index.php\/2d-ga\/","title":{"rendered":"2D Genetic Algorithms"},"content":{"rendered":"\n<h4 class=\"wp-block-heading has-text-align-center\">Abstract<\/h4>\n\n\n\n<p class=\"wp-block-paragraph\">The 2D Genetic Algorithms (2DGA) are a kind of\u00a0<a href=\"\/index.php\/ga\" rel=\"nofollow\">Genetic Algorithms (GA)<\/a>\u00a0applicable to solve\u00a0<a href=\"\/index.php\/placement-problems\" rel=\"nofollow\">placement problems<\/a>.<\/p>\n\n\n\n<h5 class=\"wp-block-heading\" id=\"contents\">Table of Contents<\/h5>\n\n\n\n<p class=\"refsec1 wp-block-paragraph\"><a href=\"#sec1\" rel=\"nofollow\">1. Definition<\/a><\/p>\n\n\n\n<p class=\"refsec1 wp-block-paragraph\"><a href=\"#sec2\" rel=\"nofollow\">2. Encoding<\/a><\/p>\n\n\n\n<p class=\"refsec1 wp-block-paragraph\"><a href=\"#sec3\" rel=\"nofollow\">3. Evaluation<\/a><\/p>\n\n\n\n<p class=\"refsec1 wp-block-paragraph\"><a href=\"#sec4\" rel=\"nofollow\">4. Heuristics<\/a><\/p>\n\n\n\n<p class=\"refsec2 wp-block-paragraph\"><a href=\"#sec4_1\" rel=\"nofollow\">4.1. Select Object to Place<\/a><\/p>\n\n\n\n<p class=\"refsec2 wp-block-paragraph\"><a href=\"#sec4_2\" rel=\"nofollow\">4.2. Local Optimization<\/a><\/p>\n\n\n\n<p class=\"refsec2 wp-block-paragraph\"><a href=\"#sec4_3\" rel=\"nofollow\">4.3. Bottom-Left Heuristic<\/a><\/p>\n\n\n\n<p class=\"refsec2 wp-block-paragraph\"><a href=\"#sec4_4\" rel=\"nofollow\">4.4. Edge Heuristic<\/a><\/p>\n\n\n\n<p class=\"refsec2 wp-block-paragraph\"><a href=\"#sec4_5\" rel=\"nofollow\">4.5. The Center Heuristic<\/a><\/p>\n\n\n\n<p class=\"refsec2 wp-block-paragraph\"><a href=\"#sec4_6\" rel=\"nofollow\">4.6. Free Space Problem<\/a><\/p>\n\n\n\n<p class=\"refsec1 wp-block-paragraph\"><a href=\"#sec5\" rel=\"nofollow\">5. Initialization<\/a><\/p>\n\n\n\n<p class=\"refsec1 wp-block-paragraph\"><a href=\"#sec6\" rel=\"nofollow\">6. Crossover<\/a><\/p>\n\n\n\n<p class=\"refsec2 wp-block-paragraph\"><a href=\"#sec6_1\" rel=\"nofollow\">6.1. Object Selection<\/a><\/p>\n\n\n\n<p class=\"refsec2 wp-block-paragraph\"><a href=\"#sec6_2\" rel=\"nofollow\">6.2. Child Construction<\/a><\/p>\n\n\n\n<p class=\"refsec1 wp-block-paragraph\"><a href=\"#sec7\" rel=\"nofollow\">7. Mutation<\/a><\/p>\n\n\n\n<p class=\"refsec1 wp-block-paragraph\"><a href=\"#sec8\" rel=\"nofollow\">8. Inversion<\/a><\/p>\n\n\n\n<p class=\"refsec1 wp-block-paragraph\"><a href=\"#sec9\" rel=\"nofollow\">9. Validation<\/a><\/p>\n\n\n\n<p class=\"refsec1 wp-block-paragraph\"><a href=\"#references\" rel=\"nofollow\">References<\/a><\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><a href=\"#notes\" rel=\"nofollow\">Notes<\/a><\/p>\n\n\n\n<h5 class=\"wp-block-heading\" id=\"sec1\">1. Definition<a href=\"#contents\" rel=\"nofollow\">\u2191<\/a><\/h5>\n\n\n\n<p class=\"wp-block-paragraph\">The 2D Genetic Algorithms (2D-GA) were developed to solve placement problems. In fact, 2D-GA are a genetic framework for placement problems, i.e. each particular problem needs its own customization. As the name suggests, 2D-GA are an extension of the conventional\u00a0Genetic Algorithms.<\/p>\n\n\n\n<h5 class=\"wp-block-heading\" id=\"sec2\">2. Encoding<a href=\"#contents\" rel=\"nofollow\">\u2191<\/a><\/h5>\n\n\n\n<p class=\"wp-block-paragraph\">Remember that for the\u00a0<a href=\"\/index.php\/placement-Problems\" rel=\"nofollow\">placement problems<\/a>, each object may have multiple valid orientations. The solution consists of a position for each object with a given valid orientation. Figure 1\u00a0proposes two solutions,\u00a0<mathml>\\(C_1\\)<\/mathml>\u00a0and\u00a0\\(C_2\\)\u00a0for a placement problem.<\/p>\n\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"297\" height=\"126\" src=\"http:\/\/xeddixx.cluster029.hosting.ovh.net\/wp-content\/uploads\/2025\/10\/2dencoding.png\" alt=\"\" class=\"wp-image-1723\"\/><\/figure>\n<\/div>\n\n\n<p class=\"has-text-align-center wp-block-paragraph\">Figure 1. Two solutions for a placement problem.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">In the 2D-GA, the chromosomes store for the different object of a solution their position and the particular orientation used for the placement. Figure\u00a01\u00a0shows two examples for which the corresponding chromosomes are:<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">\\[C_{1}={(0,0,Normal),(10,0,Normal),(20,0,Normal),(0,10,Normal)(10,10,Normal)}\\]\n\n\n\n<p class=\"wp-block-paragraph\">\\[C_{2}={(10,0,Normal),(10,10,Normal),(0,20,Normal),(20,20,Normal)(0,0,Rota90)}\\]\n\n\n\n<h5 class=\"wp-block-heading\" id=\"sec3\">3. Evaluation<a href=\"#contents\" rel=\"nofollow\">\u2191<\/a><\/h5>\n\n\n\n<p class=\"wp-block-paragraph\">A genetic algorithm needs to evaluate the chromosomes of a population. For the 2D-GA, the performance of a particular chromosome (placement) is determined by two criteria that are difficult to compare:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong>Area\u00a0Criterion.<\/strong> The total area occupied by the elements.<\/li>\n\n\n\n<li><strong>Distance\u00a0criterion.<\/strong> The sum of the nets distances.<\/li>\n<\/ul>\n\n\n\n<p class=\"wp-block-paragraph\">The evaluation of a given placement is thus a multi-criteria problem, and we decide to use the\u00a0<a href=\"\/index.php\/ga#sec11\" rel=\"nofollow\">multiple objective approach<\/a>\u00a0based on the\u00a0<a href=\"\/index.php\/promethee\" rel=\"nofollow\">PROMETHEE method<\/a>. Actually, the two criteria have the same characteristics and are both to be minimized:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>a weight of 1;<\/li>\n\n\n\n<li>a preference\u2019s threshold of 0.2;<\/li>\n\n\n\n<li>an indifference\u2019s threshold of 0.05;<\/li>\n<\/ul>\n\n\n\n<p class=\"wp-block-paragraph\">It is possible to change the values of the PROMETHEE parameters for a specific problem<sup data-fn=\"0de2fa1a-be91-4e11-8e7a-5e220d6ddd21\" class=\"fn\"><a href=\"#0de2fa1a-be91-4e11-8e7a-5e220d6ddd21\" id=\"0de2fa1a-be91-4e11-8e7a-5e220d6ddd21-link\">1<\/a><\/sup>.<\/p>\n\n\n\n<h5 class=\"wp-block-heading\" id=\"sec4\">4. Heuristics<a href=\"#contents\" rel=\"nofollow\">\u2191<\/a><\/h5>\n\n\n\n<p class=\"wp-block-paragraph\">Because GA are meta-heuristic, heuristics are central in the 2D-GA. Three different heuristics were developed based on a same generic approach described by Algorithm\u00a0<a href=\"file:\/\/\/Users\/pfrancq\/POI\/www\/wikics2\/2D_Genetic_Algorithm.html#alg:Generic-placement-heuristic.\">1<\/a>.<\/p>\n\n\n\n<p class=\"has-text-align-left algo wp-block-paragraph\">Require:<\/p>\n\n\n\n<p class=\"has-text-align-left algo2 wp-block-paragraph\">  Objects to place,\u00a0\\(O\\)<\/p>\n\n\n\n<p class=\"algoempty wp-block-paragraph\"><\/p>\n\n\n\n<p class=\"has-text-align-left algo wp-block-paragraph\">Build a random array of not placed objects,\u00a0\\(O\\)<\/p>\n\n\n\n<p class=\"has-text-align-left algo wp-block-paragraph\">while (\\(\u2203o_i\u2208O\\)):<\/p>\n\n\n\n<p class=\"algo2 wp-block-paragraph\">\\(o_i\u2190MostConnected(O)\\)<\/p>\n\n\n\n<p class=\"algo2 wp-block-paragraph\">\\((x,y)\u2190IsFreeSpace(o_i)\\)<\/p>\n\n\n\n<p class=\"algo2 wp-block-paragraph\">if\u00a0\\((x,y)\\) are not valid:<\/p>\n\n\n\n<p class=\"has-text-align-left algo3 wp-block-paragraph\">\\((x,y)\u2190PlaceRect(oi)LocalOptimization(o_i)\\)<\/p>\n\n\n\n<p class=\"has-text-align-left algo2 wp-block-paragraph\">\\(UpdateFreeSpace()\\)<\/p>\n\n\n\n<p class=\"has-text-align-center wp-block-paragraph\">Algorithm 1. Generic placement heuristic.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">For all the objects to place, the heuristic selects iteratively the most connected one (section\u00a0<a href=\"#sec4_1\" rel=\"nofollow\">4.1<\/a>) and look if an existing free space can hold it. If no, a method place the object, and a local optimization is performed (section\u00a0<a href=\"#sec4_2\" rel=\"nofollow\">4.2<\/a>). Finally, the free spaces are updated. Sections\u00a0<a href=\"#sec4_3\" rel=\"nofollow\">4.3<\/a>,\u00a0<a href=\"#sec4_4\" rel=\"nofollow\">4.4<\/a>\u00a0and\u00a0<a href=\"#sec4_5\" rel=\"nofollow\">4.5<\/a>\u00a0presents three strategies to place an object. Section\u00a0<a href=\"#sec4_6\" rel=\"nofollow\">4.6<\/a>\u00a0explains the free space problem.<\/p>\n\n\n\n<h6 class=\"wp-block-heading\" id=\"sec4_1\">4.1. Select Object to Place<a href=\"#contents\" rel=\"nofollow\">\u2191<\/a><\/h6>\n\n\n\n<p class=\"wp-block-paragraph\">When choosing a object to place, each heuristic parses the random array of object\u00a0\\(O\\). For each object, the heuristic computes the sum of the weights of the connections involving it and which are composed from at least one already placed object.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">This method ensures that the most connected objects are placed first, while the randomization of the array of objects to place should provide diversity in the population.<\/p>\n\n\n\n<h6 class=\"wp-block-heading\" id=\"sec4_2\">4.2. Local Optimization<a href=\"#contents\" rel=\"nofollow\">\u2191<\/a><\/h6>\n\n\n\n<p class=\"wp-block-paragraph\">To increase the speed of the implemented heuristics, the objects are first considered as rectangles (the bounding rectangles of the corresponding polygons). Once the rectangle is placed, the position must be adapted by transforming it into the original polygon. This is the role of the local optimization. Figure 2 shows two examples, where the object\u00a0\\(2\\)\u00a0is first placed as a rectangle.<\/p>\n\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"405\" height=\"306\" src=\"http:\/\/xeddixx.cluster029.hosting.ovh.net\/wp-content\/uploads\/2025\/10\/2dheuropti.png\" alt=\"\" class=\"wp-image-1770\" srcset=\"https:\/\/www.francq.info\/wp-content\/uploads\/2025\/10\/2dheuropti.png 405w, https:\/\/www.francq.info\/wp-content\/uploads\/2025\/10\/2dheuropti-300x227.png 300w\" sizes=\"auto, (max-width: 405px) 100vw, 405px\" \/><\/figure>\n<\/div>\n\n\n<p class=\"has-text-align-center wp-block-paragraph\">Figure 2. The local optimization.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">In the first example (a), the object must be placed as close as possible from the \u201cbottom-left\u201d corner, while in the second example (b), it must be placed as close as possible from the point represented by the intersection of the dashed lines.<\/p>\n\n\n\n<h6 class=\"wp-block-heading\" id=\"sec4_3\">4.3. Bottom-Left Heuristic<a href=\"#contents\" rel=\"nofollow\">\u2191<\/a><\/h6>\n\n\n\n<p class=\"wp-block-paragraph\">The bottom-left heuristic is a very simple method. The basic principle is to place the first object in the bottom-left corner. The next objects are placed next to it at the right until the horizontal limit is exceeded. After that, the heuristic creates a \u201cnew line\u201d, i.e. starts for the next objects again from the left limit and at a given height determined by the highest object already placed. Figure\u00a03\u00a0shows an example of this heuristic (the numbers indicate the order in which the objects were placed).<\/p>\n\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"576\" height=\"252\" src=\"http:\/\/xeddixx.cluster029.hosting.ovh.net\/wp-content\/uploads\/2025\/10\/2dbottomleft.png\" alt=\"\" class=\"wp-image-1771\" srcset=\"https:\/\/www.francq.info\/wp-content\/uploads\/2025\/10\/2dbottomleft.png 576w, https:\/\/www.francq.info\/wp-content\/uploads\/2025\/10\/2dbottomleft-300x131.png 300w\" sizes=\"auto, (max-width: 576px) 100vw, 576px\" \/><\/figure>\n<\/div>\n\n\n<p class=\"has-text-align-center wp-block-paragraph\">Figure 3. The bottom-left heuristic.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">While this heuristic is very simple, efficient and fast, it has a big drawback: the bounding rectangle will have a length close to the one of the horizontal limit, but the height can be much smaller than the vertical limit. For some problems where the resulting rectangle has to be \u201cbalanced\u201d, this heuristic does not provide good results. Another problem is that two consecutively placed objects, which are connected together, are not necessary place close from each other (objects\u00a0\\(7\\)\u00a0and\u00a0\\(8\\)\u00a0of Figure\u00a03), this is also a disadvantage for the \u201cdistance\u201d criterion.<\/p>\n\n\n\n<h6 class=\"wp-block-heading\" id=\"sec4_4\">4.4. Edge Heuristic<a href=\"#contents\" rel=\"nofollow\">\u2191<\/a><\/h6>\n\n\n\n<p class=\"wp-block-paragraph\">The edge heuristic is derived from the bottom-left, with the aim to obtain a bounding rectangle whose dimensions are proportional to the limits of the problem. The first object is also put in the bottom-left corner, but for the second object, the heuristic determines two different positions: at the right of the first object or above it. For these positions, the heuristic computes the rate\u00a0heightlength\u00a0to determine the position which gives the closest rate to the corresponding one of the limiting height and length. The next objects are treated in the same way. Figure\u00a04 shows an example of this heuristic (the numbers indicate the order in which the objects were placed).<\/p>\n\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"576\" height=\"252\" src=\"http:\/\/xeddixx.cluster029.hosting.ovh.net\/wp-content\/uploads\/2025\/10\/2dedge.png\" alt=\"\" class=\"wp-image-1772\" srcset=\"https:\/\/www.francq.info\/wp-content\/uploads\/2025\/10\/2dedge.png 576w, https:\/\/www.francq.info\/wp-content\/uploads\/2025\/10\/2dedge-300x131.png 300w\" sizes=\"auto, (max-width: 576px) 100vw, 576px\" \/><\/figure>\n<\/div>\n\n\n<p class=\"has-text-align-center wp-block-paragraph\">Figure 4. The edge heuristic.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">With this heuristic, the problem of the bounding rectangle of the bottom-left heuristic is solved. The price to pay is that the total area of the bounding rectangle is larger than the one obtain with the bottom-left heuristic. It works a little bit slower than the bottom-left heuristic. It also has the same problem than the bottom-left heuristic one in regards of the \u201cdistance\u201d criterion, because again two consecutive objects can be placed far from each other.<\/p>\n\n\n\n<h6 class=\"wp-block-heading\" id=\"sec4_5\">4.5. The Center Heuristic<a href=\"#contents\" rel=\"nofollow\">\u2191<\/a><\/h6>\n\n\n\n<p class=\"wp-block-paragraph\">To avoid the problem of the \u201cdistance\u201d criterion, the center heuristic was developed. The idea is to place the objects as close as possible from the center. Of course, when the number of objects already placed increases, the number of possible positions for the next object also increases. The result is that this method is really slower than the other two. Figure\u00a05\u00a0shows an example of this approach (the numbers indicate the order in which the objects were placed).<\/p>\n\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"576\" height=\"252\" src=\"http:\/\/xeddixx.cluster029.hosting.ovh.net\/wp-content\/uploads\/2025\/10\/2dcenter.png\" alt=\"\" class=\"wp-image-1773\" srcset=\"https:\/\/www.francq.info\/wp-content\/uploads\/2025\/10\/2dcenter.png 576w, https:\/\/www.francq.info\/wp-content\/uploads\/2025\/10\/2dcenter-300x131.png 300w\" sizes=\"auto, (max-width: 576px) 100vw, 576px\" \/><\/figure>\n<\/div>\n\n\n<p class=\"has-text-align-center wp-block-paragraph\">Figure 5. The center heuristic.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">This heuristic gives the best results in terms of \u201cdistance\u201d criterion while it still give performing solutions in terms of \u201carea\u201d criterion.<\/p>\n\n\n\n<h6 class=\"wp-block-heading\" id=\"sec4_6\">4.6. Free Space Problem<a href=\"#contents\" rel=\"nofollow\">\u2191<\/a><\/h6>\n\n\n\n<p class=\"wp-block-paragraph\">One of the problem which appears when placing objects, in particular if they are polygons, is the formation of \u201cfree spaces\u201d, i.e. regions without objects completely enclosed by objects and that could not be used directly by the heuristics. Figure\u00a06 shows an example (the numbers represent again the order in which the objects were placed).<\/p>\n\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"162\" height=\"126\" src=\"http:\/\/xeddixx.cluster029.hosting.ovh.net\/wp-content\/uploads\/2025\/10\/2dspaces.png\" alt=\"\" class=\"wp-image-1774\"\/><\/figure>\n<\/div>\n\n\n<p class=\"has-text-align-center wp-block-paragraph\">Figure 6. The free space problem.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">When the object\u00a0\\(4\\)\u00a0is placed, it automatically creates a \u201cfree space\u201d, a region colored in gray. It is also evident that the object\u00a0\\(5\\)\u00a0can be placed in this \u201cfree space\u201d. This is why a method was developed to compute the polygons corresponding to these \u201cfree spaces\u201d after each positioning. Before the algorithm determines possible positions according the heuristic strategy, it looks whether there is a \u201cfree space\u201d that can hold this element.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">The problem of finding a good \u201cfree space\u201d for a given element is close to the \u201cdynamic storage allocation\u201d problem. When a program is asking for a given quantity of memory, the operating system must choose between the free regions in RAM, which one to be used for the given bloc, in order to limit the fragmentation of the memory (Figure 7).\u00a0<\/p>\n\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"288\" height=\"234\" src=\"http:\/\/xeddixx.cluster029.hosting.ovh.net\/wp-content\/uploads\/2025\/10\/2dmemprob.png\" alt=\"\" class=\"wp-image-1775\"\/><\/figure>\n<\/div>\n\n\n<p class=\"has-text-align-center wp-block-paragraph\">Figure 7. The dynamic storage allocation.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">There are several algorithms to solve this problem\u00a0[<a href=\"#1\" rel=\"nofollow\">1<\/a>]:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong>First-fit.<\/strong> The first region that can hold the bloc is chosen (bloc\u00a0\\(M\\)\u00a0in bloc\u00a0\\(1\\)).<\/li>\n\n\n\n<li><strong>Best-fit.<\/strong> The smallest region than can hold the bloc is chosen (bloc\u00a0\\(M\\)\u00a0in bloc\u00a0\\(3\\)).<\/li>\n\n\n\n<li><strong>Worst-fit.<\/strong> The largest region than can hold the bloc is chosen (bloc\u00a0\\(M\\)\u00a0in bloc\u00a0\\(2\\)).<\/li>\n<\/ul>\n\n\n\n<p class=\"wp-block-paragraph\">These methods were compared, in particular in\u00a0[<a href=\"#2\" rel=\"nofollow\">2<\/a>]\u00a0and\u00a0[<a href=\"#3\" rel=\"nofollow\">3<\/a>], where it was demonstrated that the first-fit and best-fit strategies are better than the worst-fit. For many years, the best-fit was applied because it preserves the larger free regions for future demands of big quantities of memory. On the other hand, it increases the number of very few regions that will never hold a bloc. In fact, the first-fit and best-fit strategies give, in terms of memory fragmentation, the same kind of quality. That is the reason why, the first-fit is used because it is faster than the best-fit where all the free region have to be controlled.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">In the case of the \u201cfree spaces\u201d treatment, a first-fit strategy was implemented: the first \u201cfree space\u201d that can hold a given element is chosen.<\/p>\n\n\n\n<h5 class=\"wp-block-heading\" id=\"sec5\">5. Initialization<a href=\"#contents\" rel=\"nofollow\">\u2191<\/a><\/h5>\n\n\n\n<p class=\"wp-block-paragraph\">Once the coding has been defined, the 2D-GA must initialize the population. The method used depends on the particular problem because the different solutions must satisfy the hard constraints. In practice, a heuristic should be defined to place a given set of objects.<\/p>\n\n\n\n<h5 class=\"wp-block-heading\" id=\"sec6\">6. Crossover<a href=\"#contents\" rel=\"nofollow\">\u2191<\/a><\/h5>\n\n\n\n<p class=\"wp-block-paragraph\">The role of the crossover is to construct a new solution called a child by taking \u201cgood\u201d portions of two solutions called the parents. In the case of placement problems, an intuitive crossover is to select a portion of the placement of both parents as the basis to construct the children.<\/p>\n\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"459\" height=\"315\" src=\"http:\/\/xeddixx.cluster029.hosting.ovh.net\/wp-content\/uploads\/2025\/10\/2dcross.png\" alt=\"\" class=\"wp-image-1776\" srcset=\"https:\/\/www.francq.info\/wp-content\/uploads\/2025\/10\/2dcross.png 459w, https:\/\/www.francq.info\/wp-content\/uploads\/2025\/10\/2dcross-300x206.png 300w\" sizes=\"auto, (max-width: 459px) 100vw, 459px\" \/><\/figure>\n<\/div>\n\n\n<p class=\"has-text-align-center wp-block-paragraph\">Figure 8. The crossover operator for the 2D-GA.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">An example is showed at Figure\u00a08. From each parent, a set of objects are chosen (filled in gray on the figure), one child is further constructed by using these sets.<\/p>\n\n\n\n<h6 class=\"wp-block-heading\" id=\"sec6_1\">6.1. Object Selection<a href=\"#contents\" rel=\"nofollow\">\u2191<\/a><\/h6>\n\n\n\n<p class=\"wp-block-paragraph\">The crossover depends of course of the choice of the objects to be inherited from the parents. A good set of objects is characterized by two criteria:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>the selected objects must be placed close together;<\/li>\n\n\n\n<li>the selected objects must be \u201dwell connected\u201d.<\/li>\n<\/ul>\n\n\n\n<p class=\"wp-block-paragraph\">The selector first classify all the objects by \u201cwell connected\u201d. To define a \u201cwell connected\u201d object, we reach two criteria:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong>Weight\u00a0Criterion.<\/strong> The sum of the weights of the nets involving the object.<\/li>\n\n\n\n<li><strong>Distance\u00a0Criterion.<\/strong> The sum of the net\u2019s distances involving the object.<\/li>\n<\/ul>\n\n\n\n<p class=\"wp-block-paragraph\">This is a multi-criteria problem, and the\u00a0<a href=\"\/index.php\/promothee\" rel=\"nofollow\">PROMETHEE method<\/a>\u00a0is used to solve it. The two criteria have the same characteristics:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>a weight of 1;<\/li>\n\n\n\n<li>a preference\u2019s threshold of 0.2;<\/li>\n\n\n\n<li>an indifference\u2019s threshold of 0.05;<\/li>\n<\/ul>\n\n\n\n<p class=\"wp-block-paragraph\">Of course, the \u201cweight criterion\u201d has to be maximized and the \u201cdistance criterion\u201d has to be minimized<sup data-fn=\"864f1200-9de0-4a9a-8b49-fda4144f88bf\" class=\"fn\"><a href=\"#864f1200-9de0-4a9a-8b49-fda4144f88bf\" id=\"864f1200-9de0-4a9a-8b49-fda4144f88bf-link\">2<\/a><\/sup>.\u00a0<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">The selector chooses the \u201cbest connected\u201d object not already selected\u200a<sup data-fn=\"d45bd830-264e-49bf-98cd-566a97c0a185\" class=\"fn\"><a href=\"#d45bd830-264e-49bf-98cd-566a97c0a185\" id=\"d45bd830-264e-49bf-98cd-566a97c0a185-link\">2<\/a><\/sup>. After that, the selector looks which is the second \u201cbest connected\u201d object not already selected so that the two objects can be contained in the \u201cchoice rectangle\u201d whose size is the quarter of the total occupied space by all the objects. The set of selected objects is filled with these two objects, and all the other objects that are inside the \u201cchoice rectangle\u201d.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">An example is showed at Figure\u00a09, where object\u00a0\\(1\\)\u00a0is the \u201cbest connected\u201d and object\u00a0\\(2\\)\u00a0is the second \u201cbest connected\u201d, and the \u201cchoice rectangle\u201d is drawn as dashed. The selected objects are those in gray.<\/p>\n\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"270\" height=\"135\" src=\"http:\/\/xeddixx.cluster029.hosting.ovh.net\/wp-content\/uploads\/2025\/10\/2dcrosselect.png\" alt=\"\" class=\"wp-image-1778\"\/><\/figure>\n<\/div>\n\n\n<p class=\"has-text-align-center wp-block-paragraph\">Figure 9. The object selection.<\/p>\n\n\n\n<h6 class=\"wp-block-heading\" id=\"sec6_2\">6.2. Child Construction<a href=\"#contents\" rel=\"nofollow\">\u2191<\/a><\/h6>\n\n\n\n<p class=\"wp-block-paragraph\">To construct a child, the operator considers that the sets of objects of the two parents are a sort of super blocs that can be treated by the heuristics as single objects. Then a heuristic is used to place these two objects and all the others that are not selected in one of the parent sets.\u00a0<\/p>\n\n\n\n<h5 class=\"wp-block-heading\" id=\"sec7\">7. Mutation<a href=\"#contents\" rel=\"nofollow\">\u2191<\/a><\/h5>\n\n\n\n<p class=\"wp-block-paragraph\">The strategy of the mutation currently implemented is to create a totally new chromosome by using a heuristics.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Of course, this strategy limits the advantages of the way the mutation choose the chromosomes, that is the reason why developing a new mutation strategy will be one of the priorities in the future developments.<\/p>\n\n\n\n<h5 class=\"wp-block-heading\" id=\"sec8\">8. Inversion<a href=\"#contents\" rel=\"nofollow\">\u2191<\/a><\/h5>\n\n\n\n<p class=\"wp-block-paragraph\">The inversion, whose role consists in presenting differently a given chromosome without changing its corresponding information, is not implemented in the 2D-GA, because all the operators are based on the \u201cinterpretation\u201d of the chromosomes rather than on the encoding of the chromosomes.\u00a0<\/p>\n\n\n\n<h5 class=\"wp-block-heading\" id=\"sec9\">9. Validation<a href=\"#contents\" rel=\"nofollow\">\u2191<\/a><\/h5>\n\n\n\n<p class=\"wp-block-paragraph\">A first prototype was developed during  a research project aimed to develop a method of helping to create Very-Large-Scale Integration (VLSI) chips, and funded by the Walloon Region from 1999 to 2001. Furthermore, because not enough tests have being done actually, it is only possible to present qualitative results rather than quantitative ones.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">For the VLSI problem, where the connections are a very important aspect, the best placement strategy is the center heuristic, because it guarantees that two objects treated consecutively will be placed closed from each other. Furthermore, if the external connectors are disposed around the limiting area, the objects can be place at \u201cequal\u201d distance from each border. An example is showed at Figure\u00a010. With the bottom-left and edge heuristics, all the elements placed will be translated to the bottom-left corner (Position\u00a0\\(O\\)), which implies an amelioration for the net\u00a0\\(a\\), but a deterioration for all other nets represented.<\/p>\n\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"342\" height=\"207\" src=\"http:\/\/xeddixx.cluster029.hosting.ovh.net\/wp-content\/uploads\/2025\/10\/vlsiheuristic.png\" alt=\"\" class=\"wp-image-1779\" srcset=\"https:\/\/www.francq.info\/wp-content\/uploads\/2025\/10\/vlsiheuristic.png 342w, https:\/\/www.francq.info\/wp-content\/uploads\/2025\/10\/vlsiheuristic-300x182.png 300w\" sizes=\"auto, (max-width: 342px) 100vw, 342px\" \/><\/figure>\n<\/div>\n\n\n<p class=\"has-text-align-center wp-block-paragraph\">Figure 10. Advantages of the \u201ccenter\u201d heuristic.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">For the crossover, a problem occurs when there are some large blocs in comparison to the limiting area. An example is showed at Figure\u00a011, where the two best objects (\\(1\\)\u00a0and\u00a0\\(2\\)), selected during the crossover, define a rectangle that holds only a single object. In this case, no interesting information are shared, because the crossover is reduced to run the initial heuristic. This problem becomes important when there are only a few \u201cbig\u201d objects to place.<\/p>\n\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"279\" height=\"207\" src=\"http:\/\/xeddixx.cluster029.hosting.ovh.net\/wp-content\/uploads\/2025\/10\/vlsiexplac.png\" alt=\"\" class=\"wp-image-1780\"\/><\/figure>\n<\/div>\n\n\n<p class=\"has-text-align-center wp-block-paragraph\">Figure 11. Problem for the element selection in the crossover operator.<\/p>\n\n\n\n<h5 class=\"wp-block-heading\" id=\"references\">References<a href=\"#contents\" rel=\"nofollow\">\u2191<\/a><\/h5>\n\n\n\n<p class=\"wp-block-paragraph\" id=\"1\">[1]\u00a0Donald E. Knuth,\u00a0<em>The Art of Computer Programming, Vol. 1: Fundamental Algorithms<\/em>, 2\u1d49 ed., Addison-Wesley, 1998.\u00a0<\/p>\n\n\n\n<p class=\"wp-block-paragraph\" id=\"2\">[2]\u00a0Carter Bays, \u201cA Comparaison of Next-Fit, First-Fit, and Best-Fit\u201d,\u00a0<em>Communications of the ACM<\/em>, 20(3), pp. 191\u2014192, 1977.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\" id=\"3\">[3]\u00a0John E. Shore, \u201cOn the External Fragmentation Produced by First-Fit and Best-Fit Allocation Strategies\u201d,\u00a0<em>Communications of the ACM<\/em>, 18(8), pp. 443\u2014440,1975.<\/p>\n\n\n\n<h5 class=\"wp-block-heading\" id=\"notes\">Notes<a href=\"#contents\" rel=\"nofollow\">\u2191<\/a><\/h5>\n\n\n<ol class=\"wp-block-footnotes\"><li id=\"0de2fa1a-be91-4e11-8e7a-5e220d6ddd21\">It is also possible to change the value during the evolution process, but there are actually no reasons to implement something like this. <a href=\"#0de2fa1a-be91-4e11-8e7a-5e220d6ddd21-link\" aria-label=\"Aller \u00e0 la note de bas de page 1\">\u21a9\ufe0e<\/a><\/li><li id=\"864f1200-9de0-4a9a-8b49-fda4144f88bf\">It is possible to change the values of the PROMETHEE parameters for a specific problem. <a href=\"#864f1200-9de0-4a9a-8b49-fda4144f88bf-link\" aria-label=\"Aller \u00e0 la note de bas de page 2\">\u21a9\ufe0e<\/a><\/li><li id=\"d45bd830-264e-49bf-98cd-566a97c0a185\">In fact, the same object cannot be selected in both parent, i.e. when an object is chosen in one parent, it cannot be chosen in the second parent. <a href=\"#d45bd830-264e-49bf-98cd-566a97c0a185-link\" aria-label=\"Aller \u00e0 la note de bas de page 3\">\u21a9\ufe0e<\/a><\/li><\/ol>","protected":false},"excerpt":{"rendered":"<p>Abstract The 2D Genetic Algorithms (2DGA) are a kind of\u00a0Genetic Algorithms (GA)\u00a0applicable to solve\u00a0placement problems. Table of Contents 1. Definition 2. Encoding 3. Evaluation 4. Heuristics 4.1. Select Object to Place 4.2. Local Optimization 4.3. Bottom-Left Heuristic 4.4. Edge Heuristic 4.5. The Center Heuristic 4.6. Free Space Problem 5. Initialization 6. Crossover 6.1. Object Selection [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"parent":0,"menu_order":0,"comment_status":"closed","ping_status":"closed","template":"","meta":{"footnotes":"[{\"content\":\"It is also possible to change the value during the evolution process, but there are actually no reasons to implement something like this.\",\"id\":\"0de2fa1a-be91-4e11-8e7a-5e220d6ddd21\"},{\"content\":\"It is possible to change the values of the PROMETHEE parameters for a specific problem.\",\"id\":\"864f1200-9de0-4a9a-8b49-fda4144f88bf\"},{\"content\":\"In fact, the same object cannot be selected in both parent, i.e. when an object is chosen in one parent, it cannot be chosen in the second parent.\",\"id\":\"d45bd830-264e-49bf-98cd-566a97c0a185\"}]"},"class_list":["post-1719","page","type-page","status-publish","hentry"],"_links":{"self":[{"href":"https:\/\/www.francq.info\/index.php\/wp-json\/wp\/v2\/pages\/1719","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.francq.info\/index.php\/wp-json\/wp\/v2\/pages"}],"about":[{"href":"https:\/\/www.francq.info\/index.php\/wp-json\/wp\/v2\/types\/page"}],"author":[{"embeddable":true,"href":"https:\/\/www.francq.info\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.francq.info\/index.php\/wp-json\/wp\/v2\/comments?post=1719"}],"version-history":[{"count":47,"href":"https:\/\/www.francq.info\/index.php\/wp-json\/wp\/v2\/pages\/1719\/revisions"}],"predecessor-version":[{"id":2220,"href":"https:\/\/www.francq.info\/index.php\/wp-json\/wp\/v2\/pages\/1719\/revisions\/2220"}],"wp:attachment":[{"href":"https:\/\/www.francq.info\/index.php\/wp-json\/wp\/v2\/media?parent=1719"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}