Questions tagged [linear-programming]

An optimization technique for minimizing or maximizing a function of several variables in the presence of constraints where all relationships are linear.

Linear Programming is a mathematical optimization technique for minimizing or maximizing a linear function of several variables (called the objective function) subject to several linear constraints. The objective function and the set of constraints are collectively called the Linear Program.

The dual Simplex Method is a commonly used solution technique in Linear Programming. There are several commercial and open-source software packages for solving linear programs.

Brief history:
1939. Production, planning. [Kantorovich]
1947. Simplex algorithm. [Dantzig]
1947. Duality. [von Neumann, Dantzig, Gale-Kuhn-Tucker]
1947. Equilibrium theory. [Koopmans]
1948. Berlin airlift. [Dantzig]
1975. Nobel Prize in Economics. [Kantorovich and Koopmans]
1979. Ellipsoid algorithm. [Khachiyan]
1984. Projective-scaling algorithm. [Karmarkar]
1990. Interior-point methods. [Nesterov-Nemirovskii, Mehorta, ...]

External links:

2509 questions
6
votes
1 answer

How to quickly get a feasible solution to a linear program in Python?

Goal: Compute the intersection of two convex polytopes. I am using scipy.spatial.HalfspaceIntersection to do this. The following image shows the resultant intersection: My problem: Determine an initial feasible point. You see, the current Python…
6
votes
2 answers

LP modelling question... long time since school

Sure, this isn't a programming question, per se... but I couldn't think of a better place to ask it all the same. I'm writing an application that ultimately will assist a shopped to determine how to achieve the greatest savings on a specific site. …
Steven
  • 576
  • 1
  • 5
  • 12
6
votes
2 answers

How can I inscribe a rectangle or circle inside an arbitrary quadrilateral

This may be a more math focused question, but wanted to ask here because it is in a CS context. I'm looking to inscribe a rectangle inside another (arbitrary) quad with the inscribed quad having the largest height and width possible. Since I think…
Scott
  • 16,711
  • 14
  • 75
  • 120
6
votes
2 answers

Loading/Parsing Mathematical Programming System files

In order not to reinvent the wheel I tried to find some code to parse Mathematical Programming System files but I didnt find any implementations in python. Is there any code allready available for this? Update Reading Mathematical Prog.…
Panos Kalatzantonakis
  • 12,525
  • 8
  • 64
  • 85
6
votes
1 answer

How to increase iterations for scipy.optimize.linprog function in python?

I am trying to check if the train data is linearly separable or not. For that I am using the following code. try: import os import random import traceback import numpy as np import scipy.io as sio from…
V K
  • 1,645
  • 3
  • 26
  • 57
6
votes
1 answer

Defining the Linear Programming Model for Traveling Salesman in Python

Using Python and PuLP library, how can we create the linear programming model to solve the Traveling Salesman Problem (TSP)? From Wikipedia, the objective function and constraints are Problem: Here is my partial attempt where I am stuck. I did…
Nyxynyx
  • 61,411
  • 155
  • 482
  • 830
6
votes
1 answer

Multiple depot vehicle scheduling

I have been playing around with algorithms and ILP for the single depot vehicle scheduling problem (SDVSP) and now want to extend my knowledge towards the multiple depot vehicle scheduling problem (MDVSP), as i would like to use this knowledge in a…
Allasea
  • 61
  • 2
6
votes
2 answers

error: iostream.h due to including cplex

I am trying to use cplex in eclipse in Ubuntu 12.04 but when I include ilocplex.h I get the following error /opt/ibm/ILOG/CPLEX_Studio124/concert/include/ilconcert/ilosys.h:360:22: fatal error: iostream.h: No such file or directory The only two…
Shahab
  • 129
  • 1
  • 2
  • 8
6
votes
5 answers

Elegant way to count number of elements in each column of a matrix that are greater than those in every other column?

I currently have a solution that works. I'm wondering if there is a more elegant approach? First the setup: set.seed(315) mat <- matrix(sample(1:5, 20, replace = TRUE), nrow = 4, ncol = 5) > mat [,1] [,2] [,3] [,4] [,5] [1,] 3 4 1 …
Christian Lemp
  • 385
  • 1
  • 3
  • 10
6
votes
1 answer

How can I write an if condition for my variable in GLPK?

Here is my full problem: Information: *Max. total investment: $125 *Pay-off is the sum of the units bought x pay-off/unit *Cost per investment: Buy-in cost + cost/unit x number of units if you buy at least one unit *The cost is sum of the costs per…
Figen Güngör
  • 12,169
  • 14
  • 66
  • 108
6
votes
3 answers

AMPL cannot find "minos"

I've faced a problem with AMPL. I'm using 32-bit version of Linux OS. I'm trying to solve a simple linear programmin problem but I can't understand what is wrong... Here is model, data files and session script as well. The answer to command "solve"…
Roman Dryndik
  • 1,167
  • 1
  • 13
  • 34
6
votes
2 answers

Shortest distance from a point to this curve

I need to find the distance of multiple points to a curve of the form: f(x) = a^(k^(bx)) My first option was using its derivative, using a line of the form with the inverse of the derivative, giving it coordinates of the Point and intersecting it…
OFRBG
  • 1,653
  • 14
  • 28
6
votes
2 answers

Vertex-Coloring/Assignment to minimize the number of "color crossings"

I am not sure if this is really a "coloring" problem as much as it is an assignment/linear-programming problem. I have zero expertise in either, so pardon any noob-ness that might follow. But I get the feeling that this problem must have almost…
6
votes
5 answers

Any good tools to solve integer programs on linux?

Are there any good tools to solve integer programs on Linux? I have a small problem that I want to compute to save time :D. It is kind of a subset sum problem. I have a list of around 20 Integer-Values and I want to compute the subset with the…
mageta
  • 677
  • 2
  • 8
  • 12
5
votes
1 answer

SAT/CNF optimization

Problem I'm looking at a special subset of SAT optimization problem. For those not familiar with SAT and related topics, here's the related Wikipedia article. TRUE=(a OR b OR c OR d) AND (a OR f) AND ... There are no NOTs and it's in conjunctive…
Simon
  • 1,814
  • 20
  • 37