{"id":159,"date":"2026-07-03T21:25:34","date_gmt":"2026-07-03T21:25:34","guid":{"rendered":"https:\/\/www.kindsonthegenius.com\/data-science\/?p=159"},"modified":"2026-07-03T21:27:52","modified_gmt":"2026-07-03T21:27:52","slug":"integer-optimization-mixed-integer-programmip-with-python","status":"publish","type":"post","link":"https:\/\/kindsonthegenius.com\/data-science\/integer-optimization-mixed-integer-programmip-with-python\/","title":{"rendered":"Integer Optimization &#8211; Mixed Integer Program(MIP) with Python"},"content":{"rendered":"<p><!-- ktg-updated-banner --><\/p>\n<div class=\"ktg-updated-banner\" style=\"margin:1em 0;padding:0.75em 1em;background:#eff6ff;border-left:4px solid #3b82f6;border-radius:4px;\">\n<p><strong>Updated July 3, 2026:<\/strong> Reviewed for accuracy and refreshed metadata.<\/p>\n<\/div>\n<p>A Mixed Integer Program(MIP) is a linear optimization problem that requires that some of the variables be integers.\u00a0 These variables could either be integer variables or boolean variables.<\/p>\n<p>Let&#8217;s take an example, then we solve it using Python.<\/p>\n<ul>\n<li><a href=\"#t1\">An MIP Example<\/a><\/li>\n<li><a href=\"#s1\">Step 1 &#8211; Create the Solver<\/a><\/li>\n<li><a href=\"#s2\">Step 2 &#8211; Declare the Variables<\/a><\/li>\n<li><a href=\"#s3\">Step 3 &#8211; Create your Constraints<\/a><\/li>\n<li><a href=\"#s4\">Step 4 &#8211; Define the Cost Function<\/a><\/li>\n<li><a href=\"#s5\">Step 5 &#8211; Invoke the Solve() and Print Results<\/a><\/li>\n<li><a href=\"#t2\">Using MIP Approach<\/a><\/li>\n<\/ul>\n<p>&nbsp;<\/p>\n<h4><strong id=\"t1\">An MIP Example<\/strong><\/h4>\n<p>Maximize the function <em>f(x, y) = x + 10<\/em> subject to the following constraints:<\/p>\n<table style=\"height: 191px; width: 40%; font-family: 'Times New Roman';\" border=\"0\">\n<tbody>\n<tr>\n<td>x + 7 y \u2264 17.5<\/td>\n<\/tr>\n<tr>\n<td>x \u2264 3.5<\/td>\n<\/tr>\n<tr>\n<td>x \u2265 0<\/td>\n<\/tr>\n<tr>\n<td>y \u2265 0<\/td>\n<\/tr>\n<tr>\n<td colspan=\"3\">x,\u00a0y\u00a0integers<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<h5><strong>Solution<\/strong><\/h5>\n<p>For clarity, we would solve this problem using the simple 5-step linear programming approach. Then we would modify the program to use an MIP approach.<\/p>\n<p><strong id=\"s1\">Step 1 &#8211; Create your solver<\/strong><\/p>\n<p>You&#8217;ll need to import the ortools.linear_solver from pywrap and create a solver variable. the code below does that<\/p>\n<pre style=\"margin: 0; line-height: 125%;\"><span style=\"color: #888888;\"># IMPORT THE SOLVER<\/span>\r\n<span style=\"color: #008800; font-weight: bold;\">from<\/span> <span style=\"color: #0e84b5; font-weight: bold;\">ortools.linear_solver<\/span> <span style=\"color: #008800; font-weight: bold;\">import<\/span> pywraplp\r\nsolver <span style=\"color: #333333;\">=<\/span> pywraplp<span style=\"color: #333333;\">.<\/span>Solver<span style=\"color: #333333;\">.<\/span>CreateSolver(<span style=\"background-color: #fff0f0;\">'GLOP'<\/span>)\r\n<\/pre>\n<p>&nbsp;<\/p>\n<p><strong id=\"s2\">Step 2 &#8211; Declare the variables<\/strong><\/p>\n<p>We do this using the solver&#8217;s <em>NumVar<\/em> method and specify: the upper bound, the lower bound and the variable name.<\/p>\n<pre style=\"margin: 0; line-height: 125%;\"><span style=\"color: #888888;\"># DECLARE THE VARIABLES<\/span>\r\nx <span style=\"color: #333333;\">=<\/span> solver<span style=\"color: #333333;\">.<\/span>NumVar(<span style=\"color: #0000dd; font-weight: bold;\">0<\/span>, <span style=\"color: #6600ee; font-weight: bold;\">3.5<\/span>, <span style=\"background-color: #fff0f0;\">'x'<\/span>)\r\ny <span style=\"color: #333333;\">=<\/span> solver<span style=\"color: #333333;\">.<\/span>NumVar(<span style=\"color: #0000dd; font-weight: bold;\">0<\/span>, solver<span style=\"color: #333333;\">.<\/span>infinity(), <span style=\"background-color: #fff0f0;\">'y'<\/span>)\r\n<\/pre>\n<p>&nbsp;<\/p>\n<p><strong id=\"s3\">Step 3 &#8211; Create the Constraints<\/strong><\/p>\n<p>Constraints are of the form <em>0 &lt;= f(x,y) &lt;= 17.5<\/em>. We would create only this one constraints because the other constraints have been implicitly created with the variable declaration.<\/p>\n<pre style=\"margin: 0; line-height: 125%;\"><span style=\"color: #888888;\"># CREATE THE CONSTRAINT 0 &lt;= f(x,y) &lt;= 17.5<\/span>\r\nct <span style=\"color: #333333;\">=<\/span> solver<span style=\"color: #333333;\">.<\/span>Constraint(<span style=\"color: #0000dd; font-weight: bold;\">0<\/span>, <span style=\"color: #6600ee; font-weight: bold;\">17.5<\/span>) <span style=\"color: #888888;\"># specifies upper and lower bound<\/span>\r\nct<span style=\"color: #333333;\">.<\/span>SetCoefficient(x, <span style=\"color: #0000dd; font-weight: bold;\">1<\/span>) <span style=\"color: #888888;\"># specify the x coefficient<\/span>\r\nct<span style=\"color: #333333;\">.<\/span>SetCoefficient(y, <span style=\"color: #0000dd; font-weight: bold;\">7<\/span>) <span style=\"color: #888888;\"># specify the y coefficient<\/span>\r\n<\/pre>\n<p>&nbsp;<\/p>\n<p><strong id=\"s4\">Step 4 &#8211; Define the Cost function<\/strong><\/p>\n<p>We simply declare the objective variable and then set the coefficient of x and y in the function.<\/p>\n<pre style=\"margin: 0; line-height: 125%;\"><span style=\"color: #888888;\"># DEFINE THE OBJECTIVE FUNCTION x + 10y<\/span>\r\nobj <span style=\"color: #333333;\">=<\/span> solver<span style=\"color: #333333;\">.<\/span>Objective()\r\nobj<span style=\"color: #333333;\">.<\/span>SetCoefficient(x, <span style=\"color: #0000dd; font-weight: bold;\">1<\/span>)\r\nobj<span style=\"color: #333333;\">.<\/span>SetCoefficient(y, <span style=\"color: #0000dd; font-weight: bold;\">10<\/span>)\r\nobj<span style=\"color: #333333;\">.<\/span>SetMaximization() <span style=\"color: #888888;\"># set the problem goal as maximization<\/span>\r\n<\/pre>\n<p>&nbsp;<\/p>\n<p><strong id=\"s5\">Step 5 &#8211; Call the Solver and display the result<\/strong><\/p>\n<p>You must say solver.Solve(). The value of the objective function is in the Value() method of the objective variable. Similarly, the value of each variable if in the solution_value() method of each of the variables. The code below displays the results.<\/p>\n<pre style=\"margin: 0; line-height: 125%;\"><span style=\"color: #888888;\"># CALL THE SOLVER AND SHOW THE RESULT<\/span>\r\nsolver<span style=\"color: #333333;\">.<\/span>Solve()\r\n<span style=\"color: #008800; font-weight: bold;\">print<\/span>(<span style=\"background-color: #fff0f0;\">'Objective value = '<\/span>, obj<span style=\"color: #333333;\">.<\/span>Value())\r\n<span style=\"color: #008800; font-weight: bold;\">print<\/span>(<span style=\"background-color: #fff0f0;\">'x = '<\/span>, x<span style=\"color: #333333;\">.<\/span>solution_value())\r\n<span style=\"color: #008800; font-weight: bold;\">print<\/span>(<span style=\"background-color: #fff0f0;\">'y = '<\/span>, y<span style=\"color: #333333;\">.<\/span>solution_value())\r\n<\/pre>\n<p>The result is given below:<\/p>\n<pre style=\"margin: 0; line-height: 125%;\">Objective value =  25.0\r\nx =  0.0\r\ny =  2.5\r\n<\/pre>\n<p>&nbsp;<\/p>\n<h4><strong id=\"t2\">Solving Using MIP Approach<\/strong><\/h4>\n<p>To solve using MIP you need to make just a few changes.<\/p>\n<ul>\n<li>in the variable declaration, instead of using NumVar(), you use IntVar()<\/li>\n<li>in creating the solver, you need to use &#8216;SCIP&#8217; instead of &#8216;GLOP&#8221;<\/li>\n<\/ul>\n<p>If you make this changes, then you will have the output:<br \/>\n<!-- HTML generated using hilite.me --><\/p>\n<pre style=\"margin: 0; line-height: 125%;\">Objective value =  23.0\r\nx =  3.0\r\ny =  2.0\r\n<\/pre>\n<p>&nbsp;<\/p>\n<p>Find the complete program below:<\/p>\n<figure id=\"attachment_161\" aria-describedby=\"caption-attachment-161\" style=\"width: 839px\" class=\"wp-caption aligncenter\"><a href=\"https:\/\/kindsonthegenius.com\/data-science\/wp-content\/uploads\/2021\/01\/Screenshot-2021-01-20-at-12.04.29.png\"><img loading=\"lazy\" decoding=\"async\" class=\"wp-image-161 size-full\" src=\"https:\/\/kindsonthegenius.com\/data-science\/wp-content\/uploads\/2021\/01\/Screenshot-2021-01-20-at-12.04.29.png\" alt=\"Solution to MIP Problem in Python\" width=\"839\" height=\"667\" srcset=\"https:\/\/kindsonthegenius.com\/data-science\/wp-content\/uploads\/2021\/01\/Screenshot-2021-01-20-at-12.04.29.png 839w, https:\/\/kindsonthegenius.com\/data-science\/wp-content\/uploads\/2021\/01\/Screenshot-2021-01-20-at-12.04.29-300x238.png 300w, https:\/\/kindsonthegenius.com\/data-science\/wp-content\/uploads\/2021\/01\/Screenshot-2021-01-20-at-12.04.29-768x611.png 768w\" sizes=\"auto, (max-width: 839px) 100vw, 839px\" \/><\/a><figcaption id=\"caption-attachment-161\" class=\"wp-caption-text\">Solution to MIP Problem in Python<\/figcaption><\/figure>\n<p><!-- ktg-series-nav --><\/p>\n<nav class=\"ktg-series-nav\" aria-label=\"OR tutorial navigation\">\n<p><strong>Previous:<\/strong> <a href=\"https:\/\/kindsonthegenius.com\/data-science\/the-stigler-diet-linear-programming-problem-in-python\/\">The Stigler Diet Linear Programming Problem in Python<\/a><\/p>\n<p><strong>Next:<\/strong> <a href=\"https:\/\/kindsonthegenius.com\/data-science\/an-mip-problem-with-python-with-constraints-define-with-arrays\/\">An MIP Problem with Python with Constraints Define with Arrays<\/a><\/p>\n<\/nav>\n<p><!-- ktg-alkademy-cta --><\/p>\n<div class=\"ktg-alkademy-cta\" style=\"margin:2em 0;padding:1.25em;border-left:4px solid #2563eb;background:#f8fafc;\">\n<p><strong>Want live data science classes?<\/strong> Join <a href=\"https:\/\/www.alkademy.com\/courses\" target=\"_blank\" rel=\"noopener noreferrer\">Alkademy<\/a> for instructor-led data science and Python courses with hands-on projects.<\/p>\n<\/div>\n<!-- AddThis Advanced Settings generic via filter on the_content --><!-- AddThis Share Buttons generic via filter on the_content -->","protected":false},"excerpt":{"rendered":"<p>Updated July 3, 2026: Reviewed for accuracy and refreshed metadata. A Mixed Integer Program(MIP) is a linear optimization problem that requires that some of the &hellip; <!-- AddThis Advanced Settings generic via filter on get_the_excerpt --><!-- AddThis Share Buttons generic via filter on get_the_excerpt --><\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[2],"tags":[25,26,28,27],"class_list":["post-159","post","type-post","status-publish","format-standard","hentry","category-linear-programming","tag-linear-optimization","tag-mip","tag-mixed-integer-program","tag-solver"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v27.9 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>Integer Optimization &#8211; Mixed Integer Program(MIP) with Python | Data Science Tutorials<\/title>\n<meta name=\"description\" content=\"Mixed Integer Programming (MIP) tutorial in Python \u2014 model integer variables and solve discrete optimization problems step by step.\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/kindsonthegenius.com\/data-science\/integer-optimization-mixed-integer-programmip-with-python\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Integer Optimization &#8211; Mixed Integer Program(MIP) with Python | Data Science Tutorials\" \/>\n<meta property=\"og:description\" content=\"Mixed Integer Programming (MIP) tutorial in Python \u2014 model integer variables and solve discrete optimization problems step by step.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/kindsonthegenius.com\/data-science\/integer-optimization-mixed-integer-programmip-with-python\/\" \/>\n<meta property=\"og:site_name\" content=\"Data Science Tutorials\" \/>\n<meta property=\"article:published_time\" content=\"2026-07-03T21:25:34+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2026-07-03T21:27:52+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/kindsonthegenius.com\/data-science\/wp-content\/uploads\/2021\/01\/Screenshot-2021-01-20-at-12.04.29.png\" \/>\n\t<meta property=\"og:image:width\" content=\"839\" \/>\n\t<meta property=\"og:image:height\" content=\"667\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/png\" \/>\n<meta name=\"author\" content=\"kindsonthegenius\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"kindsonthegenius\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"3 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\\\/\\\/kindsonthegenius.com\\\/data-science\\\/integer-optimization-mixed-integer-programmip-with-python\\\/#article\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/kindsonthegenius.com\\\/data-science\\\/integer-optimization-mixed-integer-programmip-with-python\\\/\"},\"author\":{\"name\":\"kindsonthegenius\",\"@id\":\"https:\\\/\\\/kindsonthegenius.com\\\/data-science\\\/#\\\/schema\\\/person\\\/31dd138b160587ab3ea3c4746c59bfbc\"},\"headline\":\"Integer Optimization &#8211; Mixed Integer Program(MIP) with Python\",\"datePublished\":\"2026-07-03T21:25:34+00:00\",\"dateModified\":\"2026-07-03T21:27:52+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/kindsonthegenius.com\\\/data-science\\\/integer-optimization-mixed-integer-programmip-with-python\\\/\"},\"wordCount\":420,\"commentCount\":0,\"image\":{\"@id\":\"https:\\\/\\\/kindsonthegenius.com\\\/data-science\\\/integer-optimization-mixed-integer-programmip-with-python\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/kindsonthegenius.com\\\/data-science\\\/wp-content\\\/uploads\\\/2021\\\/01\\\/Screenshot-2021-01-20-at-12.04.29.png\",\"keywords\":[\"Linear Optimization\",\"MIP\",\"Mixed Integer Program\",\"Solver\"],\"articleSection\":[\"Linear Programming\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\\\/\\\/kindsonthegenius.com\\\/data-science\\\/integer-optimization-mixed-integer-programmip-with-python\\\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/kindsonthegenius.com\\\/data-science\\\/integer-optimization-mixed-integer-programmip-with-python\\\/\",\"url\":\"https:\\\/\\\/kindsonthegenius.com\\\/data-science\\\/integer-optimization-mixed-integer-programmip-with-python\\\/\",\"name\":\"Integer Optimization &#8211; Mixed Integer Program(MIP) with Python | Data Science Tutorials\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/kindsonthegenius.com\\\/data-science\\\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\\\/\\\/kindsonthegenius.com\\\/data-science\\\/integer-optimization-mixed-integer-programmip-with-python\\\/#primaryimage\"},\"image\":{\"@id\":\"https:\\\/\\\/kindsonthegenius.com\\\/data-science\\\/integer-optimization-mixed-integer-programmip-with-python\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/kindsonthegenius.com\\\/data-science\\\/wp-content\\\/uploads\\\/2021\\\/01\\\/Screenshot-2021-01-20-at-12.04.29.png\",\"datePublished\":\"2026-07-03T21:25:34+00:00\",\"dateModified\":\"2026-07-03T21:27:52+00:00\",\"author\":{\"@id\":\"https:\\\/\\\/kindsonthegenius.com\\\/data-science\\\/#\\\/schema\\\/person\\\/31dd138b160587ab3ea3c4746c59bfbc\"},\"description\":\"Mixed Integer Programming (MIP) tutorial in Python \u2014 model integer variables and solve discrete optimization problems step by step.\",\"breadcrumb\":{\"@id\":\"https:\\\/\\\/kindsonthegenius.com\\\/data-science\\\/integer-optimization-mixed-integer-programmip-with-python\\\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/kindsonthegenius.com\\\/data-science\\\/integer-optimization-mixed-integer-programmip-with-python\\\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/kindsonthegenius.com\\\/data-science\\\/integer-optimization-mixed-integer-programmip-with-python\\\/#primaryimage\",\"url\":\"https:\\\/\\\/kindsonthegenius.com\\\/data-science\\\/wp-content\\\/uploads\\\/2021\\\/01\\\/Screenshot-2021-01-20-at-12.04.29.png\",\"contentUrl\":\"https:\\\/\\\/kindsonthegenius.com\\\/data-science\\\/wp-content\\\/uploads\\\/2021\\\/01\\\/Screenshot-2021-01-20-at-12.04.29.png\"},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/kindsonthegenius.com\\\/data-science\\\/integer-optimization-mixed-integer-programmip-with-python\\\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\\\/\\\/kindsonthegenius.com\\\/data-science\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Integer Optimization &#8211; Mixed Integer Program(MIP) with Python\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/kindsonthegenius.com\\\/data-science\\\/#website\",\"url\":\"https:\\\/\\\/kindsonthegenius.com\\\/data-science\\\/\",\"name\":\"Data Science Tutorials\",\"description\":\"Data Science and Machine Learning in Python and R\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\\\/\\\/kindsonthegenius.com\\\/data-science\\\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Person\",\"@id\":\"https:\\\/\\\/kindsonthegenius.com\\\/data-science\\\/#\\\/schema\\\/person\\\/31dd138b160587ab3ea3c4746c59bfbc\",\"name\":\"kindsonthegenius\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/b9d710de456c3d85e5614c3a6992fa3d527425e2ab32b8bd5d85bfbaa235004b?s=96&d=wavatar&r=g\",\"url\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/b9d710de456c3d85e5614c3a6992fa3d527425e2ab32b8bd5d85bfbaa235004b?s=96&d=wavatar&r=g\",\"contentUrl\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/b9d710de456c3d85e5614c3a6992fa3d527425e2ab32b8bd5d85bfbaa235004b?s=96&d=wavatar&r=g\",\"caption\":\"kindsonthegenius\"},\"url\":\"https:\\\/\\\/kindsonthegenius.com\\\/data-science\\\/author\\\/kindsonthegenius-3\\\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Integer Optimization &#8211; Mixed Integer Program(MIP) with Python | Data Science Tutorials","description":"Mixed Integer Programming (MIP) tutorial in Python \u2014 model integer variables and solve discrete optimization problems step by step.","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/kindsonthegenius.com\/data-science\/integer-optimization-mixed-integer-programmip-with-python\/","og_locale":"en_US","og_type":"article","og_title":"Integer Optimization &#8211; Mixed Integer Program(MIP) with Python | Data Science Tutorials","og_description":"Mixed Integer Programming (MIP) tutorial in Python \u2014 model integer variables and solve discrete optimization problems step by step.","og_url":"https:\/\/kindsonthegenius.com\/data-science\/integer-optimization-mixed-integer-programmip-with-python\/","og_site_name":"Data Science Tutorials","article_published_time":"2026-07-03T21:25:34+00:00","article_modified_time":"2026-07-03T21:27:52+00:00","og_image":[{"width":839,"height":667,"url":"https:\/\/kindsonthegenius.com\/data-science\/wp-content\/uploads\/2021\/01\/Screenshot-2021-01-20-at-12.04.29.png","type":"image\/png"}],"author":"kindsonthegenius","twitter_card":"summary_large_image","twitter_misc":{"Written by":"kindsonthegenius","Est. reading time":"3 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/kindsonthegenius.com\/data-science\/integer-optimization-mixed-integer-programmip-with-python\/#article","isPartOf":{"@id":"https:\/\/kindsonthegenius.com\/data-science\/integer-optimization-mixed-integer-programmip-with-python\/"},"author":{"name":"kindsonthegenius","@id":"https:\/\/kindsonthegenius.com\/data-science\/#\/schema\/person\/31dd138b160587ab3ea3c4746c59bfbc"},"headline":"Integer Optimization &#8211; Mixed Integer Program(MIP) with Python","datePublished":"2026-07-03T21:25:34+00:00","dateModified":"2026-07-03T21:27:52+00:00","mainEntityOfPage":{"@id":"https:\/\/kindsonthegenius.com\/data-science\/integer-optimization-mixed-integer-programmip-with-python\/"},"wordCount":420,"commentCount":0,"image":{"@id":"https:\/\/kindsonthegenius.com\/data-science\/integer-optimization-mixed-integer-programmip-with-python\/#primaryimage"},"thumbnailUrl":"https:\/\/kindsonthegenius.com\/data-science\/wp-content\/uploads\/2021\/01\/Screenshot-2021-01-20-at-12.04.29.png","keywords":["Linear Optimization","MIP","Mixed Integer Program","Solver"],"articleSection":["Linear Programming"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/kindsonthegenius.com\/data-science\/integer-optimization-mixed-integer-programmip-with-python\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/kindsonthegenius.com\/data-science\/integer-optimization-mixed-integer-programmip-with-python\/","url":"https:\/\/kindsonthegenius.com\/data-science\/integer-optimization-mixed-integer-programmip-with-python\/","name":"Integer Optimization &#8211; Mixed Integer Program(MIP) with Python | Data Science Tutorials","isPartOf":{"@id":"https:\/\/kindsonthegenius.com\/data-science\/#website"},"primaryImageOfPage":{"@id":"https:\/\/kindsonthegenius.com\/data-science\/integer-optimization-mixed-integer-programmip-with-python\/#primaryimage"},"image":{"@id":"https:\/\/kindsonthegenius.com\/data-science\/integer-optimization-mixed-integer-programmip-with-python\/#primaryimage"},"thumbnailUrl":"https:\/\/kindsonthegenius.com\/data-science\/wp-content\/uploads\/2021\/01\/Screenshot-2021-01-20-at-12.04.29.png","datePublished":"2026-07-03T21:25:34+00:00","dateModified":"2026-07-03T21:27:52+00:00","author":{"@id":"https:\/\/kindsonthegenius.com\/data-science\/#\/schema\/person\/31dd138b160587ab3ea3c4746c59bfbc"},"description":"Mixed Integer Programming (MIP) tutorial in Python \u2014 model integer variables and solve discrete optimization problems step by step.","breadcrumb":{"@id":"https:\/\/kindsonthegenius.com\/data-science\/integer-optimization-mixed-integer-programmip-with-python\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/kindsonthegenius.com\/data-science\/integer-optimization-mixed-integer-programmip-with-python\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/kindsonthegenius.com\/data-science\/integer-optimization-mixed-integer-programmip-with-python\/#primaryimage","url":"https:\/\/kindsonthegenius.com\/data-science\/wp-content\/uploads\/2021\/01\/Screenshot-2021-01-20-at-12.04.29.png","contentUrl":"https:\/\/kindsonthegenius.com\/data-science\/wp-content\/uploads\/2021\/01\/Screenshot-2021-01-20-at-12.04.29.png"},{"@type":"BreadcrumbList","@id":"https:\/\/kindsonthegenius.com\/data-science\/integer-optimization-mixed-integer-programmip-with-python\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/kindsonthegenius.com\/data-science\/"},{"@type":"ListItem","position":2,"name":"Integer Optimization &#8211; Mixed Integer Program(MIP) with Python"}]},{"@type":"WebSite","@id":"https:\/\/kindsonthegenius.com\/data-science\/#website","url":"https:\/\/kindsonthegenius.com\/data-science\/","name":"Data Science Tutorials","description":"Data Science and Machine Learning in Python and R","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/kindsonthegenius.com\/data-science\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Person","@id":"https:\/\/kindsonthegenius.com\/data-science\/#\/schema\/person\/31dd138b160587ab3ea3c4746c59bfbc","name":"kindsonthegenius","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/secure.gravatar.com\/avatar\/b9d710de456c3d85e5614c3a6992fa3d527425e2ab32b8bd5d85bfbaa235004b?s=96&d=wavatar&r=g","url":"https:\/\/secure.gravatar.com\/avatar\/b9d710de456c3d85e5614c3a6992fa3d527425e2ab32b8bd5d85bfbaa235004b?s=96&d=wavatar&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/b9d710de456c3d85e5614c3a6992fa3d527425e2ab32b8bd5d85bfbaa235004b?s=96&d=wavatar&r=g","caption":"kindsonthegenius"},"url":"https:\/\/kindsonthegenius.com\/data-science\/author\/kindsonthegenius-3\/"}]}},"jetpack_featured_media_url":"","_links":{"self":[{"href":"https:\/\/kindsonthegenius.com\/data-science\/wp-json\/wp\/v2\/posts\/159","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/kindsonthegenius.com\/data-science\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/kindsonthegenius.com\/data-science\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/kindsonthegenius.com\/data-science\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/kindsonthegenius.com\/data-science\/wp-json\/wp\/v2\/comments?post=159"}],"version-history":[{"count":5,"href":"https:\/\/kindsonthegenius.com\/data-science\/wp-json\/wp\/v2\/posts\/159\/revisions"}],"predecessor-version":[{"id":340,"href":"https:\/\/kindsonthegenius.com\/data-science\/wp-json\/wp\/v2\/posts\/159\/revisions\/340"}],"wp:attachment":[{"href":"https:\/\/kindsonthegenius.com\/data-science\/wp-json\/wp\/v2\/media?parent=159"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/kindsonthegenius.com\/data-science\/wp-json\/wp\/v2\/categories?post=159"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/kindsonthegenius.com\/data-science\/wp-json\/wp\/v2\/tags?post=159"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}