Questions tagged [r]
For questions about solving Operations Research problems using the R programming language.
37
questions
0
votes
0
answers
66
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
154
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
96
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
179
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 ...
2
votes
0
answers
65
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
273
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
41
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
248
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
23
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
145
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
59
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
99
views
Adjust result to equal mode values
The code below is generating the mode value considering the columns Method1, Method2, Method3...
-1
votes
1
answer
78
views
Create random coordinates with pre specified degree of clustering
In R, I want to create a random data frame of x and y coordinates, that has a certain degree of clustering. For example 15 $k$-...
2
votes
1
answer
311
views
Is it possible to merge two objective functions using the LpSolve package in R?
I have been using the LpSolve package to solve a minimization problem in my final course work, but I need to reconcile this problem with a maximization problem. Conducting several researches, I ...
2
votes
1
answer
738
views
3D Knapsack Problem: R or Python Packages?
For an upcoming client project, I'm looking to do a 3D variant on the knapsack problem. Basically, there's a bin of dimensions $x,y,z$, and I have $K$ units of an item with dimensions $a,b,c$. (...
3
votes
1
answer
86
views
Application with VIKOR multicriteria method
What to do in these cases where I can't rank by the VIKOR multicriteria method because Q has no value?
...
0
votes
1
answer
180
views
Conflicts with weights of the topsis method in R
Why can't I generate for the topsis method, choosing a w <- c(1, 0)? As far as I know it has to be the sum of the weights ...
6
votes
3
answers
228
views
Linear Programming problem for finding supplier
I have a linear programming problem in front of me that I am searching to solve in R (any package). It seems like an unbalanced assignment problem to me with relaxed constraints on columns (repeated ...
1
vote
0
answers
30
views
How to utilize Spearman Rho coefficient
The dataset below presents the ranking of different multicriteria methods. My idea is to generate a final ranking based on the multicriteria methods for all alternatives, but it can be seen that in ...
2
votes
1
answer
106
views
Using VIKOR multicriteria method in R
I'm using the VIKOR multicriteria method from the MCDM package. The example can be found here: https://cran.r-project.org/web/...
1
vote
0
answers
65
views
How to use PROMETHEE multicriteria method in R
I used TOPSIS multicriteria method to select the best number of clusters out of the 34 options. As weights I used 0.5 for each criterion. The ...
1
vote
1
answer
173
views
How to Use the Weighted Sum Method in R
I would like to use the weighted sum method to select the best number of clusters out of the 34 options. As weights I would like to use 0.5 for each criterion. The coverage criterion is to minimize ...
1
vote
1
answer
198
views
Use the Weighted Sum Method in R
I would like to use the Weighted Sum Method (Multi Criteria Decision Making) in R in this database below. The resolution of the issue is here: https://www.geeksforgeeks.org/weighted-sum-method-multi-...
5
votes
2
answers
358
views
R package for multi objective integer evolutionary algorithm
I have a discrete event simulation (simmer package) based on probability distributions in R. I would like to optimize the variables according to several (2 or more) objectives. I used the NSGA-II ...
2
votes
2
answers
136
views
How to use `cplexAPI` to solve quadratic programs/quadratically constrained linear programs?
I am trying to use cplexAPI to solve quadratic programs or quadratically constrained linear program.
While it seems to be pretty straightforward to use ...
4
votes
2
answers
204
views
Optimizing a capacitated clustering problem with Greedy search algorithm
So, I am trying to implement a greedy search algorithm to cluster a number of points. Each point has a specific demand and each cluster shouldn't exceed that demand. Now, when I run it for a smaller ...
3
votes
0
answers
122
views
How to approach this Truck Utilisation problem?
The problem statement currently I have is very broad (or you can say very vague at the same time):
I have a number of dropping locations (Customer locations)
I have the location of the HUB
I have a ...
5
votes
4
answers
597
views
Solving Capacitated VRP with multiple various sized vehicles
I am looking to form a Capacitated VRP problem like this:
I have 40,000 dropping locations with Demands of each point available
I have 5-6 types of vehicles available with different capacities and ...
4
votes
1
answer
236
views
Problems with reading CPLEX LP models from file in R by package 'lpSolveAPI'
As an R user, I'm trying to read a CPLEX LP model from file by using the read.lp function from package lpSolveAPI.
Here's the command line (from within RStudio):
...
3
votes
0
answers
128
views
R ompr MILPModel array multiplication?
In R, I regularly ompr::MILPModel for optimization. I adapt the below snippet to enable multiplication of a decision variable with two dimensions (e.g., x[i,j] ) ...
3
votes
1
answer
411
views
Non-numeric argument to binary operator in MILPModel of ompr package
I am familiar with how to use ompr::MIPModel but I am trying to learn how to use MILPModel to take advantage of the model build ...
3
votes
2
answers
168
views
Using R for coding Matheuristic for Research Publication
Given that R possesses superior data pre-processing and post-processing packages, I am thinking of coding a matheuristic using R for publishing in an academic research journal.
However, I am unable ...
5
votes
3
answers
199
views
Reducing number of suppliers for product portfolio
I have the following matrix of suppliers who are able to make a certain product, against all products in my portfolio.
What is the best way of finding the solution to "the least suppliers necessary ...
5
votes
2
answers
2k
views
VRP package for R
I work almost exclusively in R and Rstudio, and have found it to be an excellent ecosystem for data analysis and OR, including discrete event simulation, Monte Carlo simulation, MILP, and the ...
6
votes
1
answer
112
views
DAG shortest path in R - I have a list of nodes, each node's completion time and each node's predecessor(s). How can I turn this to a list of arcs?
Without trying to manually sketch out a graph on paper, is there a simple way I could get the arcs between nodes in this problem? I am using R and it seems there must be an elegant way of doing so but ...
9
votes
2
answers
218
views
When should I use a solver for IP and MIP and can I just use a library from Python, R, Matlab, etc...?
Are there any rules of thumb for figuring out when you need to use a solver like Gurobi or CPLEX, and when you can just solve you problems directly with a Python, R, or Matlab package?
Is it just a ...
4
votes
2
answers
778
views
Queuing models in R, $\lambda$ Little
It's noted that the number of folks in a stationary system will maintain an average equal to the rate of arrival multiplied by the mean of the service distribution.
The formula $L = \lambda w$ is ...