text_plain_output_1.png
from gekko import GEKKO

import pandas as pd # data processing, CSV file I/O (e.g. pd.read_csv)

import time

import numpy as np
import pandas as pd
from gekko import GEKKO
import time
m = GEKKO()
m.options.SOLVER = 1
m.solver_options = ['minlp_maximum_iterations 500', 'minlp_max_iter_with_int_sol 10', 'minlp_as_nlp 0', 'nlp_maximum_iterations 50', 'minlp_branch_method 1', 'minlp_integer_tol 0.05', 'minlp_gap_tol 0.01']
df = pd.read_csv('../input/junkchanged/cloulet_dataset.csv')
max_elementb = df['Bandwidth'].max()
max_elementc = df['Capacity'].max()
print('----', max_elementb, max_elementc)
start_time = time.time()
main_allocation = m.Var(value=max_elementc, lb=max_elementc, ub=max_elementc)
others_allocation = m.Var(value=max_elementc, lb=0, ub=max_elementb)
b = m.Var(value=max_elementb, lb=max_elementb, ub=max_elementb)
m.Equation(main_allocation * others_allocation <= b)
m.Maximize(main_allocation + others_allocation)
m.solve(disp=False)
print('main_allocation: ' + str(main_allocation.value))
print('others_allocation: ' + str(others_allocation.value))
print('Total acceptance: ' + str(-m.options.objfcnval))
print('--- %s seconds ---' % (time.time() - start_time))