title: facility location with OR-tools
body: <p>i'm trying to write facility location MIP solution with OR tools. i translated a Scip solution, from here:</p>
  <p><a href="https://scipbook.readthedocs.io/en/latest/flp.html" rel="nofollow noreferrer">https://scipbook.readthedocs.io/en/latest/flp.html</a>
  but im getting a table with only zeros means a no solution..
  is the framing of the problem or/and the way I'm using OR-tools here supposed to work?</p>
  <pre><code>    def or_tools_scip_mine(facilities, customers, time_limit=None):
  
      import numpy
      import datetime
  
      if time_limit is None:
          time_limit = 1000 * 60  # 1 minute
  
  
      solver = pywraplp.Solver.CreateSolver('SCIP')
  
  
      customer_count = range(len(customers))
      facility_count = range(len(facilities))
      x =[[] for _ in range(len(customers))]
      y = []
      facility_capacities=[facilities[i][2] for i in facility_count]
      facility_setup_costs = [facilities[i][1] for i in facility_count]
      demands=[customers[i][1] for i in customer_count]
      c=dist_matrix(facilities,customers)
  
      for j in facility_count:
          y.append(solver.BoolVar(&quot;y(%s)&quot; % j))
          for i in customer_count:
              x[i].append(solver.BoolVar(&quot;x(%s,%s)&quot; % (i, j)))
  
      for i in customer_count:
          solver.Add(solver.Sum(x[i][j] for j in facility_count) &lt;= demands[i])#, &quot;Demand(%s)&quot; % i
      for j in facility_count:
          solver.Add(solver.Sum(x[i][j] for i in customer_count) &lt;= facility_capacities[j] * y[j])#, &quot;Capacity(%s)&quot; % j)
      for j in facility_count:
          for i in customer_count:
              solver.Add(x[i][j] &lt;= demands[i] * y[j])
      a=solver.Sum((facility_setup_costs[j] * y[j] for j in facility_count))
      b=solver.Sum((c[i, j] * x[i][j] for i in customer_count for j in facility_count))
      func_=solver.Sum([a,b])
      solver.Minimize(func_)
  
      solver.set_time_limit(time_limit)
      result_status = solver.Solve()
      print(result_status)
      val = solver.Objective().Value()
  
      x_val = [[] for _ in range(len(customers))]  
      solution = []
      for j in range(len(facilities)):
          for i in range(len(customers)):
              x_val[i].append(int(x[i][j].solution_value()))
      x_val = numpy.array(x_val)
      for j in range(len(customers)):
          solution.append(numpy.where(x_val[:, j] == 1)[0][0])
  
      return val, solution
  
  the  Error:
  solution.append(numpy.where(x_val[:, j] == 1)[0][0])
  IndexError: index 0 is out of bounds for axis 0 with size 0
  </code></pre>