Skip to main content
added 157 characters in body
Source Link
Mark L. Stone
  • 2.3k
  • 11
  • 15

You can formulate and solve this using YALMIP under MATLAB. You can download YALMIP for free http://users.isy.liu.se/johanl/yalmip/pmwiki.php?n=Main.Download . YALMIP will do the dirty work for you. Install YALMIP, run yalmiptest to test installation, read http://users.isy.liu.se/johanl/yalmip/pmwiki.php?n=Tutorials.Basics .

I generated L= rand(1000,20) and solved the following problem in under 3 sec when YALMIP selected cplex by default as the solver. It also solved it in under 3 sec using scip. These times are if I don't impose a constraint X >= 1 (see next paragraph, because I am confused as to what your optimization problem actually is).

However, and this is an important point, the problem as you have stated it always has an optimal objective value = 0, which is achieved with X = all zeros. So you need some other constraint on X or a different formulation in order to have a non-trivial problem. If you do that, it is possible that the run time could go up considerably. I have been ignoring ξ >= 1; I don't know what your problem is. I have assumed that X is a vector of the optimization (decision) variables. So you need to fix up the problem. Clearly state the objective and what the decision variables are, and what the problem inputs are. I don't know what ξ is or how it enters the objective function. O.k., here's my guess: you mean that all elements of X are >= 1. is that correct? If so, this will take a long time to run.

