Skip to content

Commit

Permalink
Update documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
actions-user committed Feb 19, 2025
1 parent 2c675ed commit b1ac565
Show file tree
Hide file tree
Showing 39 changed files with 153 additions and 139 deletions.
6 changes: 3 additions & 3 deletions CaseStudies/a_blending_problem.html
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>A Blending Problem &mdash; PuLP 2.9.0 documentation</title>
<link rel="stylesheet" type="text/css" href="../_static/pygments.css?v=fa44fd50" />
<link rel="stylesheet" type="text/css" href="../_static/pygments.css?v=03e43079" />
<link rel="stylesheet" type="text/css" href="../_static/css/theme.css?v=e59714d7" />


Expand Down Expand Up @@ -212,7 +212,7 @@ <h3>Solution to Simplified Problem<a class="headerlink" href="#solution-to-simpl
</div>
<p>Then you will import PuLP’s functions for use in your code:</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="c1"># Import PuLP modeler functions</span>
<span class="kn">from</span> <span class="nn">pulp</span> <span class="kn">import</span> <span class="o">*</span>
<span class="kn">from</span><span class="w"> </span><span class="nn">pulp</span><span class="w"> </span><span class="kn">import</span> <span class="o">*</span>
</pre></div>
</div>
<p>A variable called <code class="docutils literal notranslate"><span class="pre">prob</span></code> (although its name is not important) is
Expand Down Expand Up @@ -409,7 +409,7 @@ <h3>Solution to Full Problem<a class="headerlink" href="#solution-to-full-proble
<span class="sd">&quot;&quot;&quot;</span>

<span class="c1"># Import PuLP modeler functions</span>
<span class="kn">from</span> <span class="nn">pulp</span> <span class="kn">import</span> <span class="o">*</span>
<span class="kn">from</span><span class="w"> </span><span class="nn">pulp</span><span class="w"> </span><span class="kn">import</span> <span class="o">*</span>
</pre></div>
</div>
<p>Next, before the <code class="docutils literal notranslate"><span class="pre">prob</span></code> variable or type of problem are defined,
Expand Down
6 changes: 3 additions & 3 deletions CaseStudies/a_set_partitioning_problem.html
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>A Set Partitioning Problem &mdash; PuLP 2.9.0 documentation</title>
<link rel="stylesheet" type="text/css" href="../_static/pygments.css?v=fa44fd50" />
<link rel="stylesheet" type="text/css" href="../_static/pygments.css?v=03e43079" />
<link rel="stylesheet" type="text/css" href="../_static/css/theme.css?v=e59714d7" />


Expand Down Expand Up @@ -146,14 +146,14 @@
<span class="sd">Authors: Stuart Mitchell 2009</span>
<span class="sd">&quot;&quot;&quot;</span>

<span class="kn">import</span> <span class="nn">pulp</span>
<span class="kn">import</span><span class="w"> </span><span class="nn">pulp</span>

<span class="n">max_tables</span> <span class="o">=</span> <span class="mi">5</span>
<span class="n">max_table_size</span> <span class="o">=</span> <span class="mi">4</span>
<span class="n">guests</span> <span class="o">=</span> <span class="s2">&quot;A B C D E F G I J K L M N O P Q R&quot;</span><span class="o">.</span><span class="n">split</span><span class="p">()</span>


<span class="k">def</span> <span class="nf">happiness</span><span class="p">(</span><span class="n">table</span><span class="p">):</span>
<span class="k">def</span><span class="w"> </span><span class="nf">happiness</span><span class="p">(</span><span class="n">table</span><span class="p">):</span>
<span class="w"> </span><span class="sd">&quot;&quot;&quot;</span>
<span class="sd"> Find the happiness of the table</span>
<span class="sd"> - by calculating the maximum distance between the letters</span>
Expand Down
4 changes: 2 additions & 2 deletions CaseStudies/a_sudoku_problem.html
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>A Sudoku Problem formulated as an LP &mdash; PuLP 2.9.0 documentation</title>
<link rel="stylesheet" type="text/css" href="../_static/pygments.css?v=fa44fd50" />
<link rel="stylesheet" type="text/css" href="../_static/pygments.css?v=03e43079" />
<link rel="stylesheet" type="text/css" href="../_static/css/theme.css?v=e59714d7" />


