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
505
votes
14 answers

What is an NP-complete in computer science?

What is an NP-complete problem? Why is it such an important topic in computer science?
Claudiu
  • 224,032
  • 165
  • 485
  • 680
271
votes
3 answers

How to interpret loss and accuracy for a machine learning model

When I trained my neural network with Theano or Tensorflow, they will report a variable called "loss" per epoch. How should I interpret this variable? Higher loss is better or worse, or what does it mean for the final performance (accuracy) of my…
125
votes
8 answers

Why should weights of Neural Networks be initialized to random numbers?

I am trying to build a neural network from scratch. Across all AI literature there is a consensus that weights should be initialized to random numbers in order for the network to converge faster. But why are neural networks initial weights…
120
votes
8 answers

What is an intuitive explanation of the Expectation Maximization technique?

Expectation Maximization (EM) is a kind of probabilistic method to classify data. Please correct me if I am wrong if it is not a classifier. What is an intuitive explanation of this EM technique? What is expectation here and what is being…
85
votes
4 answers

What is the minimum cost to connect all the islands?

There is a grid of size N x M. Some cells are islands denoted by '0' and the others are water. Each water cell has a number on it denoting the cost of a bridge made on that cell. You have to find the minimum cost for which all the islands can be…
83
votes
8 answers

How to display progress of scipy.optimize function?

I use scipy.optimize to minimize a function of 12 arguments. I started the optimization a while ago and still waiting for results. Is there a way to force scipy.optimize to display its progress (like how much is already done, what are the current…
Roman
  • 124,451
  • 167
  • 349
  • 456
77
votes
2 answers

Multiple variables in SciPy's optimize.minimize

According to the SciPy documentation, it is possible to minimize functions with multiple variables, yet it doesn't say how to optimize such functions. from scipy.optimize import minimize from math import * def f(c): return sqrt((sin(pi/2) +…
Henrik Hansen
  • 2,180
  • 1
  • 14
  • 19
76
votes
5 answers

What is the difference between Gradient Descent and Newton's Gradient Descent?

I understand what Gradient Descent does. Basically it tries to move towards the local optimal solution by slowly moving down the curve. I am trying to understand what is the actual difference between the plain gradient descent and the Newton's…
58
votes
13 answers

Best open source Mixed Integer Optimization Solver

I am using CPLEX for solving huge optimization models (more than 100k variables) now I'd like to see if I can find an open source alternative, I solve mixed integer problems (MILP) and CPLEX works great but it is very expensive if we want to scale…
50
votes
5 answers

Which is better way to calculate nCr

Approach 1: C(n,r) = n!/(n-r)!r! Approach 2: In the book Combinatorial Algorithms by wilf, i have found this: C(n,r) can be written as C(n-1,r) + C(n-1,r-1). e.g. C(7,4) = C(6,4) + C(6,3) = C(5,4) + C(5,3) + C(5,3) + C(5,2) . …
42
votes
6 answers

3 dimensional bin packing algorithms

I'm faced with a 3 dimensional bin packing problem and am currently conducting some preliminary research as to which algorithms/heuristics are currently yielding the best results. Since the problem is NP hard I do not expect to find the optimal…
42
votes
5 answers

Quadratic Program (QP) Solver that only depends on NumPy/SciPy?

I would like students to solve a quadratic program in an assignment without them having to install extra software like cvxopt etc. Is there a python implementation available that only depends on NumPy/SciPy?
flxb
  • 4,235
  • 3
  • 16
  • 11
38
votes
4 answers

Python constrained non-linear optimization

What's the recommended package for constrained non-linear optimization in python ? The specific problem I'm trying to solve is this: I have an unknown X (Nx1), I have M (Nx1) u vectors and M (NxN) s matrices. max [5th percentile of (ui_T*X), i in 1…
akhil
  • 839
  • 3
  • 8
  • 15
38
votes
2 answers

scipy minimize with constraints

Let's suppose I have a matrix arr = array([[0.8, 0.2],[-0.1, 0.14]]) with a target function def matr_t(t): return array([[t[0], 0],[t[2]+complex(0,1)*t[3], t[1]]] def target(t): arr2 = matr_t(t) ret = 0 for i, v1 in…
wa4557
  • 953
  • 3
  • 13
  • 25
37
votes
6 answers

Organizing felt tip pens: optimizing the arrangement of items in a 2D grid by similarity of adjacent items, using JS [updated]

UPD: the question has been updated with specifics and code, see below. Warning: This question is about optimizing an arrangement of items in a matrix. It is not about comparing colors. Initially, I have decided that providing context about my…
1
2 3
99 100