Skip to main content

Questions tagged [heuristics]

Filter by
Sorted by
Tagged with
25 votes
3 answers
21k views

3d Packing algorithm for item's shipping

I've received a task to build a shipping estimative that suggests the best accomodation of goods on as few boxes as possible: There is a finite set of known retangular box sizes There are many ...
Ricardo Souza's user avatar
16 votes
8 answers
2k views

Should you abandon an ORM framework when you need to implement a bulk operation?

Here's a common situation: You need to implement a bulk operation in an application that uses an ORM framework. After the first pass, you've noticed significant performance problems. Here's my ...
Jim G.'s user avatar
  • 8,015
15 votes
6 answers
9k views

Unstable output C++: running the same thing twice gives different output

So, the problem: When I run the same C++ code in Visual Studio, with the same input and parameters, I get either the correct output, or an output that is completely messed up (99% of values go to zero)...
babipsylon's user avatar
12 votes
1 answer
484 views

Heuristic Approach for Flexible DIFF Implementation

I have created a DIFF implementation to compare document revisions at work. It is based on An O(ND) Difference Algorithm and Its Variations. One thing that has become important is to take the list ...
ptpaterson's user avatar
10 votes
2 answers
2k views

How do I unit test a heuristic algorithm?

Say we have our route finding algorithm: def myHeuristicTSP(graph): /*implementation*/ return route Now we want to unit test this: class TestMyHeuristicTSP: def ...
dwjohnston's user avatar
  • 2,677
8 votes
1 answer
810 views

heuristic for searching through non-perfectly sorted data

Given sorted data, the search solution is obvious. Given unsorted data, sensible options are sort then search or just linear search. This question is about what to do if the data is somewhat sorted, ...
MandoMando's user avatar
7 votes
5 answers
4k views

Finding an A* heuristic for a directed graph

In a previous question, I asked about finding a route (or path if you will) in a city. That is all dandy. The solution I chose was with the A* algorithm, which really seems to suit my needs. What I ...
Janis Peisenieks's user avatar
6 votes
4 answers
4k views

Development of a bot/web crawler detection system

I am trying to build a system for my company which wants to check for unusual/abusive pattern of users (mainly web scrapers). Currently the logic I have implemented parses the http access logs and ...
bilkulbekar's user avatar
6 votes
1 answer
1k views

Mathematically correct A* heuristic / distance estimator for a latitude / longitude graph

I have a graph in which each node is a geographical point on the surface of the earth, defined by it's latitude / longitude coordinates. Correct ways to calculate the distance between two such points ...
Tiborg's user avatar
  • 293
3 votes
3 answers
555 views

How to model heuristic uncertainty when sorting data?

Sorting algorithms assume you have a defined comparator. For example, if sorting integers A and B, the A > B operation allows you to determine if A should be after or before B. Imagine you want ...
enderland's user avatar
  • 12.1k
2 votes
1 answer
1k views

Why are heuristics a disadvantage for decidable problems?

I'm reading Introduction to Artificial Intelligence by Ertel. This line has me stumped from the textbook (page 102): For decidable problems such as the 8-puzzle this means that the whole search ...
nullpointer's user avatar
0 votes
3 answers
3k views

A* search for Sudoku

I have a homework problem for an Artificial Intelligence course that I am having trouble answering. Consider solving the Sudoku problem using A* search. The start state has some number of cells ...
Shawn's user avatar
  • 1
0 votes
1 answer
189 views

How to find the running time of an algorithm that involves heuristics

I am working with A* algorithm, in which I have a 2D grid and given two points, find the shortest distance between them, while not running into any obstruction. Now, for each cell, I find the ...
Kraken's user avatar
  • 117
0 votes
0 answers
83 views

What algorithm should I use to optimize a bike sharing redistribution system?

I want to optimize a bike-sharing redistribution system( find the best way for an agent to take bikes from a station that has more bikes than needed and relocate them to a station that needs more ...
Relu Morosan's user avatar
0 votes
0 answers
51 views

Feasible solution on the constructions phase of GRASP

I am learning about the GRASP (Greedy Randomized Adaptive Search) meta-heuristics. From what I understood, GRASP is based on two main phases. The first one: Construct a initial solution based on a ...
lhahn's user avatar
  • 113
0 votes
0 answers
137 views

AlienTiles optimistic heuristic function

Hello I am trying to use the alienTile problem described at www.alientiles.com using the A* algorithm but I cannot find any good heuristic function so far. In alien tiles you have a board with NxN ...
Mario's user avatar
  • 133