n = size(L,1);
X = intvar(n,1) % declares X to be an n by 1 vector of integer variables
sol = optimize([][X >= 1],var(X'*L))

If you want to specify a particular solver, such as scip, rather than letting YALMIP pick what it thinks is best from among the installed solvers, use

sol = optimize([][X >= 1],var(X'*L),sdpsettings('solver','scip'))

If there are any other constraints, put them inside the [] ., separated by , or ;

After the problem has been solved, the optimal argument value (i.e., argmin) is obtained with

value(X)

This is being solved as a Mixed Integer QP. YALMIP is putting it into the form needed by the solver.

By the way, I believe FMINCON will ignore tolerance of 1e-100; it just can't handle that, so it will use what "it wants to".

You can formulate and solve this using YALMIP under MATLAB. You can download YALMIP for free http://users.isy.liu.se/johanl/yalmip/pmwiki.php?n=Main.Download . YALMIP will do the dirty work for you. Install YALMIP, run yalmiptest to test installation, read http://users.isy.liu.se/johanl/yalmip/pmwiki.php?n=Tutorials.Basics .

I generated L= rand(1000,20) and solved the following problem in under 3 sec when YALMIP selected cplex by default as the solver. It also solved it in under 3 sec using scip.

However, and this is an important point, the problem as you have stated it always has an optimal objective value = 0, which is achieved with X = all zeros. So you need some other constraint on X or a different formulation in order to have a non-trivial problem. If you do that, it is possible that the run time could go up considerably. I have been ignoring ξ >= 1; I don't know what your problem is. I have assumed that X is a vector of the optimization (decision) variables. So you need to fix up the problem. Clearly state the objective and what the decision variables are, and what the problem inputs are. I don't know what ξ is or how it enters the objective function.

n = size(L,1);
X = intvar(n,1) % declares X to be an n by 1 vector of integer variables
sol = optimize([],var(X'*L))

If you want to specify a particular solver, such as scip, rather than letting YALMIP pick what it thinks is best from among the installed solvers, use

sol = optimize([],var(X'*L),sdpsettings('solver','scip'))

If there are any other constraints, put them inside the [] .

After the problem has been solved, the optimal argument value (i.e., argmin) is obtained with

value(X)

This is being solved as a Mixed Integer QP. YALMIP is putting it into the form needed by the solver.

By the way, I believe FMINCON will ignore tolerance of 1e-100; it just can't handle that, so it will use what "it wants to".

You can formulate and solve this using YALMIP under MATLAB. You can download YALMIP for free http://users.isy.liu.se/johanl/yalmip/pmwiki.php?n=Main.Download . YALMIP will do the dirty work for you. Install YALMIP, run yalmiptest to test installation, read http://users.isy.liu.se/johanl/yalmip/pmwiki.php?n=Tutorials.Basics .

I generated L= rand(1000,20) and solved the following problem in under 3 sec when YALMIP selected cplex by default as the solver. It also solved it in under 3 sec using scip. These times are if I don't impose a constraint X >= 1 (see next paragraph, because I am confused as to what your optimization problem actually is).

However, and this is an important point, the problem as you have stated it always has an optimal objective value = 0, which is achieved with X = all zeros. So you need some other constraint on X or a different formulation in order to have a non-trivial problem. If you do that, it is possible that the run time could go up considerably. I have been ignoring ξ >= 1; I don't know what your problem is. I have assumed that X is a vector of the optimization (decision) variables. So you need to fix up the problem. Clearly state the objective and what the decision variables are, and what the problem inputs are. I don't know what ξ is or how it enters the objective function. O.k., here's my guess: you mean that all elements of X are >= 1. is that correct? If so, this will take a long time to run.

n = size(L,1);
X = intvar(n,1) % declares X to be an n by 1 vector of integer variables
sol = optimize([X >= 1],var(X'*L))

If you want to specify a particular solver, such as scip, rather than letting YALMIP pick what it thinks is best from among the installed solvers, use

sol = optimize([X >= 1],var(X'*L),sdpsettings('solver','scip'))

If there are any other constraints, put them inside the [] , separated by , or ;

After the problem has been solved, the optimal argument value (i.e., argmin) is obtained with

value(X)

This is being solved as a Mixed Integer QP. YALMIP is putting it into the form needed by the solver.

By the way, I believe FMINCON will ignore tolerance of 1e-100; it just can't handle that, so it will use what "it wants to".

added 341 characters in body
Source Link
Mark L. Stone
  • 2.3k
  • 11
  • 15

You can formulate and solve this using YALMIP under MATLAB. You can download YALMIP for free http://users.isy.liu.se/johanl/yalmip/pmwiki.php?n=Main.Download . YALMIP will do the dirty work for you. Install YALMIP, run yalmiptest to test installation, read http://users.isy.liu.se/johanl/yalmip/pmwiki.php?n=Tutorials.Basics .

I generated L= rand(1000,20) and solved the following problem in under 3 sec when YALMIP selected cplex by default as the solver. It also solved it in under 3 sec using scip.

However, and this is an important point, the problem as you have stated it always has an optimal objective value = 0, which is achieved with X = all zeros. So you need some other constraint on X or a different formulation in order to have a non-trivial problem. If you do that, it is possible that the run time could go up considerably. I have been ignoring ξ >= 1; I don't know what your problem is. I have assumed that X is a vector of the optimization (decision) variables. So you need to fix up the problem. Clearly state the objective and what the decision variables are, and what the problem inputs are. I don't know what ξ is or how it enters the objective function.

n = size(L,1);
X = intvar(n,1) % declares X to be an n by 1 vector of integer variables
sol = optimize([],var(X'*L))

If you want to specify a particular solver, such as scip, rather than letting YALMIP pick what it thinks is best from among the installed solvers, use

sol = optimize([],var(X'*L),sdpsettings('solver','scip'))

If there are any other constraints, put them inside the [] .

After the problem has been solved, the optimal argument value (i.e., argmin) is obtained with

value(X)

This is being solved as a Mixed Integer QP. YALMIP is putting it into the form needed by the solver.

By the way, I believe FMINCON will ignore tolerance of 1e-100; it just can't handle that, so it will use what "it wants to".

You can formulate and solve this using YALMIP under MATLAB. You can download YALMIP for free http://users.isy.liu.se/johanl/yalmip/pmwiki.php?n=Main.Download . YALMIP will do the dirty work for you. Install YALMIP, run yalmiptest to test installation, read http://users.isy.liu.se/johanl/yalmip/pmwiki.php?n=Tutorials.Basics .

I generated L= rand(1000,20) and solved the following problem in under 3 sec when YALMIP selected cplex by default as the solver. It also solved it in under 3 sec using scip.

n = size(L,1);
X = intvar(n,1) % declares X to be an n by 1 vector of integer variables
sol = optimize([],var(X'*L))

If you want to specify a particular solver, such as scip, rather than letting YALMIP pick what it thinks is best from among the installed solvers, use

sol = optimize([],var(X'*L),sdpsettings('solver','scip'))

If there are any other constraints, put them inside the [] .

After the problem has been solved, the optimal argument value (i.e., argmin) is obtained with

value(X)

This is being solved as a Mixed Integer QP. YALMIP is putting it into the form needed by the solver.

By the way, I believe FMINCON will ignore tolerance of 1e-100; it just can't handle that, so it will use what "it wants to".

You can formulate and solve this using YALMIP under MATLAB. You can download YALMIP for free http://users.isy.liu.se/johanl/yalmip/pmwiki.php?n=Main.Download . YALMIP will do the dirty work for you. Install YALMIP, run yalmiptest to test installation, read http://users.isy.liu.se/johanl/yalmip/pmwiki.php?n=Tutorials.Basics .

I generated L= rand(1000,20) and solved the following problem in under 3 sec when YALMIP selected cplex by default as the solver. It also solved it in under 3 sec using scip.

However, and this is an important point, the problem as you have stated it always has an optimal objective value = 0, which is achieved with X = all zeros. So you need some other constraint on X or a different formulation in order to have a non-trivial problem. If you do that, it is possible that the run time could go up considerably. I have been ignoring ξ >= 1; I don't know what your problem is. I have assumed that X is a vector of the optimization (decision) variables. So you need to fix up the problem. Clearly state the objective and what the decision variables are, and what the problem inputs are. I don't know what ξ is or how it enters the objective function.

n = size(L,1);
X = intvar(n,1) % declares X to be an n by 1 vector of integer variables
sol = optimize([],var(X'*L))

If you want to specify a particular solver, such as scip, rather than letting YALMIP pick what it thinks is best from among the installed solvers, use

sol = optimize([],var(X'*L),sdpsettings('solver','scip'))

If there are any other constraints, put them inside the [] .

After the problem has been solved, the optimal argument value (i.e., argmin) is obtained with

value(X)

This is being solved as a Mixed Integer QP. YALMIP is putting it into the form needed by the solver.

By the way, I believe FMINCON will ignore tolerance of 1e-100; it just can't handle that, so it will use what "it wants to".

edited body
Source Link
Mark L. Stone
  • 2.3k
  • 11
  • 15

You can formulate and solve this using YALMIP under MATLAB. You can download YALMIP for free http://users.isy.liu.se/johanl/yalmip/pmwiki.php?n=Main.Download . YALMIP will do the dirty work for you. Install YALMIP, run yalmiptest to test installation, read http://users.isy.liu.se/johanl/yalmip/pmwiki.php?n=Tutorials.Basics .

I generated L= rand(1000,20) and solved the following problem in under 3 sec when YALMIP selected cplex by default as the solver. It also solved it in under 3 sec using scip.

n = size(L,1);
xX = intvar(n,1) % declares xX to be an n by 1 vector of integer variables
sol = optimize([],var(X'*L))

If you want to specify a particular solver, such as scip, rather than letting YALMIP pick what it thinks is best from among the installed solvers, use

sol = optimize([],var(X'*L),sdpsettings('solver','scip'))

If there are any other constraints, put them inside the [] .

After the problem has been solved, the optimal;optimal argument value (i.e., argninargmin) is obtained with

value(X)

This is being solved as a Mixed Integer QP. YALMIP is putting it into the form needed by the solver.

By the way, I believe FMINCON will ignore tolerance of 1e-100; it just can't handle that, so it will use what "it wants"wants to".

You can formulate and solve this using YALMIP under MATLAB. You can download YALMIP for free http://users.isy.liu.se/johanl/yalmip/pmwiki.php?n=Main.Download . YALMIP will do the dirty work for you. Install YALMIP, run yalmiptest to test installation, read http://users.isy.liu.se/johanl/yalmip/pmwiki.php?n=Tutorials.Basics .

I generated L= rand(1000,20) and solved the following problem in under 3 sec when YALMIP selected cplex by default as the solver. It also solved it in under 3 sec using scip.

n = size(L,1);
x = intvar(n,1) % declares x to be an n by 1 vector of integer variables
sol = optimize([],var(X'*L))

If you want to specify a particular solver, such as scip, rather than letting YALMIP pick what it thinks is best from among the installed solvers, use

sol = optimize([],var(X'*L),sdpsettings('solver','scip'))

If there are any other constraints, put them inside the [] .

After the problem has been solved, the optimal; argument value (i.e., argnin) is obtained with

value(X)

This is being solved as a Mixed Integer QP. YALMIP is putting it into the form needed by the solver.

By the way, I believe FMINCON will ignore tolerance of 1e-100; it just can't handle that, so it will use what "it wants".

You can formulate and solve this using YALMIP under MATLAB. You can download YALMIP for free http://users.isy.liu.se/johanl/yalmip/pmwiki.php?n=Main.Download . YALMIP will do the dirty work for you. Install YALMIP, run yalmiptest to test installation, read http://users.isy.liu.se/johanl/yalmip/pmwiki.php?n=Tutorials.Basics .

I generated L= rand(1000,20) and solved the following problem in under 3 sec when YALMIP selected cplex by default as the solver. It also solved it in under 3 sec using scip.

n = size(L,1);
X = intvar(n,1) % declares X to be an n by 1 vector of integer variables
sol = optimize([],var(X'*L))

If you want to specify a particular solver, such as scip, rather than letting YALMIP pick what it thinks is best from among the installed solvers, use

sol = optimize([],var(X'*L),sdpsettings('solver','scip'))

If there are any other constraints, put them inside the [] .

After the problem has been solved, the optimal argument value (i.e., argmin) is obtained with

value(X)

This is being solved as a Mixed Integer QP. YALMIP is putting it into the form needed by the solver.

By the way, I believe FMINCON will ignore tolerance of 1e-100; it just can't handle that, so it will use what "it wants to".

Source Link
Mark L. Stone
  • 2.3k
  • 11
  • 15
Loading