I have a function: \begin{equation*} f(a_1,\ldots,a_7,b_1,\ldots,b_4)=-14-7 a_1+30 a_1 a_2-7 a_4-2 a_4 a_5+21 a_6+21 a_7+16 a_1 b_1-24 a_1 a_2 b_1+6 a_4 b_1-6 a_4 a_5 b_1+6 a_1 b_2-6 a_1 a_2 b_2+8 a_4 a_5 b_2-6 a_6 b_3-24 a_7 b_3+8 a_6 b_4-6 a_7 b_4 \end{equation*}
$$\begin{array}{cc} \forall i: 0.0 \le a_i \le 1.0, & \forall j: 0.0 \le b_j \le 1.0 \end{array}$$
Two players are playing a game, where player $A$ is trying to maximize the function by picking $a_i$, and player $B$ is trying to minimize it by picking $b_j$. Player A goes first and picks all $a_i$ variables. Player B goes next, knows what player A picked, and picks all $b_j$ accordingly.
What's player A's best pick? And what's B's corresponding pick? Turns out one of the answers is: $a_1=0, a_2=1, a_4=0, a_5=0, a_6=1, a_7=0; b_1=1, b_2=0, b_3=1, b_4=0$
This way the function evaluates to 1, which is the best player A can ever do.
What's the most efficient way to compute this, especially when you have a lot more variables? Are there shortcuts that you can see or is the only option brute force? May be the optimal solution always has a form with $\forall i: a_i=0.0 \lor a_i=1.0$?