Skip to content

Problems with plot #2

@andresalerno

Description

@andresalerno

Hi!

I was studying the lpSolveExamples.R and the plot graph show some errors in the x and y axis. Do you know how can I fix it?

It is important to mention that I have just used LP example called "lpSolveAPI example 1 from book".

Tks,
Rplot.pdf``

// set up problem: maximize
//20x1 + 60x2 subject to
//30x1 + 20x2 <= 2700
//5x1 + 10x2 <= 850
//x1 + x2 >= 95
// x1 >= 0
// x2 >= 0

library(lpSolve)

#defining parameters

obj.fun <- c(20, 60)
constr <- matrix(c(30, 20, 5, 10, 1, 1), ncol = 2, byrow=TRUE)
constr.dir <- c("<=", "<=", ">=")
rhs <- c(2700, 850, 95)

#solving model

prod.sol <- lp("max", obj.fun, constr, constr.dir, rhs, compute.sens = TRUE)

#accessing to R output

prod.sol$obj.val
prod.sol$solution
prod.sol$duals #includes duals of constraints and reduced costs of variables
prod.sol$duals.from
prod.sol$duals.to
prod.sol$sens.coef.from
prod.sol$sens.coef.to

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions