[OR-Tools 스터디] Using Arrays to Define a Model
이전 섹션에서는 개별적으로 선언되어있는 몇개의 변수와 constraint들로 어떻게 MIP를 푸는지에 대해 보여주었다. 더 큰 problem들은 배열에 대해 반복문으로 변수와 constraint들을 정의하는 것이 더욱 편리하다. Example 이전 MIP 예시들과 같은 방법을 사용하지만 이 케이스의 경우 반복문에 배열을 사용함. from ortools.linear_solver import pywraplp def create_data_model(): data = {} data['constraint_coeffs'] = [ [5, 7, 9, 2, 1], [18, 4, -9, 10, 12], [4, 7, 3, 8, 5], [5, 13, 16, 3, -7], ] data['bounds'] = [250, 285, ..
2023. 2. 14.