I'm using pulp solver to handle an optimization probleme with thousands of variables. The variables are held in arrays ( around 200 arrays) and each arry is a 50 * 50 dimensions.
_t111 = ['xx1', 'xa1', 'xb1', 'xc1', 'xd1', 'xe1', 'xf1', 'xg1', 'xh1', 'xi1', 'xj1', 'xxa1', 'xxb1','xxc1', 'xxd1', 'xxe1', 'xxf1', 'xxg1', 'xxh1', 'xxi1', 'xxj1', 'xxxa1', 'xxxb1', 'xxxc1', 'xxxd1','xxxe1', 'xxxf1', 'xxxg1', 'xxxh1', 'xxxi1', 'xxxj1', 'xxxxa1', 'xxxxb1', 'xxxxc1', 'xxxxd1', 'xxxxe1', 'xxxxf1', 'xxxxg1', 'xxxxh1', 'xxxxi1', 'xxxxj1', 'xxxxxa1', 'xxxxxb1', 'xxxxxc1','xxxxxd1', 'xxxxxe1', 'xxxxxf1', 'xxxxxg1', 'xxxxxh1', 'xxxxxi1', 'xxxxxj1']
t111 = np.array([[LpVariable(f"{i}{j}", cat=LpBinary) for i in _t111] for j in _t111])
I have found this method in a forum. I declare all my _t111, _t112... before the variables t111 t112.. the prob is that it takes me a lot to comple it. I'm sure there is a better way
Some one can help me ?