--- Arbor ---
An implementation of Monte Carlo Tree Search
Preston Langford June 17, 2022
This crate provides a generic interface to the Monte Carlo Tree Search algorithm. It allows a developer to implement an AI agent for a two player game without the need to describe heuristics or strategies specific to the game. Examples using Arbor are provided below including: Reversi, Connect 4, Mancala, and Tic-Tac-Toe. In this demonstration, the AI agent is compiled to WASM and it runs in your browser. The UI for this website was developed with Yew. Source code can be found on GitHub
Description of controls and indications:
- Playing Area: Click any legal space to advance the game state. For Reversi, click any space if you need to pass. The user always plays first followed by the AI agent.
- Red/green: Space highlighting provides a realtime estimate of the playing strength of each action in the first ply. Green means the action is likely to be chosen by the AI agent and red means the opposite.
- Reset: Start a new game.
- AI Time (seconds): Adjust the amount of time the AI agent is allowed to think. The strength of the agent will improve with more time, but also the amount of memory used.
- Exploration: Adjust the balance between exploration and exploitation. See Wikipedia for more explanation.
- AI Advantage: The AI agent's own estimate of the playing strength of it's position or how probable it thinks it is to win the match.
- Memory: The amount of RAM used to store the search tree. Each element in the tree is stored contiguously in a vector using the "enum Node<P: Player, A: Action>" generic type. Developers should minimize the size of their implementation of Player and Action to reduce memory consumption.
- Iterations: The number of complete steps of the MCTS algorithm.
- Branch/Leaf Nodes: Provides an idea of the shape of search tree graph. Branch nodes are interior and leaf nodes are exterior parts of the graph.
Tic-Tac-Toe
X's turn
reset
AI time (seconds)
1
Exploration
1.40
Mancala
Right side's turn
reset
AI time (seconds)
1
Exploration
1.40
Reversi
White's turn
reset
AI time (seconds)
1
Exploration
1.40
Connect 4
White's turn
reset
AI time (seconds)
1
Exploration
1.40