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
5
votes
2 answers

What is wrong with my A* search for 8-Puzzle?

I am trying to use A* search with these heuristics to solve 8-Puzzle: - h1: number of misplaced tiles - h2: total manhattan distance - h3: sum of the above The moving tile is known as 0. My goal is to solve these sets: 4 1 2 5 8 3 7 0 6 and 8 6 7 2…
Alx
  • 651
  • 1
  • 9
  • 26
5
votes
2 answers

Why isn't my heuristic for the A* algorithm admissible?

I am going through the CS 188 availible to the public at edx.org. Right now I have to develop a heuristic for an A* search to eat all the pellets as shown here: My heuristic that I was sure would work, (as both admissible and consistent) went like…
Zach
  • 1,311
  • 3
  • 16
  • 36
5
votes
1 answer

heuristic (fuzzy) date extraction from the string?

I have a problem to heuristically parse a string of text which contains a date but in a rather arbitrary (unknown) format. function parseDateStr($text) { $cleanText = filter($text); # ... $day = findDay($cleanText); $month =…
Yauhen Yakimovich
  • 13,635
  • 8
  • 60
  • 67
5
votes
3 answers

How to use two different iterators on a Linked List in Java?

I would like to use a linked list in order to perform extractions and insertions of elements, trying out all combinations for a heuristic. Linked lists are more efficient for this type of operations. Since I would want to try all possible pairs of…
5
votes
1 answer

Eight Queens Heuristic

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…
kzidane
  • 753
  • 3
  • 11
  • 29
4
votes
1 answer

Detect if email is essentially text

I'm writing an Outlook Add-in that saves emails for historical purposes. Outlook's MSG format is unfortunately overly-verbose, even when compressed. This causes saved MSG files to be many times the size of their text equivalent. However, saving all…
Kaganar
  • 6,540
  • 2
  • 26
  • 59
4
votes
1 answer

Heuristic path algorithm (Pohl) completeness

This is a homework question, exactly as follows: The heuristic path algorithm (Pohl, 1977) is a best-first search in which the evaluation function is f(n) = (2-w)g(n) + wh(n). For what values of w is this complete? Here's what I know: w = 0:…
jb.
  • 9,921
  • 12
  • 54
  • 90
4
votes
2 answers

Heuristic to choose five column arrays that maximise the dot product

I have a sparse 60000x10000 matrix M where each element is either a 1 or 0. Each column in the matrix is a different combination of signals (ie. 1s and 0s). I want to choose five column vectors from M and take the Hadamard (ie. element-wise) product…
Alex Pharaon
  • 121
  • 1
  • 7
4
votes
1 answer

Poor performance on the nqueens min-conflic search

I am implementing the nqueens min-conflict search as mentioned by Norvig, S., & Peter, J. R. and. (2014). Artificial Intelligence A Modern Approach. In Pearson (Vol. 58, Issue 12). The authors mention this heuristic alone is super efficient: Yet…
Just_Alex
  • 518
  • 1
  • 4
  • 16
4
votes
4 answers

Approximation-tolerant map

I'm working with arrays of integer, all of the same size l. I have a static set of them and I need to build a function to efficiently look them up. The tricky part is that the elements in the array I need to search might be off by 1. Given the…
peoro
  • 25,562
  • 20
  • 98
  • 150
4
votes
2 answers

Representation and heuristic of Connect6 game in Prolog

I want to represent game connect6 wiki (maybe predicate stone(P, X, Y), where P is player, X,Y are coords would by good). Also I want to use any good heuristic to solve the problem (to make opponent). Can you give me a hint to any article about game…
Martin Pilch
  • 3,245
  • 3
  • 38
  • 61
4
votes
1 answer

Is there a more efficient algorithm to calculate the Manhattan distance of a 8-puzzle game?

I'm currently writing an algorithm that solves the 8-puzzle game through an A* search algorithm with Python. However, when I time my code, I find that get_manhattan_distance takes a really long amount of time. I ran my code with cProfile for Python,…
4
votes
0 answers

What is the difference between greedy and best-first search algorithms?

Best-first search - a search that has an evaluation function f(n) that determines the cost of expanding node n and chooses the lowest cost available node Uninformed search - has no knowledge of h(n) Informed search - has knowledge of h(n) Greedy…
user10939349
  • 41
  • 1
  • 3
4
votes
5 answers

Algorithm to decide if digital audio data is clipping?

Is there an algorithm or some heuristic to decide whether digital audio data is clipping?
Benedikt Waldvogel
  • 12,406
  • 8
  • 49
  • 61
4
votes
3 answers

Best heuristic for malloc

Consider using malloc() to allocate x bytes of memory in a fragmented heap. Assume the heap has multiple contiguous locations of size greater than x bytes. Which is the best (that leads to least heap wastage) heuristic to choose a location among…
Anil Katti
  • 1,313
  • 1
  • 14
  • 26