Skip to main content
Filter by
Sorted by
Tagged with
2 votes
3 answers
125 views

i have a list of Hitters in python with their name,projection and Positions juan-soto 30.3773 ['OF'] kyle-tucker 44.0626 ['OF'] ... yordan-alvarez 32.510200000000005 ['CI', 'OF'] william-contreras 26....
markus's user avatar
  • 21
1 vote
1 answer
202 views

In pulp's documentation https://coin-or.github.io/pulp/guides/how_to_debug.html, it says that Check the precision of the numbers. If you have very big numbers (with a high precision), this generally ...
Matt Cremeens's user avatar
0 votes
1 answer
144 views

I've created a small program using the java clp implementation https://github.com/quantego/clp-java. Sometimes the solution returns decimals, which I don't want as the variables that I'm using are ...
Wouter's user avatar
  • 185
3 votes
1 answer
81 views

Problem: Given an array of integers inputs and an integer output, return an array of non-negative integers weights such that the sum of the element-wise product of inputs and weights equals output and ...
Gigi Bayte 2's user avatar
  • 1,014
-1 votes
2 answers
70 views

I have a LP/IP problem that I'm trying to solve using PuLP. It is the division of work amongst employees. The thing that I can't figure out is how to limit the engine to only plan 1 employee on an ...
Paul's user avatar
  • 1,897
0 votes
0 answers
92 views

I have a problem with MATLAB intlinprog. I have a problem about assigning worker types to jobs. Each job must assigned to one type of worker. The same type of worker can be assigned to different jobs. ...
user2018's user avatar
0 votes
1 answer
111 views

I have a binary/integer program that I am trying to solve using milp in Python. Below the image and below is the code I have so far. When I run it, I get `bounds.lb` and `bounds.ub` must contain ...
gunsnfloyd's user avatar
0 votes
1 answer
580 views

