I’m working on developing an AI system for Quoridor as part of my coursework. My approach involves modeling the game board as an undirected graph structure to make pathfinding calculations more efficient.
My current challenge
I want to convert the 9x9 Quoridor board into a graph where each square becomes a node connected to its neighbors. This would help me calculate the shortest routes for players to reach their goals. However, I’m struggling with implementing such a large graph structure in Prolog.
What I’ve tried
I know how to create basic graphs with a few connections like this:
connection(a,b).
connection(b,a).
connection(a,d).
connection(d,a).
connection(b,c).
connection(c,b).
connection(c,e).
connection(e,c).
connection(e,f).
connection(f,e).
But defining all 81 squares and their relationships manually seems overwhelming. I’m looking for a more elegant way to represent this board structure in Prolog so I can later implement a MiniMax algorithm for the AI decision making.
Any suggestions on how to handle such a complex graph representation efficiently?