Expand Down Expand Up @@ -168,7 +168,7 @@ <h2>Solution<a class="headerlink" href="#solution" title="Link to this heading">
<span class="sd">&quot;&quot;&quot;</span>

<span class="c1"># Import PuLP modeler functions</span>
<span class="kn">from</span> <span class="nn">pulp</span> <span class="kn">import</span> <span class="o">*</span>
<span class="kn">from</span><span class="w"> </span><span class="nn">pulp</span><span class="w"> </span><span class="kn">import</span> <span class="o">*</span>
</pre></div>
</div>
<p>In the unique case of the sudoku problem, the row names, column names and variable option values are all the exact same list of numbers from 1 to 9.</p>
Expand Down
16 changes: 8 additions & 8 deletions CaseStudies/a_transportation_problem.html
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>A Transportation Problem &mdash; PuLP 2.9.0 documentation</title>
<link rel="stylesheet" type="text/css" href="../_static/pygments.css?v=fa44fd50" />
<link rel="stylesheet" type="text/css" href="../_static/pygments.css?v=03e43079" />
<link rel="stylesheet" type="text/css" href="../_static/css/theme.css?v=e59714d7" />


Expand Down Expand Up @@ -253,7 +253,7 @@ <h2>PuLP Model<a class="headerlink" href="#pulp-model" title="Link to this headi
<span class="sd">&quot;&quot;&quot;</span>

<span class="c1"># Import PuLP modeler functions</span>
<span class="kn">from</span> <span class="nn">pulp</span> <span class="kn">import</span> <span class="o">*</span>
<span class="kn">from</span><span class="w"> </span><span class="nn">pulp</span><span class="w"> </span><span class="kn">import</span> <span class="o">*</span>
</pre></div>
</div>
<p>The start of the formulation is a simple definition of the nodes and their limits/capacities. The node names are put into lists, and their associated capacities are put into dictionaries with the node names as the reference keys:</p>
Expand Down Expand Up @@ -452,12 +452,12 @@ <h2>Presentation of Solution and Analysis<a class="headerlink" href="#presentati
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="n">TRANSPORTATION</span> <span class="n">SOLUTION</span> <span class="o">--</span> <span class="n">Non</span><span class="o">-</span><span class="n">zero</span> <span class="n">shipments</span>
<span class="n">TotalCost</span> <span class="o">=</span> <span class="n">____</span>

