a = [-1, 0, 1]
b = [0, -1, 1]
c = [0, 0, 1]
tocke = [(1, 2), (3, -2), (4, 0)]
p = MixedIntegerLinearProgram(maximization=True)
p.set_objective(p['k'])
for xi, yi in tocke:
for ai, bi, ci in zip(a, b, c):
p.add_constraint(ai * (p['k'] * xi + p['x']) + bi * (p['k'] * yi + p['y']) <= ci)
p.solve()
0.2000000000004
k, x, y = p.get_values(p['k']), p.get_values(p['x']), p.get_values(p['y'])
k, x, y
(0.2000000000004, -0.20000000000039997, 0.3999999999988)