The SQLite C API has two different functions for binding a text value or a blob value to an INSERT statement, so only the writing application determines what the type of the value is. The function sqlite3_column_type() returns the type of a column's value in the current row; this is...

python,numpy,matrix,heuristics

In the simple example you've given, with for k in xrange(4): the loop body only executes twice (if r==s), or three times (if r!=s) and an initial numpy implementation, below, is slower by a large factor. Numpy is optimized for performing calculations over long vectors and if the vectors are...

algorithm,artificial-intelligence,tic-tac-toe,heuristics

Wikipedia: tic-tac-toe says that there are only 362,880 possible tic-tac-toe games. A brute force approach to proving your algorithm would be to exhaustively search the game tree, having your opponent try each possible move at each turn, and see if your algorithm ever loses (it's guaranteed a win or draw...

performance,artificial-intelligence,a-star,heuristics,memory-efficient

Are you doing this for an assignment or for fun? If it's for fun, then don't use A*, use IDA*. IDA* will be faster and it uses almost no memory. Furthermore, you can use the extra memory to build better heuristics, and get even better performance. (You should find sufficient...

algorithm,puzzle,heuristics,tiling

That's an Exact Cover problem, with a nice structure too, usually, depending on the pieces. I don't know about any heuristic algorithms, but there are several exact options that should work well. As usual with Exact Covers, you can use Dancing Links, a way to implement Algorithm X efficiently. Less...

search,artificial-intelligence,heuristics

Per this paper, Multi-Heuristic A* (Aine et al., 2014), "depression regions" can be defined as: ...regions in the search space where the correlation between the heuristic values and the actual cost of the path to goal is weak The related references are: C. Hernandez and J. A. Baier. Avoiding and...

Conclusion: Heuristic functions that produce negative values are not inadmissible, per se, but have the potential to break the guarantees of A*. Interesting question. Fundamentally, the only requirement for admissibility is that a heuristic never over-estimates the distance to the goal. This is important, because an overestimate in the wrong...

Assuming you are in a grid world where the only allowed movements are N,S,W,E (or adiacent cells in general) yes. The Manhattan distance would be the true cost (and even the best heuristic!) SLD would of course be smaller but also less informative than MHD that represents h*. In case...

As @Vesper said in the comments, A* is the way to go. As for the heuristic... If your robot is restricted to moving left/right and up/down, typically Manhattan (or Taxicab or L1) distance is used as a heuristic function: h(x,y) = |x - x_goal| + |y - y_goal| It should...

java,a-star,heuristics,8-puzzle

You do not have to worry about the situation you are describing in your question. The beginning state is expanded in the first iteration of A*, which leads the algorithm to include that node in the CLOSED list with an associated cost (which is zero, as it is the initial...

c++,algorithm,chess,heuristics,n-queens

Note: This answer assumes you're interested in finding one valid solution. If you need to find all solutions, this won't help you. Artificial Intelligence: A Modern Approach, Second Edition by Russell & Norvig has a table in Chapter 5: Constraint Satisfaction Problems on page 143 comparing various constraint satisfaction problem...

algorithm,heuristics,stochastic

TTBOMK, "stochastic algorithm" is not a standard term. "Randomized algorithm" is, however, and it's probably what is meant here. Randomized: Uses randomness somehow. There are two flavours: Monte Carlo algorithms always finish in bounded time, but don't guarantee an optimal solution, while Las Vegas algorithms aren't necessarily guaranteed to finish...

algorithm,terminology,heuristics

Given a heuristic cost estimation function that obeys certain laws, A* is an algorithm in the strict sense of a method of computation that always gives the right answer to a prespecified set of problems.(*) The fact that it uses a heuristic does not make A* itself a heuristic. (...

search,artificial-intelligence,heuristics

First, we recall that an heuristic function is is said to be admissible if it never overestimates the cost of reaching the goal. What this means? In short it means that, if an heuristic function returns a value h for a state x there are no real solution with a...