Artificial Intelligence

USC school project

Python

Contribution: Sole developer

 

Description: Design an agent that plays mini-GO (5x5 board) against other automated agents.

Method: I used the minimax algorithm which looks ahead to pick the optimal move.

Using pruning and an evaluation function, I was able to look 5 moves ahead and simulate between 5 and 20 choices at every move.

My evaluation function focused on these factors:

  • in the early game, favor placing stones in the center

  • additionally, connections are counted to increase security

  • award points for two-eyes which prevent capture

  • subtract the opponent’s score for the same factors in case there is no choice left that favors my structure

  • in the late game, bias towards capturing the opponent’s stones


Results

>= 90% win rate against a random agent (picks anywhere on the board without any patterns)

>= 90% win rate against a greedy agent (picks the move that captures the most stones)

>= 80% win rate against an aggressive agent (looks two moves ahead to capture the most stones)