If we use the most basic approach to a chess engine (for example, for
a codegolf): minimax to a fixed depth with the material count as
static evaluation, then how strong is this algorithm?
Not very strong.
Even though the material value is a significant factor in evaluation. There are many more factors that you need to consider to build a strong evaluation function.
- Center Control
- Pawn structure
- King Safety
- Blocked pieces
These are just the key points, there are in-fact many more factors you can add.
Now, coming back to the question which is the relation of depth to the strength of the engine
The greater the depth, the stronger the chess engine is. With experience, I can say that the engine you described in your question would be quite weak, and could be defeated by any amateur chess player.
I would say that it has a significant impact.
The problem is that depth doesn't necessarily denote the number of moves you have searched. This is because modern chess engines apply something called pruning which is reducing the number of moves it evaluates. It cuts down on a huge number of moves that seem bad during the beginning of the search, which can cut down a huge branch of moves. Due to this engines like Stockfish can reach depths of more than 15!
If you use a basic algorithm like minimax that applies no pruning, depth 6 with a reasonably fast generator function will already be slow. Anything after depth 7 would just take forever.
If there are an average of 20 moves in a position, this is how many moves you would be evaluating approximately when the depth increase
depth 1 = 20
depth 2 = 400
depth 3 = 8,000
depth 4 = 160,000
depth 5 = 3,200,000
depth 6 = 64,000,000
depth 7 = 1,280,000,000
1.2 trillion moves. That is a LOT of moves. And chess engines today search moves NOWHERE NEAR that number.
I gave ethereal about 7 seconds to search for moves in this position for black
Using arena I could see the details of this search, and to my surprise, it had gone to a depth of 22! Does this mean it evaluated
No, it evaluated only
9,799,1101 positions. Again, because of pruning.
It did go to a depth of 22 but it did not evaluate all the variations.
Using a simpler search algorithm like minimax which applies no pruning, you will be seeing the same number of moves at depth 4-6 but those moves have very little meaning. Because a huge part of them could start with you hanging one of your pieces.
So your evaluation function is weak as it only considers material balance, and your search algorithm isn't great either, you can understand why this engine will be weak.
EDIT: As I said earlier the greater the depth of the search, the stronger the move it picks.
At greater depths, the difference will only become greater because a single increment in the depth could result in searching millions of more nodes. There is no simple relation between the elo and the depth of an engine because as I also mentioned earlier depth is one factor amongst a hundred others.
If you see the top engines today, all of them search to a similar depth, but some are very clearly stronger than the other. Which just proves my point.