title: When to use sum v.s. lpSum using pulp?
body: <p>In the case study &quot;<a href="https://coin-or.github.io/pulp/CaseStudies/a_set_partitioning_problem.html#" rel="nofollow noreferrer">A Set Partitioning Problem</a>&quot; in the pulp documentation &quot;sum&quot; is used to express the constraints, for example:</p>
  <pre><code>#A guest must seated at one and only one table
  for guest in guests:
      seating_model += sum([x[table] for table in possible_tables
                                  if guest in table]) == 1, &quot;Must_seat_%s&quot;%guest
  </code></pre>
  <p>Whereas &quot;lpSum&quot; seems to be used otherwise. Consider for example the following constraint in the case study <a href="https://coin-or.github.io/pulp/CaseStudies/a_transportation_problem.html" rel="nofollow noreferrer">A Transportation Problem</a></p>
  <pre><code>for b in Bars:
      prob += lpSum([vars[w][b] for w in Warehouses])&gt;=demand[b], &quot;Sum_of_Products_into_Bar%s&quot;%b
  </code></pre>
  <p>Why is &quot;sum&quot; used in the first example? And when to use &quot;sum&quot; v.s. &quot;lpSum&quot;?</p>