Operations need to have demand forecasts in order to establish optimal resource allocation policies. But, when we make predictions the only thing that we assure is the occurrence of prediction errors. Fortunately, there is no need to be 100% accurate to succeed, we just need to perform better than our competitors. In this exercise we […]

# linear programming

## Data Science for Operational Excellence (Part-4)

Below are the solutions to these exercises on Linear Programming. #################### # # # Exercise 1 # # # #################### library(lpSolve) set.seed(1234) offers <- 4 demands <- 3 commodities <- 2 f.obj <- c(sample(0:1000, offers*demands*commodities, replace=F)) #################### # # # Exercise 2 # # # #################### constraints <- demands*commodities vectorCon <- vector(length = constraints*offers*demands*commodities) place […]

## Data Science for Operational Excellence (Part-4)

Suppose your friend is a restaurant chain owner (only 3 units) facing some competitors challenges related to low price, lets call it a price war. Inside his business he knows that there’s no much cost to be cut. But, he thinks that, maybe if he tries harder to find better supplier with low freight and […]

## Data Science for Operational Excellence (Part-3)

Optimized transportation planning is a task usually left to the firm’s logistic department. However, it is often difficult to visualize, specially if there are many points involved in the logistic network. R and its packages can help solving this issue. Our goal here is to expand logistics networking visualization. In order to do that, we […]

## Data Science for Operational Excellence (Part-3)

Below are the solutions to these exercises on Linear Programming. #################### # # # Exercise 1 # # # #################### library(ggmap) library(fields) library(lpSolve) library(leaflet) library(dplyr) library(magrittr) soyaCities <- c(“Sapezal”,”Sorriso”, “Nova Mutum”, “Diamantino”, “Cascavel”) transhipment <- c(“Alto Arraguaia”, “Cascavel”) ports <- c(“Santos”, “Paranagua”) allCitiesAux <- c(soyaCities, transhipment, ports) #################### # # # Exercise 2 # # […]

## Data Science for Operational Excellence (Part-2)

Network problems are everywhere. We can easily find instances in logistics, telecom, project mangement, among others. In order to attack these problems using linear programming we need to go beyond assign and transportation problems that we saw in part I. Our goal here is to expand the problems we can solve using lpsove and igraph […]

## Data Science for Operational Excellence (Part-2)

Below are the solutions to these exercises on Linear Programming. #################### # # # Exercise 1 # # # #################### library(lpSolve) library(igraph) f.obj <- c(1,9,1) f.con <- matrix(c(1,2,3,3,2,2), nrow = 2, byrow = T) f.dir <- c("<=", "<=") f.rhs <- c(9,15) lp("max", f.obj, f.con, f.dir, f.rhs) ## Success: the objective function is 40.5 lp("max", f.obj, […]

## Data Science for Operational Excellence (Part-1)

Below are the solutions to these exercises on Linear Programming. #################### # # # Exercise 1 # # # #################### library(lpSolve) library(igraph) #################### # # # Exercise 2 # # # #################### set.seed(1234) assign.costs <- matrix(sample(50:100, 16, replace=T), ncol=4) #################### # # # Exercise 3 # # # #################### x <- lp.assign(assign.costs) x$solution ## [,1] […]

## Data Science for Operational Excellence (Part-1)

R has many powerful libraries to handle operations research. This exercise tries to demonstrate a few basic functionality of R while dealing with linear programming. Linear programming is a technique for the optimization of a linear objective function, subject to linear equality and linear inequality constraints. The lpsolve package in R provides a set […]