KNITRO + JuMP: linear --> nonlinear constraints?

66 views
Skip to first unread message

Alan Crawford

unread,
Nov 30, 2016, 10:14:09 AM11/30/16
to julia-opt
This is probably an old issue - but i wondered why linear constraints are being converted in to nonlinear constraints when called through JuMP?

For reference i am using Julia v0.5 with Knitro 10.0.1. Also 

julia> Pkg.status("JuMP")

 - JuMP                          0.14.1


julia> Pkg.status("KNITRO")

 - KNITRO                        0.2.0

Miles Lubin

unread,
Nov 30, 2016, 10:16:24 AM11/30/16
to julia-opt
Not sure what you mean exactly, but possibly see https://github.com/JuliaOpt/KNITRO.jl/commit/67a6e8379d1b39476282abb56a6e65598e2896c6 which hasn't been tagged yet.

Miles Lubin

unread,
Nov 30, 2016, 10:18:11 AM11/30/16
to julia-opt
If you use that you should update to Knitro 10.1.2 otherwise you may silently get incorrect answers on "rare" occasions.

Alan Crawford

unread,
Nov 30, 2016, 10:55:49 AM11/30/16
to julia-opt
Thanks Miles. To clarify:

In my jump model i get the following summary information:

Minimization problem with:

 * 5000 linear constraints

 * 3784 variables

Solver is Knitro



Then when i solve the model I get that knitro output telling me i have 1000 nonlinear constraints:


=======================================

           Academic License

       (NOT FOR COMMERCIAL USE)

         Artelys Knitro 10.0.1

=======================================


Knitro presolve eliminated 0 variables and 0 constraints.


outlev:               1

Knitro changing algorithm from AUTO to 1.

Knitro changing bar_initpt from AUTO to 3.

Knitro changing bar_murule from AUTO to 4.

Knitro changing bar_penaltycons from AUTO to 1.

Knitro changing bar_penaltyrule from AUTO to 2.

Knitro changing bar_switchrule from AUTO to 2.

Knitro changing linsolver from AUTO to 5.


Problem Characteristics                    ( Presolved)

-----------------------

Objective goal:  Minimize

Number of variables:                  3784 (      3784)

    bounded below:                       0 (         0)

    bounded above:                       0 (         0)

    bounded below and above:             0 (         0)

    fixed:                               0 (         0)

    free:                             3784 (      3784)

Number of constraints:                5000 (      5000)

    linear equalities:                   0 (         0)

    nonlinear equalities:                0 (         0)

    linear inequalities:                 0 (         0)

    nonlinear inequalities:           5000 (      5000)

    range:                               0 (         0)

Number of nonzeros in Jacobian:      94750 (     94750)

Number of nonzeros in Hessian:     7161220 (   7161220)


EXIT: Locally optimal solution found.


Final Statistics

----------------

Final objective value               =  -3.50504042566882e-01

Final feasibility error (abs / rel) =   9.60e-11 / 9.60e-11

Final optimality error  (abs / rel) =   2.64e-10 / 2.64e-10

# of iterations                     =         19 

# of CG iterations                  =          0 

# of function evaluations           =         21

# of gradient evaluations           =         21

# of Hessian evaluations            =         19

Total program time (secs)           =     170.44518 (   170.338 CPU time)

Time spent in evaluations (secs)    =     106.45541


===============================================================================

 

Alan Crawford

unread,
Nov 30, 2016, 5:28:23 PM11/30/16
to julia-opt
I checked out the master of KNITRO.jl and downloaded the KNITRO v 10.1.2, I ran the example from KNITRO.jl 

using KNITRO, JuMP
m = Model(solver=KnitroSolver())
@variable(m, x[1:3]>=0)
@objective(m, Min, 9.0 - 8.0*x[1] - 6.0*x[2] - 4.0*x[3]
                        + 2.0*x[1]^2 + 2.0*x[2]^2 + x[3]^2
                        + 2.0*x[1]*x[2] + 2.0*x[1]*x[3])
@constraint(m, x[1] + x[2] + 2.0*x[3] <= 3)
solve(m)

KNITRO now correctly picks up problem structure. 


Reply all
Reply to author
Forward
0 new messages