I have for example the following integer variables x1, x2, x3 and y1, y2, y3. Is there a way to constrain them in the following ways? For example: min(x1, x2, x3) + min(y1, y2, y3) <= 100 or max(...
sunlee's user avatar
  • 13
1 vote
1 answer
96 views

I'm trying to assign attributes into a 3 x 3 matrix based on an adjacency constraint, but I'm stuck formulating the adjacency constraint. I keep thinking I've got the answer, then when I try it the ...
Ryan's user avatar
  • 3,729
1 vote
0 answers
87 views

I'm trying to array genes (elements) in a matrix (matrix_a) based on the restriction sites they have (attributes). Restriction sites are recognized by enzymes that cut the DNA at a specific site. This ...
Ryan's user avatar
  • 3,729
2 votes
1 answer
120 views

I am currently solving an integer programming problem using Pulp. I am aware that the order of statements in Pulp modeling can affect the outcome of the computations. However, I am curious to know if ...
たかひろ's user avatar
2 votes
2 answers
91 views

I'm trying to use the integer programming option to find a magic square. The algorithm finds a solution if I remove the requirement the entries are unique. I can add up to six requirements for entries ...
Bob Hesse's user avatar
0 votes
1 answer
143 views

The background is I am trying to implement a bilevel optimization program using Python-based package for Adversarial Optimization (PAO), which is based on Pyomo. I am new to Pyomo, though I have used ...
Francis's user avatar
  • 199
0 votes
0 answers
344 views

I want to implement the constraint that the number of non-zero elements per row in x is less than 2. constraint2 = cp.sum( x >= 0, 1) <= 2 but get the error TypeError: float() argument must be ...
ChaoII's user avatar
  • 1
0 votes
1 answer
138 views

I'm playing around with OR Tools, just wondering if there is any way to hold the number of times a certain constraint is satisfied? In this case, I'd like to keep track of the number of times my 'diff'...
thehumbling's user avatar
0 votes
1 answer
92 views

I'd like to order an arbitrary number of elements into an arbitrarily shaped matrix (matrix_a) based on values in a binary matrix (element_map) that describes attributes of the elements. matrix_b ...
Ryan's user avatar
  • 3,729
0 votes
1 answer
205 views

if x ≥ 100, then x -100 + p(x) ≤ 0; else p(x) ≤ 0 p(x) is a linear function. We can add x ≥ 0 if it could make it easy. I tried to make a binary variable z, if x ≥ 100, then z=1; else z=0. Then we got ...
Yinuo SHI's user avatar
0 votes
0 answers
75 views

Im trying to define a complex labor rule as constraints in a MIP, solved with CPLEX. My key decision variable is a binary x(i,j) indicating if shift i is assigned to employee j. The labor rule is as ...
Frank Steenbergen's user avatar
2 votes
1 answer
86 views

I am trying to set up something similar to the facility location problem using gekko in python. I'm trying to minimize the distance between a set of facilities and corresponding counties while ...
finman69's user avatar
  • 311
0 votes
1 answer
94 views

In here I couldn't get calculations of y1,y2 and y3 when I try my code y1,y2 and y3 was not calculated. how can I fix this from pulp import * model = LpProblem("LineBalancing",LpMinimize) ...
Alpaslan Kurt's user avatar
0 votes
1 answer
105 views

I'm working on a binary integer programming problem using pulp. I have a vector X = [x_1, x_2, x_3, . . . , x_n]. I have enforced a number of simple constraints. I have a bunch of groups in the data ...
user16668649's user avatar
1 vote
1 answer
463 views

I have a convex non-linear integer program of the following form: K is a fixed integer greater than 0. Betas are real numbers greater than zero. Note that x is a positive integer and the function to ...
LucG's user avatar
  • 1,413
2 votes
2 answers
112 views

I have a vector of 100 integers, x1, where each element of the vector is in [1, 7]. I want to find, using R, another vector of 100 elements, x2, also containing integers ranging from 1 to 7, that ...
Edward's user avatar
  • 22.2k
1 vote
2 answers
253 views

I am trying to create a matching algorithm using pulp but the results for the sample data I'm getting are wrong as I think the function is flawed. Sample data: users = { 1: (5.0, 4.0, 1.0, 2, 1, 1)...
Olivia's user avatar
  • 814
0 votes
2 answers
733 views

I want to use Gurobi with python-mip. I run the following: from mip import Model, GUROBI Model("test_problem", solver_name=GUROBI) I receive the following error: InterfacingError('Gurobi ...
Sean Kelley's user avatar
1 vote
1 answer
86 views

I have an equation y*8.57E-7 = x with the constraints: x>0 x should be an integer y should be an integer It might be solved with dynamic programming, but I am weak in analyzing it this way. For ...
umair mughal's user avatar
0 votes
1 answer
100 views

I am using R to find the set of values that maximise a certain function (the function is given here by obj_fun). The problem is that for a large number of the parameter pD, I get an integer overflow ...
HeyCool08's user avatar
0 votes
3 answers
465 views

Problem set: I have 3 different groups that need to be assigned to 6 different locations. Objective: I need to minimize the unused space in each location. Constraints: For each location j, the sum of ...
user21861449's user avatar
0 votes
1 answer
157 views

I have a decision variable vector n, and a is a constant vector. What confuses me is why lpDot(a,n) is not equivalent to lpSum([a[i] * n[i] for i in range(N)]) in a constraint? Here is the code: ...
Yfiua's user avatar
  • 418
2 votes
1 answer
314 views

I am trying to run a minimization problem for an MIP using Gurobi in Julia. I would like it to stop after it has found a solution that is below a certain threshold that I have set. I have found ways ...
Sun Lee's user avatar
  • 21
0 votes
1 answer
282 views

I have the below dataframe: import itertools import pandas as pd import numpy as np p1_values = np.arange(19, 29.1, 0.1) p2_values = np.arange(23, 33.1, 0.1) p3_values = np.arange(36, 46.1, 0.1) ...
Manny's user avatar
  • 63
1 vote
1 answer
237 views

I'm trying to solve the following using OR tools: Given the following bags containing different colors of balls: bag red blue green black A 10 5 85 0 B 25 50 25 0 C 0 100 0 0 D 90 5 5 0 E 2 0 98 0 F 0 ...
Chris's user avatar
  • 564
0 votes
0 answers
35 views

In a Milp, given an integer variable x, I would like to define a variable y which will be the absolute value of x. y = |x| x is bounded between [M, -M]. Is it even possible? Thank you!
BladesV's user avatar
  • 103
2 votes
2 answers
1k views

I will be grateful to anyone who can help me write some Python code to enumerate the 21×2×3 arrays, indexed with i, j and k, which are two-thirds filled with 0's and one-third filled with the values '...
S.R.'s user avatar
  • 23
1 vote
2 answers
1k views

I am new to integer optimization. I am trying to solve the following large (although not that large) binary linear optimization problem: max_{x} x_1+x_2+...+x_n subject to: A*x <= b ; x_i is binary ...
Francisco Espinosa's user avatar
1 vote
1 answer
2k views

I am trying to get all solutions for a Mixed Integer program through ortools. I have two lists x and y of size 4. I want to get all solutions which satisfy sum(x) = 4 * sum(y). I created a function ...
Vinay's user avatar
  • 1,281
1 vote
1 answer
442 views

I found a solution for just one term here. How can we formulate constraints of the form |x1- a1| +|x2-a2| + .... + |xn - an| >= K in Mixed Integer Linear Programming ?
Vinay's user avatar
  • 1,281
0 votes
1 answer
169 views

I'm new to python and pyomo, so I would kindly appreciate your help, I'm currently having trouble trying to add a constraint to my mathematical model in Pyomo, the problem is while I try to add the &...
ehsan mirzaei's user avatar
0 votes
1 answer
141 views

I have a finite number of staff N, and I need to find an optimal schedule (using the least number of staff) meeting the demand Hour of Day Demand 0 d0 1 d1 ... ... 23 d23 where the d0, d1, ..., d23 ...
Elis's user avatar
  • 54
0 votes
1 answer
253 views

I have written an optimization model that has 3 binary decision variables that are all in matrix form (X[p,s], Y[a,s], and Z[a,p]). a=associate, p=process, and s=station. I have encountered an issue ...
Brett Davis's user avatar
0 votes
1 answer
75 views

The goal of the docplex model below is to choose the trucks with total minimum cost to fulfill all orders. I treat the truck type as 1 truck in the following code, but in fact, a truck type can have ...
william007's user avatar
  • 18.8k
-1 votes
1 answer
77 views

I was wondering if, given a min cost flow problem and an integer n, there is an efficient algorithm/package or mathematical method, to obtain the set of the n-best basic solutions of the min cost flow ...
Giacomo's user avatar
  • 101
0 votes
0 answers
284 views

Let A be a list of n lists of m non-negative integers, such that for all j there is i with A[i][j] nonzero. Let V be a list of m positive integers. Question: What is the fastest way to find all the ...
Sebastien Palcoux's user avatar
0 votes
2 answers
372 views

I'm still relatively new to python so I'm having trouble figuring out how to accomplish a certain feat. What I'm trying to do: I have an Excel file with two columns - Sell and margin. There could be a ...
Cayshin's user avatar
  • 11
2 votes
1 answer
863 views

These are the conditions: if(x > 0) { y >= a; z <= b; } It is quite easy to convert the conditions into Linear Programming constraints if x were binary variable. But I am not finding ...
whitehatjrbhups's user avatar
0 votes
1 answer
1k views

Overview I am working on an order allocation problem with variable and fixed costs. The initial formulation of this problem was a linear optimization, but when fixed and variable costs were introduced,...
Ammaar's user avatar
  • 1
0 votes
0 answers
315 views

I am creating an integer program in Python using pyomo for Major League Baseball (MLB) daily fantasy. Given a lineup of 10 players (1 of each position plus 2 pitchers) and a salary cap, the program ...
JRP's user avatar
  • 135
0 votes
0 answers
300 views

Integer programming is said to be NP-complete. However, I think formulating a problem into ILP can't prove the problem to be NP-hard. Is there any example of problem that can be modeled into ILP but ...
Peter Chan's user avatar
0 votes
1 answer
212 views

I am trying to formulate an MIP model in which a transportation can be performed by available trains or new ship investments. My current code includes three tables: Monthly costs for trains, monthly ...
user avatar
0 votes
1 answer
1k views

I'm attempting to solve an optimization program in cvxpy. The issues is that the answer it returns violates the basic constraint that it was given. I've run this program before with success and ...
ewolf's user avatar
  • 39

1
2 3 4 5
7