1
$\begingroup$

I want to find a feasible solution for mixed integer linear program. The first $t$ variables in the system are integers and other are reals.

The problem is that the no. of variables is more than hundred and so it is infeasible to assign domains individually.So, I want to know if there is any way to assign domains to variables in automated fashion.

$\endgroup$
  • 3
    $\begingroup$ vars = Array[v, 120]; t = 40; $Assumptions = {Element[vars[[1 ;; t]], Integers], Element[vars[[t + 1 ;;]], Reals]}; $\endgroup$ – Bob Hanlon Oct 4 '16 at 23:56
  • $\begingroup$ @BobHanlon But in LinearProgramming command, we don't specify variables. Is it possible to do this while using LinearProgramming command $\endgroup$ – Phani Raj Oct 6 '16 at 0:02
  • $\begingroup$ As shown in the documentation, the fifth (optional) argument to LinearProgramming is the domain specification(s). Try: {ConstantArray[Integers, t], ConstantArray[Reals, n-t]}//Flatten $\endgroup$ – Bob Hanlon Oct 6 '16 at 0:40

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.