mathematical-optimization

How do multiple calls on a single threaded DLL function scale?

柔情痞子 提交于 2019-12-13 01:22:56
问题 Currently I have a DLL that accesses a MILP calculation within MATLAB, from what I understand most MILP solvers are single threaded, and I was wondering how/if that comes into play with multiple simultaneous calls on the MILP solver. Do the calculations queue up behind each other and all process across that single thread or is there some way of spreading the load? I am trying to understand how effectively this combination scales from a single call to 100 near simultaneous calls. Does it

Using gurobi with java vs gurobi with ampl

霸气de小男生 提交于 2019-12-12 23:35:03
问题 What are the advantages of using Gurobi with AMPL instead of using Gurobi direct API (java, C#, C++, etc.) for solving large MIP problems? Are there performance benefits when using Gurobi's API instead of AMPL? 回答1: Up until the mid 90's the only practical options for using a MIP solver with large scale problems (so excluding spreadsheets) were creating mps files using the low-level C interface (known as the callable library in cplex) using a domain specific language like AMPL or GAMS. At the

Optimization with positive integer parameters

假如想象 提交于 2019-12-12 16:17:31
问题 I need to solve a problem which entails comparing two matrices with the same number of columns. One of these is manipulated until the best match is obtained. The way I score the differences between the two matrices is quite convoluted and I still have to finalize it. What I'm really interested at the moment in is finding a search/optimization algorithm that works with positive integers only. I've created a simple example with a simple function to maximise. Let's say I have a dataset D. D <-

Why does IPOPT evaluate objective function despite breaching constraints?

こ雲淡風輕ζ 提交于 2019-12-12 16:09:44
问题 I'm using IPOPT within Julia. My objective function will throw an error for certain parameter values (specifically, though I assume this doesn't matter, it involves a Cholesky decomposition of a covariance matrix and so requires that the covariance matrix be positive-definite). As such, I non-linearly constrain the parameters so that they cannot produce an error. Despite this constraint, IPOPT still insists on evaluating the objective function at paramaters which cause my objective function

Why do results from optim() depend on initial values?

限于喜欢 提交于 2019-12-12 14:18:19
问题 In R, I am using the function optim() to find the minimum of an objective function of two variables. The real objective functions I'm working with are quite complex, so I tried to familiarize myself with the a simpler objective function. The simplest way to run optim() is optim(par,function) where par is a vector of initial values for the algorithm. I find that the answer I get depends heavily on the initial values I input. However, the function I used is so simple, I'm worried that I am

Maximize function with fminsearch

ε祈祈猫儿з 提交于 2019-12-12 13:35:12
问题 Within my daily work, I have got to maximize a particular function making use of fminsearch ; the code is: clc clear all close all f = @(x,c,k) -(x(2)/c)^3*(((exp(-(x(1)/c)^k)-exp(-(x(2)/c)^k))/((x(2)/c)^k-(x(1)/c)^k))-exp(-(x(3)/c)^k))^2; c = 10.1; k = 2.3; X = fminsearch(@(x) f(x,c,k),[4,10,20]); It works fine, as I expect, but not the issue is coming up: I need to bound x within certain limits, as: 4 < x(1) < 5 10 < x(2) < 15 20 < x(3) < 30 To achieve the proper results, I should use the

What's the most efficient tail recursive prime verification function known?

那年仲夏 提交于 2019-12-12 13:19:52
问题 I was experimenting with meta programming to this point: // compiled on Ubuntu 13.04 with: // clang++ -O3 -ftemplate-depth-8192 -fconstexpr-depth=4096 -std=c++11 -stdlib=libc++ -lcxxrt -ldl compile-time-primes.cpp -o compile-time-primes // assembly output with: // clang++ -S -mllvm --x86-asm-syntax=intel -O3 -ftemplate-depth-8192 -fconstexpr-depth=4096 -std=c++11 -stdlib=libc++ -lcxxrt -ldl compile-time-primes.cpp -o compile-time-primes.asm #include <array> #include <iostream> template

Find the point minimizing the distance from a set of N lines

社会主义新天地 提交于 2019-12-12 09:41:03
问题 Given Multiple (N) lines in 3d space, find the point minimizing the distance to all lines. Given that the Shortest distance between a line [aX + b] and a point [P] will be on the perpendicular line [aX+b]–[P] I can express the minimal squared distance as the sum of squared line distances, eg. ([aX+b]–[P])^2 +…+ ([aX+b]n–[P])^2 . Since the lines are perpendicular I can use Dot Product to express [P] in the line terms I have considered using Least Squares for estimating the point minimizing the

Changing start dates of schedules to optimize resources

六月ゝ 毕业季﹏ 提交于 2019-12-12 08:55:23
问题 I have a bunch of work that needs to be performed at specific time intervals. However, we have limited resources to do that work, each day. Therefore, I am trying to optimize the start time dates (start time dates can only be moved forward not backward) so that resources used everyday are more less similar to what we have budgeted for. These functions are used in example below:: # Function to shift/rotate a vector shifter <- function(x, n = 1) { if (n == 0) x else c(tail(x, -n), head(x, n)) }

How to use constraint programming for optimizing shopping baskets?

耗尽温柔 提交于 2019-12-12 08:54:31
问题 I have a list of items I want to buy. The items are offered by different shops and different prices. The shops have individual delivery costs. I'm looking for an optimal shopping strategy (and a java library supporting it) to purchase all of the items with a minimal total price. Example: Item1 is offered at Shop1 for $100, at Shop2 for $111. Item2 is offered at Shop1 for $90, at Shop2 for $85. Delivery cost of Shop1: $10 if total order < $150; $0 otherwise Delivery cost of Shop2: $5 if total