About

Rmosek is designed to make the optimization facilities of MOSEK available from the R-language.

The interface supports large-scale optimization of many kinds:
---- Mixed-integer linear optimization
---- Mixed-integer quadratic optimization
---- Mixed-integer second-order cone optimization
---- Semidefinite optimization
---- Separable convex optimization

Rmosek is an open-source project developed on the R-Forge SVN repository. MOSEK is a proprietary product, but ships with unlimited trial and academic licenses free of charge.

System requirements

You need MOSEK and a MOSEK license:
---- MOSEK (version 6.0.0.122 and later supported)
---- Trial licenses
---- Academic licenses
---- Commercial licenses

You need the R-language and the Matrix package:
---- R-language (version 2.10 and later supported; use 32/64bit R with a 32/64bit MOSEK installation)
---- Matrix package (already included in the default R-language installation)

Some operating systems need a toolchain to compile Rmosek:
---- Rtools (for Windows; already included in the default R-language installation)

Installation

An auto-configured installation of Rmosek will work in most cases given the system requirements are satisfied. Thus, MOSEK 7 users should be able to install the package with:

install.packages("Rmosek", type="source", repos="http://download.mosek.com/R/7")

MOSEK 6 users should similarly be able to install the package with:

install.packages("Rmosek", type="source", repos="http://download.mosek.com/R/6")

If this does not work, we advice you to look in the userguide for more information before seeking support.

Getting started

Rmosek can be loaded with

require(Rmosek)

All functions of Rmosek are found by

library(help="Rmosek")

The short manual of a function is found by

help("mosek", package="Rmosek")

The short manual of the 'mosek' function would first tell you that it calls MOSEK to solve the optimization problem given to it, and then present all of its arguments with descriptions and examples. On this homepage, we will skip right to the examples.


Example 1:
A linear optimization problem is defined and solved.

lo1 <- list()
lo1$sense <- "max"
lo1$c <- c(3,1,5,1)
lo1$A <- Matrix(c(3,1,2,0,
                  2,1,3,1,
                  0,2,0,3), nrow=3, byrow=TRUE, sparse=TRUE)
lo1$bc <- rbind(blc = c(30,15,-Inf),
                buc = c(30,Inf,25))
lo1$bx <- rbind(blx = c(0,0,0,0),
                bux = c(Inf,10,Inf,Inf))
r <- mosek(lo1)

Example 2:
A mixed-integer linear problem is read from file and solved. The first command resolves the path of the problem file "milo1.opf" from within the package directory.

modelfile <- system.file(package="Rmosek", "extdata", "milo1.opf")
r_read <- mosek_read(modelfile)
r_solve <- mosek(r_read$prob)

More examples:
See examples for more on optimization using Rmosek.