<span class="n">Ship</span> <span class="n">___</span> <span class="n">crates</span> <span class="n">of</span> <span class="n">beer</span> <span class="kn">from</span> <span class="nn">warehouse</span> <span class="n">A</span> <span class="n">to</span> <span class="n">pub</span> <span class="mi">1</span>
<span class="n">Ship</span> <span class="n">___</span> <span class="n">crates</span> <span class="n">of</span> <span class="n">beer</span> <span class="kn">from</span> <span class="nn">warehouse</span> <span class="n">A</span> <span class="n">to</span> <span class="n">pub</span> <span class="mi">5</span>
<span class="n">Ship</span> <span class="n">___</span> <span class="n">crates</span> <span class="n">of</span> <span class="n">beer</span> <span class="kn">from</span> <span class="nn">warehouse</span> <span class="n">B</span> <span class="n">to</span> <span class="n">pub</span> <span class="mi">1</span>
<span class="n">Ship</span> <span class="n">___</span> <span class="n">crates</span> <span class="n">of</span> <span class="n">beer</span> <span class="kn">from</span> <span class="nn">warehouse</span> <span class="n">B</span> <span class="n">to</span> <span class="n">pub</span> <span class="mi">2</span>
<span class="n">Ship</span> <span class="n">___</span> <span class="n">crates</span> <span class="n">of</span> <span class="n">beer</span> <span class="kn">from</span> <span class="nn">warehouse</span> <span class="n">B</span> <span class="n">to</span> <span class="n">pub</span> <span class="mi">3</span>
<span class="n">Ship</span> <span class="n">___</span> <span class="n">crates</span> <span class="n">of</span> <span class="n">beer</span> <span class="kn">from</span> <span class="nn">warehouse</span> <span class="n">B</span> <span class="n">to</span> <span class="n">pub</span> <span class="mi">4</span>
<span class="n">Ship</span> <span class="n">___</span> <span class="n">crates</span> <span class="n">of</span> <span class="n">beer</span> <span class="kn">from</span><span class="w"> </span><span class="nn">warehouse</span> <span class="n">A</span> <span class="n">to</span> <span class="n">pub</span> <span class="mi">1</span>
<span class="n">Ship</span> <span class="n">___</span> <span class="n">crates</span> <span class="n">of</span> <span class="n">beer</span> <span class="kn">from</span><span class="w"> </span><span class="nn">warehouse</span> <span class="n">A</span> <span class="n">to</span> <span class="n">pub</span> <span class="mi">5</span>
<span class="n">Ship</span> <span class="n">___</span> <span class="n">crates</span> <span class="n">of</span> <span class="n">beer</span> <span class="kn">from</span><span class="w"> </span><span class="nn">warehouse</span> <span class="n">B</span> <span class="n">to</span> <span class="n">pub</span> <span class="mi">1</span>
<span class="n">Ship</span> <span class="n">___</span> <span class="n">crates</span> <span class="n">of</span> <span class="n">beer</span> <span class="kn">from</span><span class="w"> </span><span class="nn">warehouse</span> <span class="n">B</span> <span class="n">to</span> <span class="n">pub</span> <span class="mi">2</span>
<span class="n">Ship</span> <span class="n">___</span> <span class="n">crates</span> <span class="n">of</span> <span class="n">beer</span> <span class="kn">from</span><span class="w"> </span><span class="nn">warehouse</span> <span class="n">B</span> <span class="n">to</span> <span class="n">pub</span> <span class="mi">3</span>
<span class="n">Ship</span> <span class="n">___</span> <span class="n">crates</span> <span class="n">of</span> <span class="n">beer</span> <span class="kn">from</span><span class="w"> </span><span class="nn">warehouse</span> <span class="n">B</span> <span class="n">to</span> <span class="n">pub</span> <span class="mi">4</span>
</pre></div>
</div>
<p>This information gives rise to the following management summary:</p>
Expand Down
6 changes: 3 additions & 3 deletions CaseStudies/a_two_stage_production_planning_problem.html
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>A Two Stage Production Planning Problem &mdash; PuLP 2.9.0 documentation</title>
<link rel="stylesheet" type="text/css" href="../_static/pygments.css?v=fa44fd50" />
<link rel="stylesheet" type="text/css" href="../_static/pygments.css?v=03e43079" />
<link rel="stylesheet" type="text/css" href="../_static/css/theme.css?v=e59714d7" />


Expand Down Expand Up @@ -104,7 +104,7 @@ <h1>A Two Stage Production Planning Problem<a class="headerlink" href="#a-two-st
</ul>
<p>The uncertainty is expressed as one of four possible scenarios, each with equal probability.</p>
<p>We begin by importing the <cite>PuLP</cite> package.</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="kn">import</span> <span class="nn">pulp</span>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="kn">import</span><span class="w"> </span><span class="nn">pulp</span>
</pre></div>
</div>
<p>Next, we will read in the data. Here, we read in the data as vectors.
Expand Down Expand Up @@ -228,7 +228,7 @@ <h1>A Two Stage Production Planning Problem<a class="headerlink" href="#a-two-st
<span class="sd">- **Nonnegativity:** $W, P \ge 0$</span>
<span class="sd">&quot;&quot;&quot;</span>

<span class="kn">import</span> <span class="nn">pulp</span>
<span class="kn">import</span><span class="w"> </span><span class="nn">pulp</span>

<span class="c1"># parameters</span>
<span class="n">products</span> <span class="o">=</span> <span class="p">[</span><span class="s2">&quot;wrenches&quot;</span><span class="p">,</span> <span class="s2">&quot;pliers&quot;</span><span class="p">]</span>
Expand Down
2 changes: 1 addition & 1 deletion CaseStudies/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Case Studies &mdash; PuLP 2.9.0 documentation</title>
<link rel="stylesheet" type="text/css" href="../_static/pygments.css?v=fa44fd50" />
<link rel="stylesheet" type="text/css" href="../_static/pygments.css?v=03e43079" />
<link rel="stylesheet" type="text/css" href="../_static/css/theme.css?v=e59714d7" />


Expand Down
10 changes: 7 additions & 3 deletions _static/js/versions.js
Original file line number Diff line number Diff line change
@@ -1,17 +1,21 @@
const themeFlyoutDisplay = "hidden";
const themeVersionSelector = "True";
const themeLanguageSelector = "True";
const themeVersionSelector = true;
const themeLanguageSelector = true;

