New answers tagged optimization
1
vote
Accepted
Efficient algorithm to count number of intersections of n sets
Assuming you really need the number for all pairs of sets and hearing that we are thinking of users in communities you could use the following algorithm which relies on the idea that the the average ...
1
vote
Accepted
A lower bound for the makespan of heterogenous fog nodes
Under the assumption that $EXT(N_i) = \mathit{MinMakespan}$,
$$
\sum_{k \in N_i \mathit{Tasks}} \mathit{length}(T_k) = \mathit{MinMakespan} \times \mathit{CPUrate}(N_i).
$$
Therefore
$$
\sum_k \mathit{...
2
votes
Accepted
Algorithm to compute cheapest path between two pixels in an image
That sounds like a variant of grid pathfinding(mostly used in game).
Generally, if your cost function has a good heuristics, A star will give you an optimal solution with least time cost. But space ...
0
votes
Solving linear programming problem with mixed type of constraints
You always need an initial solution. If you don't have one, you create another problem to get the initial solution.
In your case: Imagine you don't ship enough cars. Customer 1 misses $x_7$ and ...
1
vote
Compute a commutative and associative operation on n-2 arguments efficiently
(Motivation: let $h = n/2$.
Given $f_{ih} = f(x_i\dots x_{h-1}) \text{ and } f_{hj} = f(x_h\dots x_j)$ (precomputed in about $n$ evaluations of $f$),
$f(x_{i+1}\dots x_{j-1})$ can be computed as $f(f_{...
Community wiki
2
votes
Accepted
Compute a commutative and associative operation on n-2 arguments efficiently
(1) You can compute $f(x_1,\dots,x_{i-1})$ for all $i$ with $n-2$ calls to $f$. (Simply iterate over $i:=1,\dots,n$.)
(2) Then, using (1), you can compute $f(x_1,\dots,x_{i-1},x_{i+1},\dots,x_{j-1})$ ...

D.W.♦
- 141k
0
votes
Compute a commutative and associative operation on n-2 arguments efficiently
Count how many times each $x_i$ occurs in the argument list.
Suppose $X_1$ is the set of $x_i$ that occur once, $X_2$ is the set of $x_i$ that occur twice, ..., $X_m$ is the set of $x_i$ that occur $m$...
2
votes
Accepted
Complexity of the partition problem with additional constraint
As you mentioned the first problem can be reduced to the second one by replacing each positive integer $a_i\in S$ by a paired $(a_i,0)$. Moreover, the second problem can be reduced to the first one by ...
2
votes
Choosing a subset to maximize the minimum distance between points
This problem is known as the MaxMin Diversity Problem (MMDP). It is known to be NP-hard. However, there are algorithms for giving good approximate solutions in reasonable time, such as this one.
I'm ...
1
vote
Printing an array using recursion
It takes most (when not all) compilers more time to call a function, then to jump back with the programmcounter. (The number that indicates which line gets executed.)
When a function gets executed, ...
Top 50 recent answers are included
Related Tags
optimization × 1630algorithms × 816
graphs × 224
complexity-theory × 127
dynamic-programming × 100
linear-programming × 100
combinatorics × 86
np-hard × 77
scheduling × 75
approximation × 68
np-complete × 65
time-complexity × 61
machine-learning × 60
integer-programming × 59
reference-request × 57
computational-geometry × 57
greedy-algorithms × 56
knapsack-problems × 51
heuristics × 49
traveling-salesman × 43
genetic-algorithms × 42
sets × 38
search-algorithms × 37
data-structures × 34
network-flow × 33