All or nothing  fast heuristic shortest path algorithm (parallel?)
By : user3174587
Date : March 29 2020, 07:55 AM
may help you . A google search gives you a lot of good links. The first link itself talks about parallel implementations of two shortest path algorithms. And talking about implementation on CUDA, you will have to remember that billions of nodes = Gigabytes of memory. That would provide a limitation on the nodes you can use per card (for optimum performance) at a time. The maximum capacity of a graphics card currently in the market is about 6GB. This can give you an estimate on the number of cards you may need to use (not necessarily the number of machines).

Eight Queens Heuristic
By : Kaushik Gudapati
Date : March 29 2020, 07:55 AM
To fix this issue I am developing a heuristic to place 8 queens on 8x8 chessboard. each square has its own elimination number (to indicate how many squares of an empty chessboard are “eliminated” if a queen is placed in that square.) and the each queen should be placed in the square which has the lowest elimination number. , This piece of code is inherently flawed: code :
for (int queen = 0; queen < queens.length; queen++) {
placeQueens(queen);
}

fast generating 1000 means of sample points from truncated gamma distriution with 1000 different shapes and scales value
By : Jay Hopia
Date : March 29 2020, 07:55 AM
I hope this helps . There are several things going on here. First, you calculate the scales as: code :
scale.list < runif(1000, max = 100000, min = 100000)
f < function(shape,scale,lb,ub){
X < rtrunc(1000, spec="gamma", a=lb, b=ub,shape=shape,scale=scale)
return(c(mean=mean(X),sd=sd(X)))
}
# set.seed(1) # use this for a reproducible sample
result < mapply(f,shape.list,scale.list, lb=20,ub=50)
result.apply < data.frame(t(result))

Fast space partitioning heuristic?
By : Jaepil Jang
Date : March 29 2020, 07:55 AM
I think the issue was by ths following , SOLUTION I've found a heuristic that works great for my BSP tree purposes and which is also really interesting to analyze. In the code below, I first tried using a AABB tree to ask "which segments does this line intersect." But even this was too slow, so in the end I just went with a costly initial O(N^2) comparison algorithm that quickly speeds up as the BSP tree builds, using a somewhat clever observation! code :
for all splitters s in S
s.posCount = s.negCount = s.introduced = s.saved = 0
for all splitters vs in S
if (s == vs) continue
if vs is fully on the positive side of the plane of s
s.posCount++
else if vs is fully on the negative side of the plane of s
s.negCount++
else if vs intersects the plane of s
s.negCount++, s.posCount++, s.introduced++
else if vs is coplanar with s
s.saved++
evaluate(posCount, negCount, saved, introduced, treeDepth) {
float f;
if (treeDepth >= EVALUATE_X2) {
f = EVALUATE_V2;
} else if (treeDepth >= EVALUATE_X1) {
float r = treeDepth  EVALUATE_X1;
float w = EVALUATE_X2  EVALUATE_X1;
f = ((wr) * EVALUATE_V1 + r * EVALUATE_V2) / w;
} else {
f = EVALUATE_V1;
}
float balanceScore = f * BALANCE_WEIGHT * abs(posCount  negCount);
float freedomScore = (1.0ff) * (SAVED_WEIGHT * saved  INTRO_WEIGHT * introduced);
return freedomScore + balanceScore;
}
#define BALANCE_WEIGHT 437
#define INTRO_WEIGHT 750
#define SAVED_WEIGHT 562
#define EVALUATE_X1 3
#define EVALUATE_X2 31
#define EVALUATE_V1 0.0351639f
#define EVALUATE_V2 0.187508f
for all splitters s at this node
s.partner = null
if s == SEL then add s to "remnants"
else
if s is fully on the positive side of SEL
add s to "positives"
else if s is fully on the negative side of SEL
add s to "negatives
else if s intersects SEL
split s into two appropriate segments sp and sn
sp.partner = sn, sn.partner = sp
add sn to "negatives", sp to "positives" and s to "remnants"
else if s coplanar with SEL
add s to "remnants"
// the clever bit
if (positives.size() > negatives.size())
calcRelationCounts(negatives)
updateRelationCounts(positives, negatives, remnants)
else
calcRelationCounts(positives)
updateRelationCounts(negatives, positives, remnants)
add positives and negatives to appropriate child nodes for further processing
updateRelationCounts(toUpdate, removed, remnants) {
for all splitters s in toUpdate
for all splitters vs in removed, then remnants
if vs has a partner
if the partner intersects s
s.posCount++, s.negCount++, s.introduced++
else if the partner is fully on the positive side of s
s.posCount++
else if the partner is fully on the negative side of s
s.negCount++
else if the partner is coplanar with s
s.saved++
else
if vs intersects s
s.posCount, s.negCount, s.introduced
else if vs is fully on the positive side of s
s.posCount
else if vs is fully on the negative side of s
s.negCount
else if vs is coplanar with s
s.saved

Why greedy algorithm is heuristic, not metaheuristic?
By : user3628641
Date : March 29 2020, 07:55 AM

