There is a certain game. It is necessary to quickly find the shortest sequence of moves to achieve the transition from one game state to another. (or all sorts of sequences of a certain length). What will need the function of the possibility of limiting possible moves. For example, if there are 4 possible moves (left, right, up, down), then we could request a path that, for example, does not use moves to the left and down. How is this business better kept and what algorithms to use for searching?
[Reflections] I imagine the principle as follows ... Each time a graph is built, where the edge is a move, and the node is a state of the game after a given move (i.e., it will be possible to both analyze the existing game and generate various "virtual" combinations for searching them). The direction of the course is weight, apparently. But I don’t remember a single standard algorithm that would exclude certain weights from the search ... Ie do you need to go over the graph and put down indecently high weight for eliminated moves? (which also does not exclude its participation by 100%) Or is it better to correct the algorithm so that it ignores certain weights on the list, and the graph itself perceived as unweighted?
At the input of the algorithm, there are certain states of the game, i.e. for each node, you need to store some hash (because storing all the states is quite expensive), so that the input data can be immediately associated with the necessary nodes of the graph. And then the search for the shortest path (A * probably will be optimal in this case?) It will be possible to find the shortest path, and search depth (?) With a depth limit for a certain length.
При каждом ходе строится граф, где ребро это ход, а узел это состояние игры после данного хода. And then the scales are not needed, the graph will not be weighted - tym32167ну и искать момент, I’m lookingну и искать моментto search for this moment to eat the whole idea ofпреждевременной оптимизации) - Isaev