{"id":4483,"date":"2019-12-31T22:41:04","date_gmt":"2020-01-01T03:41:04","guid":{"rendered":"http:\/\/www.paleotechnologist.net\/?p=4483"},"modified":"2021-03-28T12:45:45","modified_gmt":"2021-03-28T17:45:45","slug":"darwins-polyhedra","status":"publish","type":"post","link":"https:\/\/www.paleotechnologist.net\/?p=4483","title":{"rendered":"Darwin&#8217;s Polyhedra"},"content":{"rendered":"\n<p class=\"wp-block-paragraph\">Evolution by natural selection is a powerful algorithm that\nhas come up with all of the variety of life we see on Earth. By keeping what\nworks and discarding the ideas that don&#8217;t, populations can evolve over time to\nbetter fit their environment.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">The same idea can be used to find solutions to given\ncomputational problems, as well. The field of Genetic Algorithms \/ Genetic\nProgramming uses Darwinian evolution to search for solutions to various\nproblems. Candidate solutions are encoded as gene sequences &#8212; perhaps a series\nof bytes, with each byte representing some parameter of the candidate solution.\nEach generation, the solutions are all tested and ranked, with better solutions\nhaving a higher chance to be selected to produce the next generation. Selected\nparent genomes are combined via crossover (with some mutation) to produce new\ngenomes to be evaluated in the next generation.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">One good way to test how well such an approach works is to try it out on problems for which you already know at least some solutions. For example, the <a rel=\"noreferrer noopener\" aria-label=\"Tammes Problem (opens in a new tab)\" href=\"https:\/\/en.wikipedia.org\/wiki\/Tammes_problem\" target=\"_blank\">Tammes Problem<\/a> asks what is the greatest size disc for which you can fit N such discs on the surface of a sphere. Equivalently, what is the maximum, minimum distance possible between any two of N points on the surface of a sphere?<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Solutions to such a problem can be expressed in genetic form, suitable for being acted upon by evolutionary forces. The position of each point is expressed in altitude and azimuth angles, sufficient to cover the surface of the unit sphere. (Note to self: explore using quaternions.) The simulation is then run, with the function that determines evolutionary fitness being the minimum distance between any two points. Solutions can then be visualized as polyhedra, where the unit sphere is cut by planes normal to the vector from the origin to each point. This results in an N-sided polyhedron &#8212; although sometimes a rather weird, lumpy one at first.<\/p>\n\n\n\n<figure class=\"wp-block-image size-large is-resized\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/www.paleotechnologist.net\/wp-content\/uploads\/2019\/12\/cube_193200_ppm_error.jpg\" alt=\"\" class=\"wp-image-4490\" width=\"436\" height=\"370\" srcset=\"https:\/\/www.paleotechnologist.net\/wp-content\/uploads\/2019\/12\/cube_193200_ppm_error.jpg 871w, https:\/\/www.paleotechnologist.net\/wp-content\/uploads\/2019\/12\/cube_193200_ppm_error-300x255.jpg 300w, https:\/\/www.paleotechnologist.net\/wp-content\/uploads\/2019\/12\/cube_193200_ppm_error-768x652.jpg 768w\" sizes=\"auto, (max-width: 436px) 100vw, 436px\" \/><figcaption>The best &#8220;cube&#8221; of generation 1.<br>Not very impressive at some 19.3% error &#8212; but that quickly improves!<\/figcaption><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">For &#8220;easy&#8221; problems such as N=6, this approach\nquickly produces a nearly-optimal solution. Six equally-spaced points on the\nunit sphere will be farthest apart when they are in the form of a cube. For\nexample, points at (1,0,0) and (0,1,0) could be two such points, 90 degrees\napart. The optimal Tammes distance for N=6, then, is sqrt(2).<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">For N=6, the genetic approach described above very quickly converges to the expected cube solution, with point positions very nearly the expected distance apart. (A typical result differs from sqrt(2) by well under one part per million, if left to run for a while.)<\/p>\n\n\n\n<figure class=\"wp-block-image size-large is-resized\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/www.paleotechnologist.net\/wp-content\/uploads\/2019\/12\/cube_12ppm_error.jpg\" alt=\"\" class=\"wp-image-4491\" width=\"429\" height=\"366\" srcset=\"https:\/\/www.paleotechnologist.net\/wp-content\/uploads\/2019\/12\/cube_12ppm_error.jpg 858w, https:\/\/www.paleotechnologist.net\/wp-content\/uploads\/2019\/12\/cube_12ppm_error-300x256.jpg 300w, https:\/\/www.paleotechnologist.net\/wp-content\/uploads\/2019\/12\/cube_12ppm_error-768x655.jpg 768w\" sizes=\"auto, (max-width: 429px) 100vw, 429px\" \/><figcaption>The best cube of Generation 2941 (and the previous thousand or so) &#8212; <br>a cube with a measurement error of ~12.293 parts per million.)<\/figcaption><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">Some values of N produce interesting results. For N=8, the most typical result is an anti-prism, similar to the platonic octohedron, but with four of the points rotated by 45 degrees. (When you think about it, it makes sense; the points are farther apart that way.)<\/p>\n\n\n\n<figure class=\"wp-block-image size-large is-resized\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/www.paleotechnologist.net\/wp-content\/uploads\/2019\/12\/2019-12-30-18.11.53-1024x576.jpg\" alt=\"\" class=\"wp-image-4485\" width=\"512\" height=\"288\" srcset=\"https:\/\/www.paleotechnologist.net\/wp-content\/uploads\/2019\/12\/2019-12-30-18.11.53-1024x576.jpg 1024w, https:\/\/www.paleotechnologist.net\/wp-content\/uploads\/2019\/12\/2019-12-30-18.11.53-300x169.jpg 300w, https:\/\/www.paleotechnologist.net\/wp-content\/uploads\/2019\/12\/2019-12-30-18.11.53-768x432.jpg 768w, https:\/\/www.paleotechnologist.net\/wp-content\/uploads\/2019\/12\/2019-12-30-18.11.53-1536x864.jpg 1536w, https:\/\/www.paleotechnologist.net\/wp-content\/uploads\/2019\/12\/2019-12-30-18.11.53-2048x1152.jpg 2048w\" sizes=\"auto, (max-width: 512px) 100vw, 512px\" \/><figcaption>An antiprism octahedron. It&#8217;s not the Platonic solid, but it would be a fair die.<\/figcaption><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">Larger values seem to pose greater challenges to this\napproach; N=12 sometimes produces the expected Platonic regular dodecahedron,\nbut more often will get stuck in a local minimum, producing a somewhat\nsymmetrical shape. (Like in nature, Darwinian evolution doesn&#8217;t always produce\na *perfect* solution &#8212; just whatever seems to get the job done best. )<\/p>\n\n\n\n<figure class=\"wp-block-image size-large is-resized\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/www.paleotechnologist.net\/wp-content\/uploads\/2019\/12\/2019-12-30-18.13.21-1024x576.jpg\" alt=\"\" class=\"wp-image-4486\" width=\"512\" height=\"288\" srcset=\"https:\/\/www.paleotechnologist.net\/wp-content\/uploads\/2019\/12\/2019-12-30-18.13.21-1024x576.jpg 1024w, https:\/\/www.paleotechnologist.net\/wp-content\/uploads\/2019\/12\/2019-12-30-18.13.21-300x169.jpg 300w, https:\/\/www.paleotechnologist.net\/wp-content\/uploads\/2019\/12\/2019-12-30-18.13.21-768x432.jpg 768w, https:\/\/www.paleotechnologist.net\/wp-content\/uploads\/2019\/12\/2019-12-30-18.13.21-1536x864.jpg 1536w, https:\/\/www.paleotechnologist.net\/wp-content\/uploads\/2019\/12\/2019-12-30-18.13.21-2048x1152.jpg 2048w\" sizes=\"auto, (max-width: 512px) 100vw, 512px\" \/><figcaption>Various somewhat-symmetric &#8220;grown&#8221; polyhedra. <br>All except for the 8-gon are irregular, but with striking symmetries.<br>From left to right: Irregular 10-sider; antiprism 8-sider; 7-hedron; 9-hedron.<\/figcaption><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">The next goal: try to grow a regular icosahedron. <\/p>\n","protected":false},"excerpt":{"rendered":"<p>Genetic algorithms can be used to evolve regular and nearly-regular polyhedra. Here&#8217;s how. <a href=\"https:\/\/www.paleotechnologist.net\/?p=4483\">Continue reading <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_exactmetrics_skip_tracking":false,"footnotes":""},"categories":[503,530,216,572,222,235],"tags":[576,304,573,302,574,575,577,578],"class_list":["post-4483","post","type-post","status-publish","format-standard","hentry","category-3d-printing","category-algorithms","category-coding","category-genetic-algorithms","category-math","category-science","tag-darwin","tag-evolution","tag-genetic","tag-genetic-algorithm","tag-geometry","tag-polyhedra","tag-tammes","tag-tammes-problem"],"_links":{"self":[{"href":"https:\/\/www.paleotechnologist.net\/index.php?rest_route=\/wp\/v2\/posts\/4483","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.paleotechnologist.net\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.paleotechnologist.net\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.paleotechnologist.net\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.paleotechnologist.net\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=4483"}],"version-history":[{"count":11,"href":"https:\/\/www.paleotechnologist.net\/index.php?rest_route=\/wp\/v2\/posts\/4483\/revisions"}],"predecessor-version":[{"id":4735,"href":"https:\/\/www.paleotechnologist.net\/index.php?rest_route=\/wp\/v2\/posts\/4483\/revisions\/4735"}],"wp:attachment":[{"href":"https:\/\/www.paleotechnologist.net\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=4483"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.paleotechnologist.net\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=4483"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.paleotechnologist.net\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=4483"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}