heuristics

What are some good methods to finding a heuristic for the A* algorithm?

好久不见. 提交于 2019-12-30 06:49:16
问题 You have a map of square tiles where you can move in any of the 8 directions. Given that you have function called cost(tile1, tile2) which tells you the cost of moving from one adjacent tile to another, how do you find a heuristic function h(y, goal) that is both admissible and consistent? Can a method for finding the heuristic be generalized given this setting, or would it be vary differently depending on the cost function? 回答1: Amit's tutorial is one of the best I've seen on A* (Amit's page

X-Y heuristic function for solving N-puzzle

对着背影说爱祢 提交于 2019-12-24 10:40:30
问题 Can somebody please explain this heuristic function, for example for the following arrangement of 4x4 puzzle, whats the X-Y heuristic cost? 1 2 3 4 5 6 7 8 9 10 11 12 0 13 14 15 (0 indicates blank space) 回答1: As from here and here the X-Y heuristic is computed by the sum of the minimum number of column-adjacent blank swaps to get all tiles in their destination column and the minimum number of row adjacent blank swaps to get all tiles in their destination row . So in this situation: 1 2 3 4 5

What does crossover index of 0.25 means in Genetic algorithm for real encoding?

爷,独闯天下 提交于 2019-12-24 01:44:27
问题 I am familiar with crossover and mutation indexes in binary representation but in real encoding, I came across with several articles in which crossover index and mutation index are used as parameter values. For example, we have population size of 300 and 30 decision variables then what does crossover index = 0.25 means? Also confused about the mutation index of 100+current generation number . 回答1: Crossover index A number of real-coded crossover operators have been developed that create two

How to mix genetic algorithm with some heuristic

試著忘記壹切 提交于 2019-12-23 12:20:07
问题 I'm working on university scheduling problem and using simple genetic algorithm for this. Actually it works great and optimizes the objective function value for 1 hour from 0% to 90% (approx). But then the process getting slow down drammatically and it takes days to get the best solution. I saw a lot of papers that it is reasonable to mix other algos with genetiс one. Could you, please, give me some piece of advise of what algorithm can be mixed with genetic one and of how this algorithm can

Pretty good heuristic evaluation rules for big TicTacToe 5x5 board

懵懂的女人 提交于 2019-12-22 17:05:33
问题 I have created TicTacToe game. I use minmax algorithm. When the board is 3x3 I just calculate every possible move for a game till the end and -1 for loss, 0 for tie, 1 for win. When it comes to 5x5 it can't be done(to many options(like 24^24) so I have created evaluation method which gives: 10^0 for one CIRCLE inline, 10^1 for 2 CIRCLE inline, ..., 10^4 for 5 CIRCLES inline, but it is useless. Does anybody have better idea for assesment? Example: O|X|X| | | ---------- |O| | | | ---------- X|O

Can somebody explain in Manhattan dstance for the 8 puzzle in java for me?

随声附和 提交于 2019-12-22 01:32:04
问题 i am writing an A* algorithm which can solve the 8-puzzle in Java, so far i have implemented DFS, BFS, A* using the number of tiles out of place and i just need to implement it using the heuristic for the Manhattan distance. As you are probably aware the Manhattan distance is the sum of each tiles displacement in relation to its current position and its index in the goal state. I have googled around and found these stack over flow topics: Calculating Manhattan Distance Manhattan distance in A

15 Puzzle Heuristic

北慕城南 提交于 2019-12-21 02:54:10
问题 The 15 Puzzle is a classical problem for modelling algorithms involving heuristics. Commonly used heuristics for this problem include counting the number of misplaced tiles and finding the sum of the Manhattan distances between each block and its position in the goal configuration. Note that both are admissible, i.e., they never overestimate the number of moves left, which ensures optimality for certain search algorithms such as A*. What Heuristic do you think is proper, A* seems to work nice

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

你说的曾经没有我的故事 提交于 2019-12-21 01:06:43
问题 I am not expecting a definite yes or no. Any knowledge you might have I will consider as an answer. private String CalculateCharge(Nullable<Decimal> bill, Nullable<Decimal> rate) { return ((bill ?? 0.0m) * (rate ?? 0.0m)).ToString("C"); } 回答1: Inlining is an implementation detail of the JIT, not of the C# compiler. From Eric Gunnerson's blog: The JIT uses a number of heuristics to decide whether a method should be in-lined. The following is a list of the more significant of those (note that

Split speech audio file on words in python

て烟熏妆下的殇ゞ 提交于 2019-12-18 10:42:36
问题 I feel like this is a fairly common problem but I haven't yet found a suitable answer. I have many audio files of human speech that I would like to break on words, which can be done heuristically by looking at pauses in the waveform, but can anyone point me to a function/library in python that does this automatically? 回答1: An easier way to do this is using pydub module. recent addition of silent utilities does all the heavy lifting such as setting up silence threahold , setting up silence

Travelling Salesman with multiple salesmen?

扶醉桌前 提交于 2019-12-17 10:44:39
问题 I have a problem that has been effectively reduced to a Travelling Salesman Problem with multiple salesmen. I have a list of cities to visit from an initial location, and have to visit all cities with a limited number of salesmen. I am trying to come up with a heuristic and was wondering if anyone could give a hand. For example, if I have 20 cities with 2 salesmen, the approach that I thought of taking is a 2 step approach. First, divide the 20 cities up randomly into 10 cities for 2 salesman