Author: Scott Gasch
Date: 10:27:07 08/10/02
Go up one level in this thread
On August 10, 2002 at 13:14:51, Steffen Basting wrote:
>Hello!
>I've got 2 questions about principal variations:
>1.) How do I receive the principal variation in my alpha-beta algorithm?
> (I read the "tutorial" on Bruce Morelands page but didn't understand it :-)
> Are there more than 1 possibilities to handle that?
There are a couple of ways that I know of. One is the keep track of the PV
explicitly as you search. When you get a move scored between alpha and beta
it's a PV move. It and it's line (the moves after it) are added to the PV at
depth. The "and it's line" part is what confuses people most of the time. The
best way to understand this, IMHO, is to 1. do a model on paper with a simple
A..B tree and then 2. look at gerbil or tscp and see how they keep track of the
PV with code.
Another way is to reconstruct the PV from the hash table at the end of the
search. Search and pay no attention to the PV, then at the end probe the hash
table in the root position... and get the move there. Make it, probe again, and
repeat until you miss the hash.
>2.) Why do programs sometimes show "shorter" principal variations compared to
> depth? For example this output from an analysis with Little Goliath on the
> position Eduard posted:
The only times you should have a shorter PV than depth searched are cases like:
you found a shallow draw, you found a forced mate, you hit the hash etc... In my
program I add a special "move" to the tail of the PV to tell me what happened to
end it. Thats why I get output like this:
16. +0.67 04:16:39.77 3784960672 PV= Rxb2 1. Bxb2 Qxb2 2. Ne2 Qd2 3.
> g5 Rxe3 4. Ra2 Bh2+ [+] 5. Kg2 Rxf3
> 6. Rxd2 Rxf1 7. Kxf1 Ne4 8.
> [TT: Ra2 a4] <+0.00>
or
8. +MATE4 00:00:00.93 197800 PV= Bh2+ 1. Kh1 [1rep] Bg3+ [+] 2. Kg1
> [1rep] Rh1+ [+] 3. Kxh1 [1rep]
> Qh4+ [+] 4. Kg1 [1rep] Qh2+ [+]
> [MATE]
The [TT: ...] and [MATE] are tags for "why did this PV end". The rest of the
[whatevers] are extension tags for "why did we extend here".
Good luck,
Scott
>
>
>2r1r1kb/5p2/p3pQpB/1p1pP3/3p2P1/n1q2B2/2P2PK1/4R2R b - - 0 1
>Analysis by Little Goliath 2000 v3.6:
>
>1...Lxf6 2.exf6 Sxc2 3.Tc1
> -+ (-13.72) Tiefe: 6/10 00:00:07 7kN
>1...Lxf6 2.exf6 Sxc2 3.Tc1
> -+ (-14.03) Tiefe: 7/13 00:00:07 16kN
>1...Lxf6 2.exf6 Sxc2 3.Td1 d3 4.Lg7 a5
> -+ (-14.20) Tiefe: 7/14 00:00:07 24kN
>1...Lxf6 2.exf6 Sxc2 3.Td1 d3 4.Lg7 a5
> -+ (-13.90) Tiefe: 8/16 00:00:08 94kN
>1...Lxf6 2.exf6
> -+ (-13.91) Tiefe: 8/16 00:00:08 96kN
>1...Lxf6 2.exf6 Sxc2 3.Td1 a5 4.Ld2 Da3 5.Tb1
> -+ (-13.62) Tiefe: 9/19 00:00:08 351kN
>1...Lxf6 2.exf6 Sxc2 3.Td1 a5 4.Ld2 Da3 5.Tb1
> -+ (-13.32) Tiefe: 10/23 00:00:10 1307kN
>1...Lxf6 2.exf6 Sxc2 3.Td1 Se3+ 4.fxe3 dxe3 5.Tde1 Dxf6 6.Lxe3 Tc2+ 7.Te2 Txe2+
>8.Lxe2 d4
> -+ (-12.37) Tiefe: 10/25 00:00:11 2844kN
>1...Lxf6 2.exf6 Sxc2 3.Td1 Se3+ 4.fxe3 dxe3 5.Tde1 Dxf6 6.Lxe3 Tc2+ 7.Te2 Txe2+
>8.Lxe2 d4
> -+ (-12.67) Tiefe: 11/28 00:00:13 4397kN
>1...Lxf6 2.exf6 Sxc2 3.Td1 Se3+ 4.fxe3 dxe3 5.Tde1 Dxf6 6.Lxe3 Tc2+ 7.Te2 Txe2+
>8.Lxe2 d4
> -+ (-13.47) Tiefe: 11/28 00:00:13 4443kN
>1...Lxf6
> -+ (-13.47) Tiefe: 11/28 00:00:15 6102kN
>1...Lxf6
> -+ (-13.17) Tiefe: 12/28 00:00:16 8207kN
>1...Lxf6 2.exf6
> -+ (-13.19) Tiefe: 12/28 00:00:17 8464kN
>1...Lxf6 2.exf6
> -+ (-12.89) Tiefe: 13/28 00:00:22 14553kN
>1...Lxf6 2.exf6 Dxe1 3.Txe1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1...Lxf6 2.exf6
> -+ (-1.64) Tiefe: 17/47 00:22:11 1845920kN
>
>What I mean is: Why doesn't the principal variation have a length of 16 plies at
>depth 16 although the search for this depth is finished while it has got a
>length of 7 plies at Depth 7 (for example)?
>
>Thanks for your responses, Steffen
This page took 0 seconds to execute
Last modified: Thu, 15 Apr 21 08:11:13 -0700
Current Computer Chess Club Forums at Talkchess. This site by Sean Mintz.