2048 search

Discussion of chess software programming and technical issues.

Moderators: hgm, Dann Corbit, Harvey Williamson

MahmoudUthman
Posts: 234
Joined: Sat Jan 17, 2015 11:54 pm

2048 search

Post by MahmoudUthman »

Although not directly related to chess , but I think the techniques are the same .
I'm writing a solver for 2048 : http://gabrielecirulli.github.io/2048/ but I'm stuck on the search part , I think I can use an alpha beta variant with the maximizing side is the side paying the game with available moves set {left,right,up, down} ,and the minimizing side is the computer placing a tile at an empty square, will this work right ?

*a second choice is to generate moves at each depth for the human player with available moves = {left,right,up, down} union {every new tile position possible } , but the problem here is should I use a probability of something like history heuristic and then choosing the most promising path, or should I be pessimistic and choose the safest path and won't the branching factor be huge with no pruning possible?

if placing tiles was truly a random operation shouldn't I get similar results from both the history based and "optimistic" search ? since I won't lose instantly after making a move if I was searching a couple of plies ahead ?

*one more thing If I chose an optimistic search should I partly allow path with dead ends "losing" being possible or should I completely ignore such paths ?
matthewlai
Posts: 793
Joined: Sun Aug 03, 2014 4:48 am
Location: London, UK

Re: 2048 search

Post by matthewlai »

MahmoudUthman wrote:Although not directly related to chess , but I think the techniques are the same .
I'm writing a solver for 2048 : http://gabrielecirulli.github.io/2048/ but I'm stuck on the search part , I think I can use an alpha beta variant with the maximizing side is the side paying the game with available moves set {left,right,up, down} ,and the minimizing side is the computer placing a tile at an empty square, will this work right ?

*a second choice is to generate moves at each depth for the human player with available moves = {left,right,up, down} union {every new tile position possible } , but the problem here is should I use a probability of something like history heuristic and then choosing the most promising path, or should I be pessimistic and choose the safest path and won't the branching factor be huge with no pruning possible?

if placing tiles was truly a random operation shouldn't I get similar results from both the history based and "optimistic" search ? since I won't lose instantly after making a move if I was searching a couple of plies ahead ?

*one more thing If I chose an optimistic search should I partly allow path with dead ends "losing" being possible or should I completely ignore such paths ?
The basic underlying assumption of alpha-beta is that it's a zero-sum game with 2 adversarial players. That's not the case here, so alpha-beta is not the right algorithm for this.

There is also a random element in the game (placing squares).

I'm not sure how I would approach this because even though the branching factor is low, the depth required to get to solution is extremely high.

Solving it using machine learning combined with something like Monte Carlo tree search would be pretty easy... probably.
Disclosure: I work for DeepMind on the AlphaZero project, but everything I say here is personal opinion and does not reflect the views of DeepMind / Alphabet.
User avatar
Ajedrecista
Posts: 1952
Joined: Wed Jul 13, 2011 9:04 pm
Location: Madrid, Spain.

Re: 2048 search.

Post by Ajedrecista »