title: OR-tools: Constraining interval variables search procedure to be more compact
body: <p>I have been trying to modelize the job-shop problem with the following setup:</p>
  <ol>
  <li>Variables &amp; constraints:
  For each task:</li>
  </ol>
  <ul>
  <li>job-level variables: start (NewIntVar), end(NewIntVar), interval(NewIntervalVar)</li>
  <li>tardiness = max(task_end - task_due_date, 0)</li>
  <li>precedence constraint:</li>
  </ul>
  <pre><code>for task_before, task_after in tasks_precedence:
      model.Add(start[task_after] &gt;= end[task_before])
  </code></pre>
  <p>For each machine:</p>
  <ul>
  <li>No overlap for all &quot;intervals&quot; that could be produced on the machine</li>
  </ul>
  <pre><code>for machine in machines:
      model.AddNoOverlap([intervals[machine, task] for task in machine_tasks[machine])
  </code></pre>
  <ol start="2">
  <li>Objective: Minimising the tardiness for each job</li>
  </ol>
  <pre><code>model.Minimize(sum(tasks_tardiness))
  </code></pre>
  <p>However, when I compute the results within a given time-limit and no optimality is proven yet, some of the interval are very poorly positioned.</p>
  <p>For instance: Schedule is not compact and the last task (red block) is very far from its due date.
  While it meets all of the specified constraint... It still does not make sense to place the task at this position.</p>
  <p>Any idea on how to improve the search procedure and enables the model to infer better solutions ?</p>
  <p><a href="https://i.stack.imgur.com/GH5tB.png" rel="nofollow noreferrer">enter image description here</a></p>