{"id":9,"date":"2010-10-17T19:20:27","date_gmt":"2010-10-17T16:20:27","guid":{"rendered":"http:\/\/optimalprograms.com\/blog\/?p=9"},"modified":"2012-07-26T11:09:52","modified_gmt":"2012-07-26T08:09:52","slug":"about-the-cutting-and-nesting-optimization-problem","status":"publish","type":"post","link":"https:\/\/optimalprograms.com\/blog\/?p=9","title":{"rendered":"About the cutting and nesting optimization problem"},"content":{"rendered":"<p>The cutting optimization problem belongs to the class of?<a href=\"http:\/\/en.wikipedia.org\/wiki\/NP-complete\">Nondeterminist Polynomial Complete<\/a> (NP-Complete) problems [1]. Other problems in this class are the?<a href=\"http:\/\/en.wikipedia.org\/wiki\/Hamiltonian_path_problem\">Hamiltonian path<\/a>,?<a href=\"http:\/\/en.wikipedia.org\/wiki\/Travelling_salesman_problem\">Travelling Salesman<\/a>,?<a href=\"http:\/\/en.wikipedia.org\/wiki\/Subset_sum_problem\">Subset sum<\/a>,?<a href=\"http:\/\/en.wikipedia.org\/wiki\/Clique_problem\">Clique<\/a>,?<a href=\"http:\/\/en.wikipedia.org\/wiki\/Independent_set_problem\">Independent set<\/a>,?<a href=\"http:\/\/en.wikipedia.org\/wiki\/Graph_coloring_problem\">Graph colouring<\/a> etc. All these problems have been deeply analyzed by a huge number of researchers, but no polynomial-time algorithm was discovered for them. This has a direct consequence over the running time and the quality of the optimization.<\/p>\n<p>A polynomial-time algorithm is that one whose running time is bounded by a polynomial function of its input size. For instance, if we have n = 1000 pieces to cut and the cutting algorithm would have the complexity O(n<sup>2<\/sup>), then the running time would have been directly and linear proportional to 1000<sup>2<\/sup> which is (10<sup>6<\/sup>) units of time. Assuming that our computers can perform 10<sup>9<\/sup> operations per second, the cutting optimization algorithm would run in less than a fraction of a second. Sadly, this is not the case for the cutting optimization problem. There is no such fast algorithm for solving it.<\/p>\n<p>The only perfect algorithm for solving the cutting optimization problem is an exponential one. An exponential algorithm will run in an exponential amount of time (2<em><sup>n<\/sup><\/em>, 3<em><sup>n<\/sup><\/em>,?<em>n<\/em>! &#8211; where?<em>n<\/em> is the number of pieces to be optimized). Thus, even for small instances (lets say 1000 pieces) an exponential algorithm will run as follows:<\/p>\n<table border=\"0\" cellspacing=\"0\" cellpadding=\"0\" width=\"100%\">\n<tbody>\n<tr>\n<td width=\"100%\" valign=\"top\">\n<ul>\n<li>if the complexity is 2<sup>n<\/sup> , then the total number of operations is 2<sup>1000<\/sup> which can be approximated by 10<sup>300<\/sup>. Knowing that our computers can perform 10<sup>9<\/sup> operations \/ second we need 10<sup>291<\/sup> second to run the algorithm. One year has about 10<sup>8<\/sup> seconds. This means that our algorithm would run in 10<sup>283<\/sup> years. This is a huge value compared to the age of the universe which is only 10<sup>9<\/sup> years.<\/li>\n<\/ul>\n<ul>\n<li>if the complexity is 3<sup>n<\/sup> , then the total number of operations is 3<sup>1000<\/sup> which can be approximated by 10<sup>477<\/sup>.<\/li>\n<\/ul>\n<ul>\n<li>if the complexity is n! , then the total number of operations is 1000! which can be approximated by 10<sup>2567<\/sup>.<\/li>\n<\/ul>\n<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p>These algorithms run in an impressive number of years. Even if we put all computers in the world to solve the problem in parallel we still don&#8217;t get a significant improvement in speed.<\/p>\n<p>This is why another possibility (which is employed by our software too) is to use?<a href=\"http:\/\/en.wikipedia.org\/wiki\/Heuristics\"><em>heuristics<\/em><\/a> or approximation algorithms. A heuristic is an algorithm which is fast and returns a good solution (often the best one) of the problem. However,<strong>there is no guarantee<\/strong> that the obtained solution is the optimal one.<\/p>\n<p>An important parameter of the software is the?<a href=\"http:\/\/www.optimalprograms.com\/help\/optimization2dx\/files\/optimization_level.htm\">OptimizationLevel<\/a>. This will basically tell how many configurations are explored before the best found solutions is outputted. If you set the?<a href=\"http:\/\/www.optimalprograms.com\/help\/optimization2dx\/files\/optimization_level.htm\">OptimizationLevel<\/a> to very low value you will obtain a solution very fast. But the quality of the solution might be not so good. If you set the?<a href=\"http:\/\/www.optimalprograms.com\/help\/optimization2dx\/files\/optimization_level.htm\">OptimizationLevel<\/a> to very high value you will obtain a good solution but not so fast. Thus, one must employ a trade-off between the quality of the solutions and the running time.<\/p>\n<p><strong>References<\/strong><\/p>\n<p>[1].????? Garey, M.R., Johnson D.S., Computers and Intractability: A Guide to NP-completeness, Freeman &amp; Co, San Francisco, USA, 1979.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>The cutting optimization problem belongs to the class of?Nondeterminist Polynomial Complete (NP-Complete) problems [1]. Other problems in this class are the?Hamiltonian path,?Travelling Salesman,?Subset sum,?Clique,?Independent set,?Graph colouring etc. All these problems have been deeply analyzed by a huge number of researchers, but no polynomial-time algorithm was discovered for them. This has a direct consequence over the [&hellip;]<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[8,5,3,4,7,6],"tags":[],"class_list":["post-9","post","type-post","status-publish","format-standard","hentry","category-cut-1d-x","category-cut-2d-x","category-cutting-optimization-pro","category-real-cut-1d","category-real-cut-2d","category-simple-cutting-software"],"_links":{"self":[{"href":"https:\/\/optimalprograms.com\/blog\/index.php?rest_route=\/wp\/v2\/posts\/9","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/optimalprograms.com\/blog\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/optimalprograms.com\/blog\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/optimalprograms.com\/blog\/index.php?rest_route=\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/optimalprograms.com\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=9"}],"version-history":[{"count":5,"href":"https:\/\/optimalprograms.com\/blog\/index.php?rest_route=\/wp\/v2\/posts\/9\/revisions"}],"predecessor-version":[{"id":67,"href":"https:\/\/optimalprograms.com\/blog\/index.php?rest_route=\/wp\/v2\/posts\/9\/revisions\/67"}],"wp:attachment":[{"href":"https:\/\/optimalprograms.com\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=9"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/optimalprograms.com\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=9"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/optimalprograms.com\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=9"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}