Questions tagged [mathematical-optimization]

Mathematical optimization deals with maximizing or minimizing an objective function by choosing values from within an allowed feasible set of possible values. Mathematical optimization is often also referred to as mathematical programming or simply as optimization.

Mathematical optimization deals with maximizing or minimizing a real function by choosing values from within an allowed feasible set of possible values. Mathematical optimization is often also referred to as mathematical programming or simply as optimization.

Thus, the study of Mathematical optimization includes formulating the problem (as a set of mathematical equations), and developing several solution techniques. These techniques exploit the underlying structure of the problem. Different optimization algorithms are suited for different types of problems and vary in solution times and computational complexity.

The goal (to be maximized or minimized) is called the "Objective Function." The set of equations that limit the solution space are the "constraints" and the possible solution space is the "feasible region." In some problems, the aim is to just find any acceptable solution, and these are called "constraint satisfaction problems" in which case there is no real objective function to be minimized or maximized.

Broadly, Mathematical Optimization falls under the area of "Applied Mathematics."

3356 questions
13
votes
2 answers

Get constraints in matrix format from gurobipy

I coded my model in gurobipy and I want to get the matrix of constraints and vector of cost. Is there any way to access those?
13
votes
3 answers

Example to understand scipy basin hopping optimization function

I came across the basin hopping algorithm in scipy and created a simple problem to understand how to use it but it doesnt seem to be working correctly for that problem. May be I'm doing something completely wrong. Here is the code: import…
akhil
  • 839
  • 3
  • 8
  • 15
12
votes
3 answers

What is the R equivalent of Matlab's fminunc function?

In order to compute the optimal theta e.g. in logistic regression, I have to create a costFunction (the function to be minimized) which is then passed to fminunc in order to obtain the optimal theta. Also, if the gradient of costFunction can be…
gd047
  • 29,749
  • 18
  • 107
  • 146
12
votes
2 answers

Generate teams of similar strengths with contiguous areas

Idea It's quite sad that so many great countries (e.g. India) and players (e.g. Mo Salah) may never play at the FIFA (football/soccer) World Cup (the same argument could apply as well to other sports events dominated by a handful of dominant teams,…
Mark
  • 7,785
  • 2
  • 14
  • 34
12
votes
1 answer

NMinimize seems to be on crack

Say I have a crazy function, f, defined like so: util[x_, y_, c_] := 0.5*Log[c-x] + 0.5*Log[c-y] cost[x_, y_, l_] := c /. First[NSolve[util[x, y, c+l] == Log[10+l], c]] prof[x_, y_] := 0.01*Norm[{x,y}, 2] liquid[x_, y_] := 0.01*Norm[{x,y},…
dreeves
  • 26,430
  • 45
  • 154
  • 229
12
votes
1 answer

How to build hybrid model of RF(Random Forest) and PSO(Particle Swarm Optimizer) to find optimal discount of products?

I need to find optimal discount for each product (in e.g. A, B, C) so that I can maximize total sales. I have existing Random Forest models for each product that map discount and season to sales. How do I combine these models and feed them to an…
12
votes
1 answer

Randomizing balanced experimental designs

I am writing some code to generate balanced experimental designs for market research, specifically for use in conjoint analysis and maximum difference scaling. The first step is to generate a Partially Balanced Incompleted Block (PBIB) design. This…
Andrie
  • 176,377
  • 47
  • 447
  • 496
12
votes
2 answers

How to use opencv bundle adjustment

I have calculated 5 camera matrices (c1, ... c5), camera matrices are calculated by placing a 3D object at 5 different positions and for each position I have calculated camera matrix (and camera is constant). Camera matrix is calculated using SVD…
Deepak
  • 1,038
  • 5
  • 17
  • 44
12
votes
4 answers

Any efficient way to calculate the sum of harmonic series upto nth term? 1 + 1/2 + 1/3 + --- + 1/n =?

Is there any formula for this series "1 + 1/2 + 1/3 + --- + 1/n = ?" I think it is a harmonic number in a form of sum(1/k) for k = 1 to n.
user451587
  • 385
  • 2
  • 8
  • 21
12
votes
9 answers

Optimization packages for R

Does anyone know of any optimization packages out there for R (similar to NUOPT for S+)?
wcm
  • 9,045
  • 7
  • 39
  • 64
12
votes
0 answers

Warm-start linear programming in Python?

I'm working on an mid-sized linear program (70k x 10k sparse constraint matrix) and need to run a large number of scenarios, requiring ~2,000 CPU-hours at my current solve time. Because the changes are relatively minor (changing at most ~10% of the…
emunsing
  • 9,536
  • 3
  • 23
  • 29
12
votes
3 answers

How to perform discrete optimization of functions over matrices?

I would like to optimize over all 30 by 30 matrices with entries that are 0 or 1. My objective function is the determinant. One way to do this would be some sort of stochastic gradient descent or simulated annealing. I looked at scipy.optimize but…
Simd
  • 19,447
  • 42
  • 136
  • 271
12
votes
3 answers

Rectangle packing with constraints

I want to pack a set of rectangles (example): So that the total height is as low as possible with the constraint that the rectangles must end up in the same column they started in. The rectangles are allowed to "move" through each other to reach…
Andreas Brinck
  • 51,293
  • 14
  • 84
  • 114
12
votes
2 answers

Solving an integer linear program: why are solvers claiming a solvable instance is infeasible?

I'm trying to solve integer programming problems. I've tried both use SCIP and LPSolve For example, given the final values of A and B, I want to solve for valA in the following C# code: Int32 a = 0, b = 0; a = a*-6 + b + 0x74FA - valA; b = b/3 + a +…
Craig Gidney
  • 17,763
  • 5
  • 68
  • 136
12
votes
7 answers

Parallel many dimensional optimization

I am building a script that generates input data [parameters] for another program to calculate. I would like to optimize the resulting data. Previously I have been using the numpy powell optimization. The psuedo code looks something like this. def…
Daniel
  • 19,179
  • 7
  • 60
  • 74