<p>I need to write a minimax algorithm with alpha-beta pruning in limited time for the <a href="https://en.wikipedia.org/wiki/2048_(video_game)" rel="nofollow noreferrer">2048 game</a>. I know expectimax is better for this work. </p>

<p>Assume I wrote different heuristic functions. If I want to write an evaluation function as a linear combination of these heuristic functions, do I have to give random weights, or can I calculate the optimal weights with some optimization algorithm? </p>

CC BY-SA 4.0
2019-10-17T14:15:55.877Z
What do you mean by "for good enough" in "can I calculate these weights for enough good with some algorithm?"?
nbro
CC BY-SA 4.0
2019-10-17T15:34:41.207Z
I meant for a linear combination like evaluation(s) = x1.f1(s) + x2.f2(s). Assume I choose x1 and x2 as 1 and 5. And with this weights my algorithm's succes chance is %50 and if I increase value of x1 algorithm's chance will increase. What if I have 20 weight? Is there a algorithm gonna find approximate weight? I heard a algorithm called CMA-ES. I'll look at it.
Mustafa Tufan
CC BY-SA 4.0
2019-10-17T20:08:18.430Z
Well, take a look at this duuh.
M. Çağlar TUFAN
<search><minimax><heuristics><alpha-beta-pruning><expectiminimax>
How to choose the weights for a linear combination of heuristic functions?
Mustafa Tufan
# How to choose the weights for a linear combination of heuristic functions?

(Asked by: username_0 on 2019-10-17)

I need to write a minimax algorithm with alpha-beta pruning in limited time for the [2048 game](https://en.wikipedia.org/wiki/2048_(video_game)). I know expectimax is better for this work.

Assume I wrote different heuristic functions. If I want to write an evaluation function as a linear combination of these heuristic functions, do I have to give random weights, or can I calculate the optimal weights with some optimization algorithm?

**Tags:** search, minimax, heuristics, alpha-beta-pruning, expectiminimax

> **Comments:**
> **username_1**: What do you mean by "for good enough" in "can I calculate these weights for enough good with some algorithm?"?  
> **username_0**: I meant for a linear combination like evaluation(s) = x1.f1(s) + x2.f2(s). Assume I choose x1 and x2 as 1 and 5. And with this weights my algorithm's succes chance is %50 and if I increase value of x1 algorithm's chance will increase. What if I have 20 weight? Is there a algorithm gonna find approximate weight? I heard a algorithm called CMA-ES. I'll look at it.  
> **username_2**: Well, take a look at this duuh.  

---

## 0 answers

