niklasf / python-chess

A chess library for Python, with move generation and validation, PGN parsing and writing, Polyglot opening book reading, Gaviota tablebase probing, Syzygy tablebase probing, and UCI/XBoard engine communication
https://python-chess.readthedocs.io/en/latest/
GNU General Public License v3.0
2.42k stars 529 forks source link

Tree generation (MinMax, Alpha-Beta, Negascout, etc.) #361

Closed mphuget closed 2 years ago

mphuget commented 5 years ago

Hello python-chess community,

I am wondering why the current version and next one 1.0 do not consider adding move tree generation with classic algorithms: MinMax, Alpha-Beta, etc. as part of the API? Thanks in advance for the answer

mph

Mk-Chan commented 5 years ago

Those algorithms are fairly complicated and very use case specific. Also, it's not effective as a generic API because of overly complex dependencies (evaluation, lazy/eager move generation, pruning, depth control, transposition table and other variations)

I think it would be a good idea to make a simple reference implementation but not as part of a library. (In fact I think I might just do that...)

gbtami commented 5 years ago

A simple UCI engine based on python-chess https://github.com/flok99/feeks

dsblank commented 5 years ago

I've tried to keep this fork of "Artificial Intelligence: a Modern Approach" somewhat up to date for Python3, Jupyter, and related tools: https://github.com/Calysto/aima3 It has many popular search algorithms.

I've used the Monte Carlo Tree Search (mcts.py) in combination with AlphaZero (Deep Learning on two-player games):

https://nbviewer.jupyter.org/github/Calysto/conx-notebooks/blob/master/work-in-progress/AlphaZero.ipynb

If someone uses aima3 for Chess, please let me know.

Mk-Chan commented 5 years ago

I added a repository here: https://github.com/Mk-Chan/python-chess-engine-extensions Let me know what you think. I'll look into making a setup.py and such in the meantime.