user1824: Is there any way to use chess engines (by commands or GUI tools) to find the sequence of moves need to transform an initial position(P1) to a target position(P2) while the count of moves is exactly N?
For example, after giving it a FEN as P1 and another FEN as P2, it outputs a list of N legal moves that transforms P1 to P2.
Assume it's possible to do N moves to transform the initial position to target position.

user1887: Yes and No, but be warned, the possible paths to search through grows exponentially as your N increases.
The short answer is NO, unless you find someone who is doing research on chess and is using an engine for the special case like you are describing.
BUT
If someone were to do research on this special case he would setup his experiment probably like this:
First set an engine to calculate at a fixed depth 1 for the current position and make it return all variants it is evaluating. In effect this will return all possible legal moves from the current position.
All you need to do now is write your own breadth-first search algorithm, set to depth N, that can go from one state to another by using the cofigured engine.

1824: <p>Is there any way to use chess engines (by commands or GUI tools) to find the sequence of moves need to transform an initial position(<em>P<sub>1</sub></em>) to a target position(<em>P<sub>2</sub></em>) while the count of moves is exactly <em>N</em>?</p>

<p>For example, after giving it a FEN as <em>P<sub>1</sub></em> and another FEN as <em>P<sub>2</sub></em>, it outputs a list of <em>N</em> legal moves that transforms <em>P<sub>1</sub></em> to <em>P<sub>2</sub></em>.</p>

<p>Assume it's possible to do <em>N</em> moves to transform the initial position to target position.</p>
 1887: <p>Yes and No, but be warned, the possible paths to search through grows exponentially as your N increases.</p>

<p>The short answer is NO, unless you find someone who is doing research on chess and is using an engine for the special case like you are describing.</p>

<p>BUT</p>

<p>If someone were to do research on this special case he would setup his experiment probably like this:</p>

<p>First set an engine to calculate at a fixed depth 1 for the current position and make it return all variants it is evaluating. In effect this will return all possible legal moves from the current position.</p>

<p>All you need to do now is write your own breadth-first search algorithm, set to depth N, that can go from one state to another by using the cofigured engine.</p>
