{"id":7240,"date":"2019-10-31T13:19:55","date_gmt":"2019-10-31T12:19:55","guid":{"rendered":"http:\/\/smart--grid.net\/?page_id=7240"},"modified":"2022-12-03T23:03:33","modified_gmt":"2022-12-03T22:03:33","slug":"lp-forme-canonique-et-forme-standard","status":"publish","type":"page","link":"https:\/\/complex-systems-ai.com\/en\/linear-programming-2\/lp-canonical-form-and-standard-form\/","title":{"rendered":"LP: canonical form and standard form"},"content":{"rendered":"<div data-elementor-type=\"wp-page\" data-elementor-id=\"7240\" class=\"elementor elementor-7240\">\n\t\t\t\t\t\t<section class=\"elementor-section elementor-top-section elementor-element elementor-element-bdd5c80 elementor-section-boxed elementor-section-height-default elementor-section-height-default\" data-id=\"bdd5c80\" data-element_type=\"section\" data-e-type=\"section\">\n\t\t\t\t\t\t<div class=\"elementor-container elementor-column-gap-default\">\n\t\t\t\t\t<div class=\"elementor-column elementor-col-33 elementor-top-column elementor-element elementor-element-51b22a3\" data-id=\"51b22a3\" data-element_type=\"column\" data-e-type=\"column\">\n\t\t\t<div class=\"elementor-widget-wrap elementor-element-populated\">\n\t\t\t\t\t\t<div class=\"elementor-element elementor-element-2f46393 elementor-align-justify elementor-widget elementor-widget-button\" data-id=\"2f46393\" data-element_type=\"widget\" data-e-type=\"widget\" data-widget_type=\"button.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t\t\t\t\t\t\t<div class=\"elementor-button-wrapper\">\n\t\t\t\t\t<a class=\"elementor-button elementor-button-link elementor-size-sm\" href=\"https:\/\/complex-systems-ai.com\/en\/linear-programming-2\/\">\n\t\t\t\t\t\t<span class=\"elementor-button-content-wrapper\">\n\t\t\t\t\t\t\t\t\t<span class=\"elementor-button-text\">Linear programming<\/span>\n\t\t\t\t\t<\/span>\n\t\t\t\t\t<\/a>\n\t\t\t\t<\/div>\n\t\t\t\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t\t<\/div>\n\t\t<\/div>\n\t\t\t\t<div class=\"elementor-column elementor-col-33 elementor-top-column elementor-element elementor-element-38bc2b8\" data-id=\"38bc2b8\" data-element_type=\"column\" data-e-type=\"column\">\n\t\t\t<div class=\"elementor-widget-wrap elementor-element-populated\">\n\t\t\t\t\t\t<div class=\"elementor-element elementor-element-3a9f828 elementor-align-justify elementor-widget elementor-widget-button\" data-id=\"3a9f828\" data-element_type=\"widget\" data-e-type=\"widget\" data-widget_type=\"button.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t\t\t\t\t\t\t<div class=\"elementor-button-wrapper\">\n\t\t\t\t\t<a class=\"elementor-button elementor-button-link elementor-size-sm\" href=\"https:\/\/complex-systems-ai.com\/en\/\">\n\t\t\t\t\t\t<span class=\"elementor-button-content-wrapper\">\n\t\t\t\t\t\t\t\t\t<span class=\"elementor-button-text\">Home page<\/span>\n\t\t\t\t\t<\/span>\n\t\t\t\t\t<\/a>\n\t\t\t\t<\/div>\n\t\t\t\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t\t<\/div>\n\t\t<\/div>\n\t\t\t\t<div class=\"elementor-column elementor-col-33 elementor-top-column elementor-element elementor-element-664460a\" data-id=\"664460a\" data-element_type=\"column\" data-e-type=\"column\">\n\t\t\t<div class=\"elementor-widget-wrap elementor-element-populated\">\n\t\t\t\t\t\t<div class=\"elementor-element elementor-element-b226379 elementor-align-justify elementor-widget elementor-widget-button\" data-id=\"b226379\" data-element_type=\"widget\" data-e-type=\"widget\" data-widget_type=\"button.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t\t\t\t\t\t\t<div class=\"elementor-button-wrapper\">\n\t\t\t\t\t<a class=\"elementor-button elementor-button-link elementor-size-sm\" href=\"https:\/\/fr.wikipedia.org\/wiki\/Optimisation_lin%C3%A9aire\" target=\"_blank\" rel=\"noopener\">\n\t\t\t\t\t\t<span class=\"elementor-button-content-wrapper\">\n\t\t\t\t\t\t\t\t\t<span class=\"elementor-button-text\">Wiki<\/span>\n\t\t\t\t\t<\/span>\n\t\t\t\t\t<\/a>\n\t\t\t\t<\/div>\n\t\t\t\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t\t<\/div>\n\t\t<\/div>\n\t\t\t\t\t<\/div>\n\t\t<\/section>\n\t\t\t\t<section class=\"elementor-section elementor-top-section elementor-element elementor-element-237301d7 elementor-section-boxed elementor-section-height-default elementor-section-height-default\" data-id=\"237301d7\" data-element_type=\"section\" data-e-type=\"section\">\n\t\t\t\t\t\t<div class=\"elementor-container elementor-column-gap-default\">\n\t\t\t\t\t<div class=\"elementor-column elementor-col-100 elementor-top-column elementor-element elementor-element-fac5d0c\" data-id=\"fac5d0c\" data-element_type=\"column\" data-e-type=\"column\">\n\t\t\t<div class=\"elementor-widget-wrap elementor-element-populated\">\n\t\t\t\t\t\t<div class=\"elementor-element elementor-element-79d76512 elementor-widget elementor-widget-text-editor\" data-id=\"79d76512\" data-element_type=\"widget\" data-e-type=\"widget\" data-widget_type=\"text-editor.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t\t\t\t\t\t\t\n<div id=\"ez-toc-container\" class=\"ez-toc-v2_0_83 counter-hierarchy ez-toc-counter ez-toc-grey ez-toc-container-direction\">\n<div class=\"ez-toc-title-container\">\n<p class=\"ez-toc-title\" style=\"cursor:inherit\">Contents<\/p>\n<span class=\"ez-toc-title-toggle\"><a href=\"#\" class=\"ez-toc-pull-right ez-toc-btn ez-toc-btn-xs ez-toc-btn-default ez-toc-toggle\" aria-label=\"Toggle Table of Content\"><span class=\"ez-toc-js-icon-con\"><span class=\"\"><span class=\"eztoc-hide\" style=\"display:none;\">Toggle<\/span><span class=\"ez-toc-icon-toggle-span\"><svg style=\"fill: #999;color:#999\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\" class=\"list-377408\" width=\"20px\" height=\"20px\" viewbox=\"0 0 24 24\" fill=\"none\"><path d=\"M6 6H4v2h2V6zm14 0H8v2h12V6zM4 11h2v2H4v-2zm16 0H8v2h12v-2zM4 16h2v2H4v-2zm16 0H8v2h12v-2z\" fill=\"currentColor\"><\/path><\/svg><svg style=\"fill: #999;color:#999\" class=\"arrow-unsorted-368013\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\" width=\"10px\" height=\"10px\" viewbox=\"0 0 24 24\" version=\"1.2\" baseprofile=\"tiny\"><path d=\"M18.2 9.3l-6.2-6.3-6.2 6.3c-.2.2-.3.4-.3.7s.1.5.3.7c.2.2.4.3.7.3h11c.3 0 .5-.1.7-.3.2-.2.3-.5.3-.7s-.1-.5-.3-.7zM5.8 14.7l6.2 6.3 6.2-6.3c.2-.2.3-.5.3-.7s-.1-.5-.3-.7c-.2-.2-.4-.3-.7-.3h-11c-.3 0-.5.1-.7.3-.2.2-.3.5-.3.7s.1.5.3.7z\"\/><\/svg><\/span><\/span><\/span><\/a><\/span><\/div>\n<nav><ul class='ez-toc-list ez-toc-list-level-1' ><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-1\" href=\"https:\/\/complex-systems-ai.com\/en\/linear-programming-2\/lp-canonical-form-and-standard-form\/#Forme-canonique-et-forme-standard\" >Canonical form and standard form<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-2\" href=\"https:\/\/complex-systems-ai.com\/en\/linear-programming-2\/lp-canonical-form-and-standard-form\/#Forme-canonique\" >Canonic form<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-3\" href=\"https:\/\/complex-systems-ai.com\/en\/linear-programming-2\/lp-canonical-form-and-standard-form\/#Forme-standard\" >Standard shape<\/a><\/li><\/ul><\/nav><\/div>\n<h2><span class=\"ez-toc-section\" id=\"Forme-canonique-et-forme-standard\"><\/span>Canonical form and standard form<span class=\"ez-toc-section-end\"><\/span><\/h2>\n<p>Linear programs follow certain rules when writing it. A <a href=\"https:\/\/complex-systems-ai.com\/en\/linear-programming-2\/\">linear program<\/a> which follows the rules is said to be in canonical form. The algorithm of <a href=\"https:\/\/complex-systems-ai.com\/en\/linear-programming-2\/simplex-method-2\/\">simplex<\/a> can only apply to linear programs in the canonical form.<\/p>\n\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"Forme-canonique\"><\/span>Canonic form<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n<p>A linear program in its canonical form is:<\/p>\n\n<ul class=\"wp-block-list\">\n<li>A Maximization problem, under Lower or equal constraints, all the variables of which are strictly positive.<\/li>\n<li>A problem of <a href=\"https:\/\/complex-systems-ai.com\/en\/language-theory\/minimization-dun-afd\/\">Minimization<\/a>, under Greater or equal constraints, all of whose variables are strictly positive.<\/li>\n<\/ul>\n\n<p>If the linear program does not correspond to these criteria, it is necessary to transform the constraints or the objective function according to the following operations:<\/p>\n\n<ul class=\"wp-block-list\">\n<li>max z = - min -z<\/li>\n<li>x + y \u2265 b is equivalent to - x - y \u2264 - b<\/li>\n<li>x + y = b is equivalent to x + y \u2265 b, x + y \u2264 b<\/li>\n<\/ul>\n\n<p>The canonical form is often represented in a matrix form:<\/p>\n\n<ul class=\"wp-block-list\">\n<li>the vector of the coefficients of the objective function: c of size n<\/li>\n<li>the matrix of the coefficients of the left part of the constraints: A of size m * n<\/li>\n<li>the vector of the constants of the right part of the constraints: b of size m<\/li>\n<li>the vector of variables: x of size n<\/li>\n<\/ul>\n\n<p>Thus the following linear program:<\/p>\n\n<figure class=\"wp-block-image size-large\"><img fetchpriority=\"high\" decoding=\"async\" class=\"alignnone wp-image-7266 size-full\" src=\"https:\/\/complex-systems-ai.com\/wp-content\/uploads\/2019\/10\/img702.gif\" alt=\"Canonical form standard form\" width=\"472\" height=\"142\" title=\"\"><\/figure>\n\n<p>Written in the following form:<\/p>\n\n<figure class=\"wp-block-image size-medium\"><img decoding=\"async\" class=\"alignnone wp-image-7271 size-full\" src=\"https:\/\/complex-systems-ai.com\/wp-content\/uploads\/2019\/10\/lineaire16.png\" alt=\"Canonical form standard form\" width=\"350\" height=\"130\" title=\"\" srcset=\"https:\/\/complex-systems-ai.com\/wp-content\/uploads\/2019\/10\/lineaire16.png 350w, https:\/\/complex-systems-ai.com\/wp-content\/uploads\/2019\/10\/lineaire16-300x111.png 300w\" sizes=\"(max-width: 350px) 100vw, 350px\" \/><\/figure>\n\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"Forme-standard\"><\/span>Standard shape<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n<p>For each inequality constraint of the canonical form, we add a <a href=\"https:\/\/complex-systems-ai.com\/en\/linear-programming-2\/lp-origin-unrealizable\/\">slack variable<\/a> positive and such that:<\/p>\n\n<p>Ax \u2264 b \u21d4 Ax + e = b, e \u2265 0, here e is a vector of size m of deviation variables.<\/p>\n\n<p>Thus the canonical form is brought to the standard form by the addition of the variation variables in the vector of variables:<\/p>\n\n<figure class=\"wp-block-image size-large\"><img decoding=\"async\" class=\"alignnone wp-image-7273 size-full\" src=\"https:\/\/complex-systems-ai.com\/wp-content\/uploads\/2019\/10\/lineaire17.png\" alt=\"Canonical form standard form\" width=\"502\" height=\"126\" title=\"\" srcset=\"https:\/\/complex-systems-ai.com\/wp-content\/uploads\/2019\/10\/lineaire17.png 502w, https:\/\/complex-systems-ai.com\/wp-content\/uploads\/2019\/10\/lineaire17-300x75.png 300w\" sizes=\"(max-width: 502px) 100vw, 502px\" \/><\/figure>\n\n<ul class=\"wp-block-list\">\n<li>the vector of the coefficients of the objective function: c of size n + m (n for x and m for e although the latter do not enter into the calculation)<\/li>\n<li>the matrix of the coefficients of the left part of the constraints: \u00c3 of size m * (n + m), the right part of the matrix being an Identity matrix of size m.<\/li>\n<li>the vector of the constants of the right part of the constraints: b of size m<\/li>\n<li>the vector of variables of size n + m<\/li>\n<\/ul>\n\n<p>Some inequalities do not make it possible to have positive base variables. For this we must add other variables called excess and artificial variables.<\/p>\n\n<p>Here are the rules to follow to best transform the simplex into standard form:<\/p>\n\n<ul class=\"wp-block-list\">\n<li><strong><em>\u201cgreater than or equal\u201d or \u201cless than or equal with negative b\u201d constraints: make b positive and add \u201c\u2013 slack variable + <a href=\"https:\/\/complex-systems-ai.com\/en\/linear-programming-2\/lp-method-du-grand-m\/\">artificial variable<\/a>\u00a0\u00bb<\/em><\/strong><\/li>\n<li><strong><em>&quot;equality&quot; constraints: add &quot;+ artificial variable&quot;<\/em><\/strong><\/li>\n<li><strong><em>constraints \u201cless than or equal with positive b\u201d: add \u201c+ variation variable\u201d as seen previously.<\/em><\/strong><\/li>\n<\/ul>\n\t\t\t\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t\t<\/div>\n\t\t<\/div>\n\t\t\t\t\t<\/div>\n\t\t<\/section>\n\t\t\t\t<\/div>","protected":false},"excerpt":{"rendered":"<p>Linear Programming Wiki Home Page Canonical Form and Standard Form Linear programs follow certain rules when written. A linear program that follows... <\/p>","protected":false},"author":1,"featured_media":0,"parent":486,"menu_order":0,"comment_status":"closed","ping_status":"closed","template":"","meta":{"footnotes":""},"class_list":["post-7240","page","type-page","status-publish","hentry"],"amp_enabled":true,"_links":{"self":[{"href":"https:\/\/complex-systems-ai.com\/en\/wp-json\/wp\/v2\/pages\/7240","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/complex-systems-ai.com\/en\/wp-json\/wp\/v2\/pages"}],"about":[{"href":"https:\/\/complex-systems-ai.com\/en\/wp-json\/wp\/v2\/types\/page"}],"author":[{"embeddable":true,"href":"https:\/\/complex-systems-ai.com\/en\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/complex-systems-ai.com\/en\/wp-json\/wp\/v2\/comments?post=7240"}],"version-history":[{"count":4,"href":"https:\/\/complex-systems-ai.com\/en\/wp-json\/wp\/v2\/pages\/7240\/revisions"}],"predecessor-version":[{"id":17905,"href":"https:\/\/complex-systems-ai.com\/en\/wp-json\/wp\/v2\/pages\/7240\/revisions\/17905"}],"up":[{"embeddable":true,"href":"https:\/\/complex-systems-ai.com\/en\/wp-json\/wp\/v2\/pages\/486"}],"wp:attachment":[{"href":"https:\/\/complex-systems-ai.com\/en\/wp-json\/wp\/v2\/media?parent=7240"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}