Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
eesys-public
BIA-Resources
Commits
2fd649b3
Commit
2fd649b3
authored
Jan 30, 2019
by
Weigert, Andreas
Browse files
add script for tutorial 14
parent
9341d142
Changes
1
Hide whitespace changes
Inline
Side-by-side
R/BIA_T14_Optimization_exercise.Rmd
0 → 100644
View file @
2fd649b3
---
title: 'Tutorial 14: Optimization'
output: html_notebook
editor_options:
chunk_output_type: inline
---
This file is part of the lecture Business Intelligence & Analytics (EESYS-BIA-M), Information Systems and Energy Efficient Systems, University of Bamberg.
```{r}
library(lpSolve)
library(ggplot2)
```
```{r lpSolve default example}
#
# Set up problem: maximize
# x1 + 9 x2 + x3 subject to
# x1 + 2 x2 + 3 x3 <= 9
# 3 x1 + 2 x2 + 2 x3 <= 15
#
objective.in <- c(1, 9, 1)
const.mat <- matrix(c(1, 2, 3, 3, 2, 2), nrow=2, byrow=TRUE)
direction <- c("<=", "<=")
const.rhs <- c(9, 15)
direction <- "max"
lp (direction, f.obj, f.con, f.dir, f.rhs)
```
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment