Original Post
I am trying to extend an iPad based LUA implementation of monte carlo tree search (that I wrote) to play the board game Ramses. http://boardgamegeek.com/boardgame/1529/ramses
I know that my performance bottleneck will be in pathfinding. Looking at the code's (barely acceptable) run time per playout in other (simpler) games I strongly suspect that Ramses will run (unacceptably) slower.
Ramses can be represented as a 38 node directed cyclic graph. Nodes have 2 to 4 incoming edges, and 2 to 4 outgoing edges. It is a 2 player game and each player has 4 pieces. When a piece moves, it must travel exactly N-many spaces (where N varies and is >=1). Its path can not self intersect nor can it cross through a node occupied by another piece.
There are two groups of 9 nodes each which are occupied whenever a single piece is in them. [I believe it is also impossible to cross through either group multiple times in one move. The website containing the rules is down.] You could of course also represent these groups of nodes as a single node each, with variable edges. This would drop the game down to 22 nodes (which is how many the human player sees).
Specifically what I want to optimize is: given the board's current state, the piece to move, and a number N, find all points reachable after exactly N-many non-intersecting edge traversals (subject to the board's unique stipulation, outlined in the paragraph above).
Currently, I am CPU-constrained, not memory-constrained.
Thank you in advance!
I know that my performance bottleneck will be in pathfinding. Looking at the code's (barely acceptable) run time per playout in other (simpler) games I strongly suspect that Ramses will run (unacceptably) slower.
Ramses can be represented as a 38 node directed cyclic graph. Nodes have 2 to 4 incoming edges, and 2 to 4 outgoing edges. It is a 2 player game and each player has 4 pieces. When a piece moves, it must travel exactly N-many spaces (where N varies and is >=1). Its path can not self intersect nor can it cross through a node occupied by another piece.
There are two groups of 9 nodes each which are occupied whenever a single piece is in them. [I believe it is also impossible to cross through either group multiple times in one move. The website containing the rules is down.] You could of course also represent these groups of nodes as a single node each, with variable edges. This would drop the game down to 22 nodes (which is how many the human player sees).
Specifically what I want to optimize is: given the board's current state, the piece to move, and a number N, find all points reachable after exactly N-many non-intersecting edge traversals (subject to the board's unique stipulation, outlined in the paragraph above).
Currently, I am CPU-constrained, not memory-constrained.
Thank you in advance!