Search code examples
pythonnonlinear-optimizationgekkoquadratic-programmingnon-convex

Python packages for multi-objective optimization using Successive Quadratic Programming (SQP)


Following are the characteristics of my problem:

Objective function: two non-linear functions and one linear function

Decision variable: two integer variables - can be relaxed as real (thus, problem can be INLP or NLP)

Constraint: three (two bounding constraint and one relationship constraint)

Problem type: non-convex

Solution required: Global optimum

Is there any python solvers to solve the above multi-objective optimization problem using Successive Quadratic Programming (SQP) or Interior Point Methods or other appropriate NLP solution methods?


Solution

  • Here is a simple example of an MINLP solved with Python Gekko and the APOPT solver:

    from gekko import GEKKO
    m = GEKKO() # create GEKKO model
    # create binary variables
    x1 = m.Var(integer=True,lb=0,ub=1) 
    x2 = m.Var(integer=True,lb=0,ub=1)
    m.Minimize(4*x1**2-4*x2*x1**2+x2**2+x1**2-x1+1)
    m.options.SOLVER = 1 # APOPT solver
    m.solve()
    print('x1: ' + str(x1.value[0]))
    print('x2: ' + str(x2.value[0]))
    

    Here is another example with equality and inequality constraints and integer variables (Hock Schittkowski #71 benchmark but with integer variables).

    hs71

    from gekko import GEKKO    
    import numpy as np
    m = GEKKO()
    x = m.Array(m.Var,4,integer=True,value=1,lb=1,ub=5)
    x1,x2,x3,x4 = x
    # change initial values
    x2.value = 5; x3.value = 5
    m.Equation(x1*x2*x3*x4>=25)
    m.Equation(x1**2+x2**2+x3**2+x4**2==40)
    m.Minimize(x1*x4*(x1+x2+x3)+x3)
    m.options.SOLVER=1
    m.solve()
    print('x: ', x)
    print('Objective: ',m.options.OBJFCNVAL)
    

    There is additional information in the Gekko documentation and on this page about MINLP Optimization. The only requirement that it doesn't satisfy is to find a global optimum. A multi-start method or a dedicated solver such as BONMIN or BARON are options.