{"id":2858,"date":"2025-02-14T18:36:05","date_gmt":"2025-02-14T18:36:05","guid":{"rendered":"https:\/\/blog.samarthya.me\/wps\/?p=2858"},"modified":"2025-02-14T18:36:07","modified_gmt":"2025-02-14T18:36:07","slug":"linear-programming-lp","status":"publish","type":"post","link":"https:\/\/blog.samarthya.me\/wps\/2025\/02\/14\/linear-programming-lp\/","title":{"rendered":"Linear Programming (LP)"},"content":{"rendered":"\n<figure class=\"wp-block-image size-large\"><img fetchpriority=\"high\" decoding=\"async\" width=\"1024\" height=\"1024\" src=\"https:\/\/blog.samarthya.me\/wps\/wp-content\/uploads\/2025\/02\/lp2-1024x1024.jpeg\" alt=\"\" class=\"wp-image-2859\" style=\"aspect-ratio:4\/3;object-fit:cover\" srcset=\"https:\/\/blog.samarthya.me\/wps\/wp-content\/uploads\/2025\/02\/lp2-1024x1024.jpeg 1024w, https:\/\/blog.samarthya.me\/wps\/wp-content\/uploads\/2025\/02\/lp2-150x150@2x.jpeg 300w, https:\/\/blog.samarthya.me\/wps\/wp-content\/uploads\/2025\/02\/lp2-150x150.jpeg 150w, https:\/\/blog.samarthya.me\/wps\/wp-content\/uploads\/2025\/02\/lp2-1536x1536.jpeg 1536w, https:\/\/blog.samarthya.me\/wps\/wp-content\/uploads\/2025\/02\/lp2.jpeg 2048w, https:\/\/blog.samarthya.me\/wps\/wp-content\/uploads\/2025\/02\/lp2-300x300@2x.jpeg 600w\" sizes=\"(max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n\n\n\n<h2 class=\"wp-block-heading\"><strong>What is Linear Programming?<\/strong><\/h2>\n\n\n\n<p>Linear programming is a mathematical technique used to find the best possible outcome (maximum profit or minimum cost) in a situation where the relationships between the factors involved are linear. It&#8217;s like finding the sweet spot where you get the most out of what you have, given certain limitations.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\"><strong>Example: A Furniture Company<\/strong><\/h3>\n\n\n\n<p>Let&#8217;s say a furniture company makes chairs and tables. Each chair takes 2 hours to assemble and 1 hour to finish. Each table takes 3 hours to assemble and 2 hours to finish. The company has a total of 40 hours available for assembly and 30 hours for finishing each week. If each chair sells for $50 and each table sells for $75, how many chairs and tables should the company make each week to maximize its revenue?<\/p>\n\n\n\n<h3 class=\"wp-block-heading\"><strong>Components of Linear Programming<\/strong><\/h3>\n\n\n\n<ol class=\"wp-block-list\">\n<li><strong>Decision Variables:<\/strong> These are the things you&#8217;re trying to decide. In our example:\n<ul class=\"wp-block-list\">\n<li><code>x<\/code> = number of chairs to make<\/li>\n\n\n\n<li><code>y<\/code> = number of tables to make<\/li>\n<\/ul>\n<\/li>\n\n\n\n<li><strong>Objective Function:<\/strong> This is what you&#8217;re trying to maximize or minimize. Here, it&#8217;s the revenue:\n<ul class=\"wp-block-list\">\n<li>Revenue = 50x + 75y (We want to make this as big as possible)<\/li>\n<\/ul>\n<\/li>\n\n\n\n<li><strong>Constraints:<\/strong> These are the limitations you have. In our case:\n<ul class=\"wp-block-list\">\n<li>Assembly time: 2x + 3y \u2264 40 (Can&#8217;t use more than 40 hours of assembly time)<\/li>\n\n\n\n<li>Finishing time: 1x + 2y \u2264 30 (Can&#8217;t use more than 30 hours of finishing time)<\/li>\n\n\n\n<li>Non-negativity: x \u2265 0, y \u2265 0 (Can&#8217;t make a negative number of chairs or tables)<\/li>\n<\/ul>\n<\/li>\n<\/ol>\n","protected":false},"excerpt":{"rendered":"<p>What is Linear Programming? Linear programming is a mathematical technique used to find the best possible outcome (maximum profit or minimum cost) in a situation where the relationships between the factors involved are linear. It&#8217;s like finding the sweet spot where you get the most out of what you have, given certain limitations. Example: A [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":2860,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_exactmetrics_skip_tracking":false,"_exactmetrics_sitenote_active":false,"_exactmetrics_sitenote_note":"","_exactmetrics_sitenote_category":0,"footnotes":""},"categories":[34],"tags":[330],"class_list":["post-2858","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-technical","tag-ba"],"_links":{"self":[{"href":"https:\/\/blog.samarthya.me\/wps\/wp-json\/wp\/v2\/posts\/2858","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/blog.samarthya.me\/wps\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/blog.samarthya.me\/wps\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/blog.samarthya.me\/wps\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/blog.samarthya.me\/wps\/wp-json\/wp\/v2\/comments?post=2858"}],"version-history":[{"count":2,"href":"https:\/\/blog.samarthya.me\/wps\/wp-json\/wp\/v2\/posts\/2858\/revisions"}],"predecessor-version":[{"id":2862,"href":"https:\/\/blog.samarthya.me\/wps\/wp-json\/wp\/v2\/posts\/2858\/revisions\/2862"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/blog.samarthya.me\/wps\/wp-json\/wp\/v2\/media\/2860"}],"wp:attachment":[{"href":"https:\/\/blog.samarthya.me\/wps\/wp-json\/wp\/v2\/media?parent=2858"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blog.samarthya.me\/wps\/wp-json\/wp\/v2\/categories?post=2858"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blog.samarthya.me\/wps\/wp-json\/wp\/v2\/tags?post=2858"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}