Questions tagged [r]
For questions about solving Operations Research problems using the R programming language.
40 questions
2
votes
1
answer
95
views
How to Group IDs Based on the Difference of Each ID’s Min and Max Value?
I have a dataset that contains IDs along with their corresponding minimum and maximum values.
Here’s a sample of the data:
...
2
votes
3
answers
288
views
Grouping values based on a difference constraint
I am trying to write an MILP to do a grouping (clustering) given one difference condition.
Suppose, I have the following elements in a list: 1,2,3,4,6,8,9,10.
My goal here is to group them so that the ...
1
vote
0
answers
77
views
Calling Cplex from R through a MPS-like file
I have a working - and long - R code to generate a mps file to be read by cplex.
Because I work with large instances I am finding troubles (too much time) in producing a large mps file.
Is there a way ...
0
votes
0
answers
105
views
different constraints for each row
I'm using the IpSolve package to solve a problem to optimize the assignment (minimum distance) between sellers (rows)and customers (columns) using Rstudio.
The problem I faced when using lp/lp....
2
votes
1
answer
243
views
Solving a Global Optimization problem using Differential Evolutionary Algorithm using R
I need to determine the global optimum results of this objective function. I define the problem by minimizing the squared difference as represented in function $f(q_1,q_2,\alpha_1,\alpha_2)$
The ...
2
votes
0
answers
116
views
Supply chain simulation is not working. Any help please?
I am trying to simulate a supply chain scenario. Demand is random (e.g. between 100-400 units) and lead time vary 2 to 4 days for each supply. The holding cost(h), penalty cost (p) for lost_sales, ...
2
votes
2
answers
384
views
Assign jobs to least people with multiple job constraints
Assume I have an infinite number of staff/supply. I have a table of how much time in hours needs to be spent on certain tasks:
Task
Demand
A
0.75
B
0.8
C
0.65
D
0.7
E
0.6
F
0.65
And the tasks can ...
2
votes
0
answers
94
views
find unique neighbour pairs between two point clouds in R
Given two point clouds I want to find for each point from the first point cloud the nearest neighbour from the second point cloud. Also, each pair of neighbours should be unique. The solution was ...
2
votes
2
answers
451
views
Optimization gives me negative value
Not sure if this question is appropriate, but there is some error in my code which I just cannot seem to find. Probably been staring myself blind to this, so I could really use some help.
It is a MILP,...
2
votes
1
answer
73
views
Two criteria in a problem that involves multiple-criteria decision-making
I would like your valuable opinion on one issue:
I created a decision matrix considering two criteria and 10 alternatives, as below. My problem involves determining the optimal number of clusters from ...
3
votes
2
answers
344
views
How to calculate the average distance between two points in seperate dataframes in r
I have two data frames, the first indicating customer locations and the second indicating facility locations.
I want to calculate the average distance of all customers to the closest facility location
...
2
votes
0
answers
39
views
Matrix normalization to use multicriteria methods
I'm using the TOPSIS and VIKOR multicriteria methods to generate rankings according to the decision matrix that I call a database. I would like to know if the ...
1
vote
2
answers
256
views
Include dataframe linear optimization in r
For a linear optimization problem I want to include a dataframe (d_ij) which has binary variables,
1 if customer i is located within the assignable distance of facility j, 0 otherwise. So unless d_ij =...
2
votes
2
answers
87
views
How to verify the correctness of forecast?
I would like to forecast the car rental (count time series). Given hourly integer valued car rentals for a month's period from 24th september to 24th October. I need to forecast car rental demand ...
2
votes
2
answers
133
views
Adjust result to equal mode values
The code below is generating the mode value considering the columns Method1, Method2, Method3...