if (themeFlyoutDisplay === "attached") {
function renderLanguages(config) {
if (!config.projects.translations.length) {
return "";
}

// Insert the current language to the options on the selector
let languages = config.projects.translations.concat(config.projects.current);
languages = languages.sort((a, b) => a.language.name.localeCompare(b.language.name));

const languagesHTML = `
<dl>
<dt>Languages</dt>
${config.projects.translations
${languages
.map(
(translation) => `
<dd ${translation.slug == config.projects.current.slug ? 'class="rtd-current-item"' : ""}>
Expand Down
66 changes: 33 additions & 33 deletions _static/pygments.css
Original file line number Diff line number Diff line change
Expand Up @@ -6,70 +6,70 @@ span.linenos.special { color: #000000; background-color: #ffffc0; padding-left:
.highlight .hll { background-color: #ffffcc }
.highlight { background: #eeffcc; }
.highlight .c { color: #408090; font-style: italic } /* Comment */
.highlight .err { border: 1px solid #FF0000 } /* Error */
.highlight .err { border: 1px solid #F00 } /* Error */
.highlight .k { color: #007020; font-weight: bold } /* Keyword */
.highlight .o { color: #666666 } /* Operator */
.highlight .o { color: #666 } /* Operator */
.highlight .ch { color: #408090; font-style: italic } /* Comment.Hashbang */
.highlight .cm { color: #408090; font-style: italic } /* Comment.Multiline */
.highlight .cp { color: #007020 } /* Comment.Preproc */
.highlight .cpf { color: #408090; font-style: italic } /* Comment.PreprocFile */
.highlight .c1 { color: #408090; font-style: italic } /* Comment.Single */
.highlight .cs { color: #408090; background-color: #fff0f0 } /* Comment.Special */
.highlight .cs { color: #408090; background-color: #FFF0F0 } /* Comment.Special */
.highlight .gd { color: #A00000 } /* Generic.Deleted */
.highlight .ge { font-style: italic } /* Generic.Emph */
.highlight .ges { font-weight: bold; font-style: italic } /* Generic.EmphStrong */
.highlight .gr { color: #FF0000 } /* Generic.Error */
.highlight .gr { color: #F00 } /* Generic.Error */
.highlight .gh { color: #000080; font-weight: bold } /* Generic.Heading */
.highlight .gi { color: #00A000 } /* Generic.Inserted */
.highlight .go { color: #333333 } /* Generic.Output */
.highlight .gp { color: #c65d09; font-weight: bold } /* Generic.Prompt */
.highlight .go { color: #333 } /* Generic.Output */
.highlight .gp { color: #C65D09; font-weight: bold } /* Generic.Prompt */
.highlight .gs { font-weight: bold } /* Generic.Strong */
.highlight .gu { color: #800080; font-weight: bold } /* Generic.Subheading */
.highlight .gt { color: #0044DD } /* Generic.Traceback */
.highlight .gt { color: #04D } /* Generic.Traceback */
.highlight .kc { color: #007020; font-weight: bold } /* Keyword.Constant */
.highlight .kd { color: #007020; font-weight: bold } /* Keyword.Declaration */
.highlight .kn { color: #007020; font-weight: bold } /* Keyword.Namespace */
.highlight .kp { color: #007020 } /* Keyword.Pseudo */
.highlight .kr { color: #007020; font-weight: bold } /* Keyword.Reserved */
.highlight .kt { color: #902000 } /* Keyword.Type */
.highlight .m { color: #208050 } /* Literal.Number */
.highlight .s { color: #4070a0 } /* Literal.String */
.highlight .na { color: #4070a0 } /* Name.Attribute */
.highlight .s { color: #4070A0 } /* Literal.String */
.highlight .na { color: #4070A0 } /* Name.Attribute */
.highlight .nb { color: #007020 } /* Name.Builtin */
.highlight .nc { color: #0e84b5; font-weight: bold } /* Name.Class */
.highlight .no { color: #60add5 } /* Name.Constant */
.highlight .nd { color: #555555; font-weight: bold } /* Name.Decorator */
.highlight .ni { color: #d55537; font-weight: bold } /* Name.Entity */
.highlight .nc { color: #0E84B5; font-weight: bold } /* Name.Class */
.highlight .no { color: #60ADD5 } /* Name.Constant */
.highlight .nd { color: #555; font-weight: bold } /* Name.Decorator */
.highlight .ni { color: #D55537; font-weight: bold } /* Name.Entity */
.highlight .ne { color: #007020 } /* Name.Exception */
.highlight .nf { color: #06287e } /* Name.Function */
.highlight .nf { color: #06287E } /* Name.Function */
.highlight .nl { color: #002070; font-weight: bold } /* Name.Label */
.highlight .nn { color: #0e84b5; font-weight: bold } /* Name.Namespace */
.highlight .nn { color: #0E84B5; font-weight: bold } /* Name.Namespace */
.highlight .nt { color: #062873; font-weight: bold } /* Name.Tag */
.highlight .nv { color: #bb60d5 } /* Name.Variable */
.highlight .nv { color: #BB60D5 } /* Name.Variable */
.highlight .ow { color: #007020; font-weight: bold } /* Operator.Word */
.highlight .w { color: #bbbbbb } /* Text.Whitespace */
.highlight .w { color: #BBB } /* Text.Whitespace */
.highlight .mb { color: #208050 } /* Literal.Number.Bin */
.highlight .mf { color: #208050 } /* Literal.Number.Float */
.highlight .mh { color: #208050 } /* Literal.Number.Hex */
.highlight .mi { color: #208050 } /* Literal.Number.Integer */
.highlight .mo { color: #208050 } /* Literal.Number.Oct */
.highlight .sa { color: #4070a0 } /* Literal.String.Affix */
.highlight .sb { color: #4070a0 } /* Literal.String.Backtick */
.highlight .sc { color: #4070a0 } /* Literal.String.Char */
.highlight .dl { color: #4070a0 } /* Literal.String.Delimiter */
.highlight .sd { color: #4070a0; font-style: italic } /* Literal.String.Doc */
.highlight .s2 { color: #4070a0 } /* Literal.String.Double */
.highlight .se { color: #4070a0; font-weight: bold } /* Literal.String.Escape */
.highlight .sh { color: #4070a0 } /* Literal.String.Heredoc */
.highlight .si { color: #70a0d0; font-style: italic } /* Literal.String.Interpol */
.highlight .sx { color: #c65d09 } /* Literal.String.Other */
.highlight .sa { color: #4070A0 } /* Literal.String.Affix */
.highlight .sb { color: #4070A0 } /* Literal.String.Backtick */
.highlight .sc { color: #4070A0 } /* Literal.String.Char */
.highlight .dl { color: #4070A0 } /* Literal.String.Delimiter */
.highlight .sd { color: #4070A0; font-style: italic } /* Literal.String.Doc */
.highlight .s2 { color: #4070A0 } /* Literal.String.Double */
.highlight .se { color: #4070A0; font-weight: bold } /* Literal.String.Escape */
.highlight .sh { color: #4070A0 } /* Literal.String.Heredoc */
.highlight .si { color: #70A0D0; font-style: italic } /* Literal.String.Interpol */
.highlight .sx { color: #C65D09 } /* Literal.String.Other */
.highlight .sr { color: #235388 } /* Literal.String.Regex */
.highlight .s1 { color: #4070a0 } /* Literal.String.Single */
.highlight .s1 { color: #4070A0 } /* Literal.String.Single */
.highlight .ss { color: #517918 } /* Literal.String.Symbol */
.highlight .bp { color: #007020 } /* Name.Builtin.Pseudo */
.highlight .fm { color: #06287e } /* Name.Function.Magic */
.highlight .vc { color: #bb60d5 } /* Name.Variable.Class */
.highlight .vg { color: #bb60d5 } /* Name.Variable.Global */
.highlight .vi { color: #bb60d5 } /* Name.Variable.Instance */
.highlight .vm { color: #bb60d5 } /* Name.Variable.Magic */
.highlight .fm { color: #06287E } /* Name.Function.Magic */
.highlight .vc { color: #BB60D5 } /* Name.Variable.Class */
.highlight .vg { color: #BB60D5 } /* Name.Variable.Global */
.highlight .vi { color: #BB60D5 } /* Name.Variable.Instance */
.highlight .vm { color: #BB60D5 } /* Name.Variable.Magic */
.highlight .il { color: #208050 } /* Literal.Number.Integer.Long */
Loading

0 comments on commit b1ac565

Please sign in to comment.