cilk pousse james process cs534. overview introduction to pousse searching evaluation function move...
TRANSCRIPT
![Page 1: Cilk Pousse James Process CS534. Overview Introduction to Pousse Searching Evaluation Function Move Ordering Conclusion](https://reader036.vdocuments.us/reader036/viewer/2022082711/56649f1f5503460f94c37d57/html5/thumbnails/1.jpg)
Cilk Pousse
James Process CS534
![Page 2: Cilk Pousse James Process CS534. Overview Introduction to Pousse Searching Evaluation Function Move Ordering Conclusion](https://reader036.vdocuments.us/reader036/viewer/2022082711/56649f1f5503460f94c37d57/html5/thumbnails/2.jpg)
Overview
• Introduction to Pousse
• Searching
• Evaluation Function
• Move Ordering
• Conclusion
![Page 3: Cilk Pousse James Process CS534. Overview Introduction to Pousse Searching Evaluation Function Move Ordering Conclusion](https://reader036.vdocuments.us/reader036/viewer/2022082711/56649f1f5503460f94c37d57/html5/thumbnails/3.jpg)
Introduction
1998 ICFP Functional Programming Contest
• Write and AI system to play "Pousse"
• May be written in any language
• Teams had 72 hours to complete the programming
• Almost 50 programs were entered into the content
• Cilk Pousse written by Supercomputing Technologies Research Group of the MIT LCS won first place
![Page 4: Cilk Pousse James Process CS534. Overview Introduction to Pousse Searching Evaluation Function Move Ordering Conclusion](https://reader036.vdocuments.us/reader036/viewer/2022082711/56649f1f5503460f94c37d57/html5/thumbnails/4.jpg)
Introduction - Pousse
What is Pousse?• 2 player game
• tic-tac-toe variant played on n-by-n board, typically 4-by-4
• players place either X or O, X places first
• A marker is placed on the board by sliding it in from the side(left, right, top, or bottom)o Results in 4*n possible moves on a given turn
• If a marker is inserted where a maker is already placed, all markers on that row/column are pushed down one space. If the row/column is full, the last marker is pushed off the game board and removed
![Page 5: Cilk Pousse James Process CS534. Overview Introduction to Pousse Searching Evaluation Function Move Ordering Conclusion](https://reader036.vdocuments.us/reader036/viewer/2022082711/56649f1f5503460f94c37d57/html5/thumbnails/5.jpg)
Introduction - Winning
• Similar to tic-tac-toe you are trying to create "straights" to wino A "straight" is a full row or column of your
markero Making a move that causes the configuration
to contain more straights of your type than your opponents results in a win
• If you make a move that creates a configuration that is a repeat of a previous configuration you loseo No looping
• There are no ties/draws
![Page 6: Cilk Pousse James Process CS534. Overview Introduction to Pousse Searching Evaluation Function Move Ordering Conclusion](https://reader036.vdocuments.us/reader036/viewer/2022082711/56649f1f5503460f94c37d57/html5/thumbnails/6.jpg)
![Page 7: Cilk Pousse James Process CS534. Overview Introduction to Pousse Searching Evaluation Function Move Ordering Conclusion](https://reader036.vdocuments.us/reader036/viewer/2022082711/56649f1f5503460f94c37d57/html5/thumbnails/7.jpg)
Searching
• Alpha-Beta minimax Searchingo We can prune of parts of the tree and save
search time if we know there is already a better move
• Iterative deepeningo For each iteration we start from the best
possible move of the previous iteration. i.e. the depth-9 search places the best move into a hash table which provides a starting point for the depth-10 search
![Page 8: Cilk Pousse James Process CS534. Overview Introduction to Pousse Searching Evaluation Function Move Ordering Conclusion](https://reader036.vdocuments.us/reader036/viewer/2022082711/56649f1f5503460f94c37d57/html5/thumbnails/8.jpg)
Cilk and Parallel Searching
• Cilk is a C-based language for multithreaded programming, did a lot of the work of multithreading/scheduling
• Took the approach that either a single child would be searched or all children would be (optimal game tree)
• Search first childo Either return, or spawn off all other children to
be searched in parallel
![Page 9: Cilk Pousse James Process CS534. Overview Introduction to Pousse Searching Evaluation Function Move Ordering Conclusion](https://reader036.vdocuments.us/reader036/viewer/2022082711/56649f1f5503460f94c37d57/html5/thumbnails/9.jpg)
Evaluation Function
• Piece counto Each piece is valued at 4
• Centralityo - Each piece gets a bonus equal to the Manhattan
distance from the piece to the nearest corner
• Frank-squaredo Derived from file/ranko Valued at k^2 for each frank having k of your pieces
• Connectivityo Originally was defined as 2 points per piece for
adjacency and 1 point for each diagonalo Was not used in final version
![Page 10: Cilk Pousse James Process CS534. Overview Introduction to Pousse Searching Evaluation Function Move Ordering Conclusion](https://reader036.vdocuments.us/reader036/viewer/2022082711/56649f1f5503460f94c37d57/html5/thumbnails/10.jpg)
Evaluation Function Cont.
• Sum this for our pieces and subtract opponents sum at each state
• Optimized by incrementally updating score for each position rather than computing from scratch
![Page 11: Cilk Pousse James Process CS534. Overview Introduction to Pousse Searching Evaluation Function Move Ordering Conclusion](https://reader036.vdocuments.us/reader036/viewer/2022082711/56649f1f5503460f94c37d57/html5/thumbnails/11.jpg)
Move Ordering
Two heuristics used to improve move ordering
• First keep a hash table with the best move information from the previous search
• Second keep a table of countermoves. o previously when the opponent made move x,
we decided move y was a good choiceo In the case of Cilk Pousse they saved the last
2 good countermoves for each move
• If the best move hash table has a move start there, else go to the countermoves table
![Page 12: Cilk Pousse James Process CS534. Overview Introduction to Pousse Searching Evaluation Function Move Ordering Conclusion](https://reader036.vdocuments.us/reader036/viewer/2022082711/56649f1f5503460f94c37d57/html5/thumbnails/12.jpg)
Conclusion
Even relatively simple problems require a large amount of thought and optimization to solve. All of the following were considered
o Effective search algorithmo Good use of pruningo Iterative Deptho Keeping track of best stateso Tweaking evaluation functiono Parallelismo …
• No single piece is the key to a perfect Agent
![Page 13: Cilk Pousse James Process CS534. Overview Introduction to Pousse Searching Evaluation Function Move Ordering Conclusion](https://reader036.vdocuments.us/reader036/viewer/2022082711/56649f1f5503460f94c37d57/html5/thumbnails/13.jpg)
References
Definition of the game Poussehttp://docs.racket-lang.org/games/pousse.html
MIT Cilk Poussehttp://people.csail.mit.edu/pousse/