Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Generating next possible states is doing to much work #2

Closed
ericvrp opened this issue Mar 24, 2016 · 2 comments
Closed

Generating next possible states is doing to much work #2

ericvrp opened this issue Mar 24, 2016 · 2 comments

Comments

@ericvrp
Copy link

ericvrp commented Mar 24, 2016

As a rule of thumb alphabeta roughly has a branching factor of the sqrt(number of possible moves). So because this implementation generates all possible states it does a lot of unneccessary work. It would be better to generate moves and then when needed perform/play the move and generate the new state.

It can them be decided if undoing/takingback the move on a single state is faster/slower then generating new states.

Introducing moves has the other great advantage that it is easier to sort them in an order that speeds of the alphabeta algorithm. Keeping a best move per depth (killer move heuristic) and trying that move first for instance can greatly reduce the searchtime.

@panchishin
Copy link
Owner

If you have a pull request I'd review the code for sure!

@panchishin
Copy link
Owner

closing this enhancement.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants