Python Pulp using with Matrices

后端 未结 2 1207
孤独总比滥情好
孤独总比滥情好 2021-02-07 07:39

I am still very new to Python, after years and years of Matlab. I am trying to use Pulp to set up an integer linear program.

Given an array of numbers:

{         


        
2条回答
  •  礼貌的吻别
    2021-02-07 08:04

    For the first question, you can do it like this in some other problem.

    students = range(96)
    group = range(24)
    
    var = lp.LpVariable.dicts("if_i_in_group_j", ((i, j) for i in students for j in group),cat='binary')
    

提交回复
热议问题