title: Minimize cost given pickup and delivery with OR tools
body: <p>I have the following problem:</p>
  
  <p>I have:</p>
  
  <pre><code>data["time_matrix"] # 2D list
  data["pickups_deliveries"] # list of tuples, containing (start_node_index, end_node_indes)
  data["vehicle_costs"] # list of 2D list of cost of route per vehicle 
  </code></pre>
  
  <p>My goal is to complete all the deliveries on time (let's assume that it is possible) at minimized cost.</p>
  
  <p>I know that I would need to create a <code>time_dimension</code>, since I need to keep track of cumulative time to make sure that I can deliver within given time windows.</p>
  
  <p>However, I don't understand how to minimize cost?</p>
  
  <p>When I set:</p>
  
  <pre><code>routing.SetArcCostEvaluatorOfAllVehicles(transit_callback_index)
  </code></pre>
  
  <p>The <code>transit_callback_index</code> that I pass would be calculated based on <code>data["time_matrix"]</code></p>
  
  <p>How can I specify the <code>data["vehicle_costs"]</code>? And tell the solver to minimize it?</p>
  
  <p>I looked at this issue: <a href="https://github.com/google/or-tools/issues/1045" rel="nofollow noreferrer">https://github.com/google/or-tools/issues/1045</a>, but it appears to me that in that case <code>cost_matrix</code> is used instead of <code>distance_matrix</code> (or <code>time_matrix</code>) not in conjunction with.</p>
  
  <p>I mostly worked of this example: <a href="https://developers.google.com/optimization/routing/vrptw" rel="nofollow noreferrer">Time Window Constraints</a></p>
  
  <p>I am looking for some pointers and suggestions. Please let me know if I need to add more details or provide a concrete example.</p>