Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
eesys-public
BIA-Resources
Commits
13805843
Commit
13805843
authored
Jan 28, 2020
by
Weigert, Andreas
Browse files
added exercise file
parent
ba9d6eb8
Changes
1
Hide whitespace changes
Inline
Side-by-side
Tutorial_Scripts/Optimization_DecisionSupport/BIA_T12_Optimization_exercise.Rmd
0 → 100644
View file @
13805843
---
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)
f.dir <- c("<=", "<=")
const.rhs <- c(9, 15)
direction <- "max"
lp(direction, objective.in, const.mat, f.dir, const.rhs)
lp(direction, objective.in, const.mat, f.dir, const.rhs)$solution
```
Write
Preview
Supports
Markdown
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