Questions tagged [heuristics]

Heuristics refers to the use of algorithms to deal with highly complex problems.

Heuristics refers to the use of algorithms to deal with highly complex problems. A heuristic approach seeks to provide an approximate solution for a problem that is otherwise unsolvable.

683 questions
7
votes
1 answer

If optimizations are enabled will the JIT always inline this method?

I am not expecting a definite yes or no. Any knowledge you might have I will consider as an answer. private String CalculateCharge(Nullable bill, Nullable rate) { return ((bill ?? 0.0m) * (rate ?? 0.0m)).ToString("C"); }
ChaosPandion
  • 77,506
  • 18
  • 119
  • 157
6
votes
2 answers

What are the real differences between genetic algorithms and evolutionary algorithms?

I am reading some papers about Genetic Algorithms and often they mention Evolutionary Algorithms in a very similar way. According to Wikipedia, GAs are subset of EAs. However, if we look closer, we can notice that both are metaheuristic optimization…
omar
  • 305
  • 1
  • 3
  • 10
6
votes
6 answers

concrete examples of heuristics

What are concrete examples (e.g. Alpha-beta pruning, example:tic-tac-toe and how is it applicable there) of heuristics. I already saw an answered question about what heuristics is but I still don't get the thing where it uses estimation. Can you…
Odine
  • 85
  • 1
  • 6
6
votes
2 answers

Is best first search optimal and complete?

I have some doubts regarding best first search algorithm. The pseudocode that I have is the following: best first search pseudocode First doubt: is it complete? I have read that it is not because it can enter in a dead end, but I don't know when can…
6
votes
3 answers

A star algorithm: using Heuristic value to act as Tie-breaker where nodes have identical F-values

Background: I am currently working on an 8-puzzle implementation of the original A Star algorithm and comparing this with a slightly modified algorithm which intends to improve node expansion (using additional information, ofcourse A Star in an…
jwwnz
  • 703
  • 2
  • 7
  • 13
6
votes
2 answers

How do I compare the similarity of person names using a metric?

I am particularly working on a function to allow the misspelled and aliases of person names. I have done some research & found there are quite a number of algorithms for String metric and phonetic libraries too. I have tried some and of all those…
Vamsidhar
  • 822
  • 11
  • 24
6
votes
3 answers

Probability density function from a paper, implemented using C++, not working as intended

So i'm implementing a heuristic algorithm, and i've come across this function. I have an array of 1 to n (0 to n-1 on C, w/e). I want to choose a number of elements i'll copy to another array. Given a parameter y, (0 < y <= 1), i want to have a…
hfingler
  • 1,931
  • 4
  • 29
  • 36
6
votes
7 answers

Letting the code try different things until it succeeds, neatly

This is the second time I found myself writing this kind of code, and decided that there must be a more readable way to accomplish this: My code tries to figure something out, that's not exactly well defined, or there are many ways to accomplish it.…
Henrik Paul
  • 66,919
  • 31
  • 85
  • 96
6
votes
3 answers

Are there any CSS padding heuristics that I can follow?

I have a simple problem: I have an image inside of a div. In order to make the page more aesthetically pleasing, I'm going to add some additional padding to the image. Rather than eyeball it, I'd like to know: Are there any CSS padding heuristics…
Jim G.
  • 15,141
  • 22
  • 103
  • 166
6
votes
1 answer

Are heuristic functions that produce negative values inadmissible?

As far as I understand, admissibility for a heuristic is staying within bounds of the 'actual cost to distance' for a given, evaluated node. I've had to design some heuristics for an A* solution search on state-spaces and have received a lot of…
rjs
  • 838
  • 2
  • 10
  • 21
6
votes
4 answers

Heuristic for A*-Algorithm with irregular distances between nodes

I am currently working on an implementation of the A* Algorithm with irregular distances between two nodes. The graph containing the nodes is a directed and weighted graph. Every node is connected to at least one other node, there may also be…
mezzodrinker
  • 998
  • 10
  • 28
6
votes
3 answers

Suboptimal solution given by A* search

I don't understand how the following graph gives a suboptimal solution with A* search. The graph above was given as an example where A* search gives a suboptimal solution, i.e the heuristic is admissible but not consistent. Each node has a…
eejs
  • 307
  • 4
  • 17
6
votes
2 answers

Why do admissable heuristics guarantee optimality?

Today in class, my professor introduced us to admissable heuristics, and stated that they guarantee optimality for the A* algorithm. I asked him to explain it using an extreme example to make it obvious, but he couldn't. Can someone please help?
Teererai Marange
  • 2,044
  • 4
  • 32
  • 50
6
votes
1 answer

Java library to fix incorrectly encoded text using heuristics

I'm dealing with an external web service that is giving me incorrectly encoded (and or corrupted) Strings (UTF-8) that were most likely either ISO LATIN or WINDOWS-1252 but are now UTF-8 (and or a mixture of ISO/WINDOWS/UTF-8). Lovely A hats (Â)…
Adam Gent
  • 47,843
  • 23
  • 153
  • 203
6
votes
1 answer

Algorithm/Heuristic for grouping chat message histories by 'conversation'/implicit sessions from time stamps?

The problem: I have a series of chat messages -- between two users -- with time stamps. I could present, say, an entire day's worth of chat messages at once. During the entire day, however, there were multiple, discrete…
Justin L.
  • 13,510
  • 5
  • 48
  • 83