Description Usage Arguments Value Status Codes Author(s) References Examples

Attempt to compute the optimal solution of an lpSolve linear program model object.

1 2 |

`a` |
an lpSolve linear program model object. |

`b` |
this argument is ignored. |

`...` |
additional arguments are ignored. |

a single integer value containing the status code.

0: | "optimal solution found" |

1: | "the model is sub-optimal" |

2: | "the model is infeasible" |

3: | "the model is unbounded" |

4: | "the model is degenerate" |

5: | "numerical failure encountered" |

6: | "process aborted" |

7: | "timeout" |

9: | "the model was solved by presolve" |

10: | "the branch and bound routine failed" |

11: | "the branch and bound was stopped because of a break-at-first or break-at-value" |

12: | "a feasible branch and bound solution was found" |

13: | "no feasible branch and bound solution was found" |

Kjell Konis [email protected]

http://lpsolve.sourceforge.net/5.5/index.htm

1 2 3 4 5 6 7 8 9 10 | ```
lps.model <- make.lp(0, 3)
xt <- c(6,2,4)
add.constraint(lps.model, xt, "<=", 150)
xt <- c(1,1,6)
add.constraint(lps.model, xt, ">=", 0)
xt <- c(4,5,4)
add.constraint(lps.model, xt, "=", 40)
set.objfn(lps.model, c(-3,-4,-3))
solve(lps.model)
``` |

```
[1] 0
```

Embedding an R snippet on your website

Add the following code to your website.

For more information on customizing the embed code, read Embedding Snippets.