ob-lp_solve/README.org

2.1 KiB

ob-lp_solve

Evaluate Mixed Integer Linear Programming LP-format model with LP-solve

Installation

The package is not (yet) available on MELPA, so it should be installed directly from the repository.

Dependencies

To be able to use ob-lp_solve you will need to install lp_solve and make sure it is on your PATH.

Installation with Doomemacs

In your $DOOMDIR/packages.el file, you might want to set up the following:

(package! ob-lp_solve
  :recipe (:host github :repo "samuelortion/ob-lp_solve"))

Installation with Straight

(use-package ob-pasp
  :straight (ob-pasp :type git :host github :repo "samuelortion/lp_solve"))

Some basic examples

max: a + b;
r_1: a + b < 2;

Value of objective function: 2.00000000

Actual values of the variables:
a                               1
b                               1

Linear programming Vertex cover problem relaxation

min: a + b + c + d + e;

r_1: a + c >= 1;
r_2: d + e >= 1;
r_3: c + b >= 1;
r_4: a + e >= 1;
r_5: a + d >= 1;

bin a;
bin b;
bin c;
bin d;
bin e;

Value of objective function: 3.00000000

Actual values of the variables:
a                               1
b                               0
c                               1
d                               0
e                               1
graph G {
      {
      node [width=0.25 shape=circle style=filled]
      a [fillcolor=yellow]
      b
      c [fillcolor=yellow]
      d
      e
      }
      a -- c
      c -- b
      d -- e
      a -- e
      a -- d
}

/sortion/ob-lp_solve/media/commit/ee6af3ef1af082eb68a30e92b2354a0c4d73a23d/vertex-cover-example.svg