next | previous | forward | backward | up | top | index | toc | Macaulay2 web site
SemidefiniteProgramming :: Solver

Solver -- picking a semidefinite programming solver

Description

This package interfaces semidefinite programming solvers in Macaulay2. There is also a rudimentary implementation of such a solver in the Macaulay2 language. It is called the M2 solver but for most applications it will be insufficient. For this reason Macaulay2 also ships the CSDP solver. The package supports the following solvers:
  • "M2" -- a simple dual interior point method implemented in Macaulay2
  • "CSDP" -- this is an open source solver, available at https://projects.coin-or.org/Csdp/
  • "SDPA" -- this is an open source solver, available at http://sdpa.sourceforge.net/
  • "MOSEK" -- this is a commercial solver, free for academic use, available at https://www.mosek.com/
The CSDP solver is shipped with Macaulay2 and configured as the default solver. 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 = /builddir/.Macaulay2/

Functions with optional argument named Solver :

For the programmer

The object Solver is a symbol.