Connect Four
Monte Carlo Tree SearchUnlock this to tune and understand how search depth impact the algorithm strength performance.
How it works
The game is the implementation of Connect Four where the opponent is the Monte Carlo Tree Search (MCTS) algorithm or, if selected, the Alpha MCTS. This algorithm is known for its ability to compute in near real time the best next move based on a large optimized computation of options.

The Image shows that the q-values are not exactly the probability of winning, but the expected reward from taking that action. The selected action is the one with the highest q-value.
Algorithm Steps
todo//
- Input: todo//
- Job: todo//
- Output: todo//
todo//
Backend Implementation
The backend running the neural network is decoupled from the website. For each user action, the backend is invoked via an API call to an external endpoint hosted on AWS. The backend is deployed as an AWS Lambda function running a FastAPI application packaged as an ECR container image.

References & Code
The algorithm and training code running inside the AWS Lambda function is available on GitHub: