Macaulay2 » Documentation
Packages » SemidefiniteProgramming :: Solver
next | previous | forward | backward | up | index | toc

Solver -- picking a semidefinite programming solver

Description

There are several specialized solvers (or tools) for semidefinite programming. This package interfaces some of these solvers to Macaulay2. In particular, the open source solver CSDP is included with Macaulay2, and is configured as the default. There is also a rudimentary semidefinite programming solver implemented in the Macaulay2 language, but for most applications it will be insufficient. The package supports the following solvers: In our experience CSDP and MOSEK give the best results. An easy way to make an additional solver available to Macaulay2 is to add the executable to the PATH environment variable. Another way is to explicitly specify the location of the executable in the package configuration:
i1 : needsPackage ("SemidefiniteProgramming", Configuration=>{"CSDPexec"=>"/some/path/csdp"});
i2 : needsPackage ("SemidefiniteProgramming", Configuration=>{"SDPAexec"=>"/some/path/sdpa"});
i3 : needsPackage ("SemidefiniteProgramming", Configuration=>{"MOSEKexec"=>"/some/path/mosek"});
A third method is to use the function changeSolver. After configuring, the method checkOptimize can be used to check if a solver works.

The default solver can also be specified when loading the package:
i4 : needsPackage ("SemidefiniteProgramming", Configuration=>{"DefaultSolver"=>"CSDP"});
If no default solver is specified, the package tries to use, in this order, CSDP, MOSEK, SDPA, M2.

Saving the configuration

The configuration options "CSDPexec", "SDPAexec", "MOSEKexec", "DefaultSolver" can be saved by editing the file "init-SemidefiniteProgramming.m2", which is located in the application directory:
i5 : applicationDirectory()

o5 = /home/m2user/.Macaulay2/

Functions with optional argument named Solver :

For the programmer

The object Solver is a symbol.