I have been working on a problem to which I've applied alpha-beta pruning. While I got most of the answers right, there is one part I'm not quite getting:
Note that I've only provided a part of the tree I'm working on. Node $B$ starts with the following values:
$B$
- $v = \infty$
- $\alpha = - \infty$
- $\beta = \infty$
Now, we push the alpha and beta values down to node $D$ from parent node $B$, and calculate its value:
$D$
- $v = -\infty$
- $\alpha = -\infty$
- $\beta = \infty$
As leaf node $J$ has a value of $-7$, we push that back up to parent node $D$, changing node $D$'s value to $-7$ (as it is better than the old value of $-\infty$), and we also change the $\alpha$ value of node $D$ (as it is also better than the old value of $-\infty$).
New $D$
- $v = -7$
- $\alpha = -7$
- $\beta = \infty$
We now push the value of $-7$ back up to parent node $B$, changing node $B$'s value to $-7$ (as it is better than the old value of $\infty$), and we also change the $\beta$ value of node $B$ (as it is also better than the old value of $\infty$).
New $B$
- $v = -7$
- $\alpha = -\infty$
- $\beta = -7$
We now traverse down to node $E$ (and we don't prune it because node $B$'s value is NOT <= its $\alpha$ value), and we push the alpha and beta values down from node $B$, and calculate its value:
$E$
- $v = -\infty$
- $\alpha = -\infty$
- $\beta = -7$
As leaf node $K$ has a value of $0$, we push that back up to parent node $E$, changing node $E$'s value to $0$ (as it is better than the old value of $-\infty$). Now, this is the point where my confusion lies. According to my understanding, at this point we would also set the $\alpha$ value of node $E$ to $0$ (as it is better than the old value of $-\infty$). However, the answer I received to this question specifies that we do NOT change the $\alpha$ value of node $E$, and rather leave it as $-\infty$.
Can someone please explain to me why this is the case?
UPDATE
I did not originally include the full subtree - this is it:
In this instance, only node M should be pruned. However, my question still stands as to why the answer did not update the alpha value of node E, as no pruning happened in that part of the tree.