A Fast Thinking Connect Four Machine! 6.846 Final Project Presented by Tina Wen.

Slides:



Advertisements
Similar presentations
Multiple Processor Systems
Advertisements

Christian Lauterbach COMP 770, 2/16/2009. Overview  Acceleration structures  Spatial hierarchies  Object hierarchies  Interactive Ray Tracing techniques.
Greedy best-first search Use the heuristic function to rank the nodes Search strategy –Expand node with lowest h-value Greedily trying to find the least-cost.
Adversarial Search We have experience in search where we assume that we are the only intelligent being and we have explicit control over the “world”. Lets.
Counting the bits Analysis of Algorithms Will it run on a larger problem? When will it fail?
CS 484. Discrete Optimization Problems A discrete optimization problem can be expressed as (S, f) S is the set of all feasible solutions f is the cost.
Chess Problem Solver Solves a given chess position for checkmate Problem input in text format.
Slide 1 Search: Advanced Topics Jim Little UBC CS 322 – Search 5 September 22, 2014 Textbook § 3.6.
Presented by: Yash Gurung, ICFAI UNIVERSITY.Sikkim BUILDING of 3 R'sCLUSTER PARALLEL COMPUTER.
1 Distributed Computing Algorithms CSCI Distributed Computing: everything not centralized many processors.
1 Using Search in Problem Solving Part II. 2 Basic Concepts Basic concepts: Initial state Goal/Target state Intermediate states Path from the initial.
Using Search in Problem Solving
Yuan CMSC 838 Presentation Parallelisation of IBD computation for determining genetic disease map.
This material in not in your text (except as exercises) Sequence Comparisons –Problems in molecular biology involve finding the minimum number of edit.
Online Chess Project 3 Due date: April 17 th. Introduction Third in series of three projects This project focuses on adding online support –2 players.
Using Search in Problem Solving
Copyright © 2009 Pearson Education, Inc. Publishing as Pearson Addison-Wesley Principles of Parallel Programming First Edition by Calvin Lin Lawrence Snyder.
Backtracking.
Game Playing: Adversarial Search Chapter 6. Why study games Fun Clear criteria for success Interesting, hard problems which require minimal “initial structure”
Team Othello Joseph Pecoraro Adam Friedlander Nicholas Ver Hoeve.
Game Trees: MiniMax strategy, Tree Evaluation, Pruning, Utility evaluation Adapted from slides of Yoonsuck Choe.
Minimax Trees: Utility Evaluation, Tree Evaluation, Pruning CPSC 315 – Programming Studio Spring 2008 Project 2, Lecture 2 Adapted from slides of Yoonsuck.
Dynamic Load Balancing Tree and Structured Computations CS433 Laxmikant Kale Spring 2001.
Heterogeneous Parallelization for RNA Structure Comparison Eric Snow, Eric Aubanel, and Patricia Evans University of New Brunswick Faculty of Computer.
STRATEGIC NAMING: MULTI-THREADED ALGORITHM (Ch 27, Cormen et al.) Parallelization Four types of computing: –Instruction (single, multiple) per clock cycle.
Chapter 3 Parallel Algorithm Design. Outline Task/channel model Task/channel model Algorithm design methodology Algorithm design methodology Case studies.
Complexity of algorithms Algorithms can be classified by the amount of time they need to complete compared to their input size. There is a wide variety:
GU Junli SUN Yihe 1.  Introduction & Related work  Parallel encoder implementation  Test results and Analysis  Conclusions 2.
Introduction to search Chapter 3. Why study search? §Search is a basis for all AI l search proposed as the basis of intelligence l inference l all learning.
CS 484 – Artificial Intelligence1 Announcements Homework 2 due today Lab 1 due Thursday, 9/20 Homework 3 has been posted Autumn – Current Event Tuesday.
Introduction to search Chapter 3. Why study search? §Search is a basis for all AI l search proposed as the basis of intelligence l all learning algorithms,
Connect Four AI Robert Burns and Brett Crawford. Connect Four  A board with at least six rows and seven columns  Two players: one with red discs and.
A Study of Balanced Search Trees: Brainstorming a New Balanced Search Tree Anthony Kim, 2005 Computer Systems Research.
Cilk Pousse James Process CS534. Overview Introduction to Pousse Searching Evaluation Function Move Ordering Conclusion.
Supporting Systolic and Memory Communication in iWarp CS258 Paper Summary Computer Science Jaein Jeong.
Lecture 3: Uninformed Search
Particle Swarm Optimization † Spencer Vogel † This presentation contains cheesy graphics and animations and they will be awesome.
Internet-Based TSP Computation with Javelin++ Michael Neary & Peter Cappello Computer Science, UCSB.
Final Version Olex Ponomarenko. Goals for the Project Create a fairly abstract map path-finding program Add more complex heuristics to account for things.
Game-playing AIs Part 2 CIS 391 Fall CSE Intro to AI 2 Games: Outline of Unit Part II  The Minimax Rule  Alpha-Beta Pruning  Game-playing.
Mixing Complementary Colors to create neutrals. Complementary colors are directly across from one another on the color wheel. When mixed they get various.
Adversarial Search 2 (Game Playing)
Optimization Problems The previous examples simply find a single solution What if we have a cost associated with each solution and we want to find the.
An AI Game Project. Background Fivel is a unique hybrid of a NxM game and a sliding puzzle. The goals in making this project were: Create an original.
Adversarial Search In this lecture, we introduce a new search scenario: game playing 1.two players, 2.zero-sum game, (win-lose, lose-win, draw) 3.perfect.
Understanding AI of 2 Player Games. Motivation Not much experience in AI (first AI project) and no specific interests/passion that I wanted to explore.
Announcements Homework 1 Full assignment posted..
BackTracking CS255.
State Space 4 Chapter 4 Adversarial Games.
Introduction to Artificial Intelligence
Here is a puzzle I found on a t-shirt
Wednesday, April 18, 2018 Announcements… For Today…
Like.
Multiple Processor Systems
Course Outline Introduction in algorithms and applications
Introduction to Multiprocessors
Kevin Mason Michael Suggs
Directions: Color your name with any tiles you want.
Distributed Computing:
What Color is it?.
(1) Breadth-First Search  S Queue S
Game Playing: Adversarial Search
Tree Searching.
Tree Searching.
Tree Searching.
Game Playing Chapter 5.
Graphs.
CS51A David Kauchak Spring 2019
Lecture 4: Tree Search Strategies
Mathematical Induction II
Presentation transcript:

A Fast Thinking Connect Four Machine! Final Project Presented by Tina Wen

Goal Write a fast connect k game on m by n grid from scratch m n k Small m and n: exhaustive search Big m and n: search to a good depth

Basic Idea Negamax search (recursively call expand and combine)

Approaches 1. Sequential exhaustive search 2. One dynamic queue in shared memory (TSP) 3. Master-Slave Message Passing Tile 0 tile1 tile2 tile3 tile COMBINE

Approaches 4. Master-Slave Individually allocated shared memory (no mutex) tile0 Where to write to to distribute work? Where to get the results? tile1 From which tileReady?Result Where to get work Ready?work 0 Where to return work? To which tilePointer 1 2 tile2 Where to get work Ready?work 0 Where to return work?

Heuristic Search for 4 in a row in 4 different orientations Count only rows that consist of one color and space (either red or black == 0) Out of 4:# for black # for red If one color has 4 in a row, then score =(infinity + spaces) Else score += If we are red

score = = = 14 score += = 22 Heuristic

Performance Comparison (connect 3) Performance of connect 3 on 4x4 grid Number of cycles Number of processors (P) Purple: sequential no pruning

Performance Comparison (connect 3) Performance of connect 3 on 4x4 grid Number of cycles Number of processors (P) 0.83 Purple: sequential no pruning Red: dynamic queue

Performance Comparison (connect 3) Performance of connect 3 on 4x4 grid Number of cycles Number of processors (P) Purple: sequential no pruning Upper Red: dynamic queue Lower Red: message passing

Performance of connect 3 on 4x4 grid Number of cycles Number of processors (P) Performance Comparison (connect 3) Purple: sequential no pruning Upper Red: dynamic queue Lower Red: message passing Blue: individually allocated shared memory

Performance of connect 4 on 4x4 grid Number of cycles Number of processors (P) Performance Comparison (connect 4) Purple: sequential no pruning

Performance of connect 4 on 4x4 grid Number of cycles Number of processors (P) Performance Comparison (connect 4) 1.15 Purple: sequential no pruning Red: dynamic queue

Performance of connect 4 on 4x4 grid Number of cycles Number of processors (P) Performance Comparison (connect 4) Purple: sequential no pruning Upper Red: dynamic queue Lower Red: message passing

Performance of connect 4 on 4x4 grid Number of cycles Performance Comparison (connect 4) Number of processors (P) Purple: sequential no pruning Upper Red: dynamic queue Lower Red: message passing Blue: individually allocated shared memory

Performance of connect 4 on 4x4 grid Number of cycles Number of processors (P) Performance Comparison (connect 4) Blue: individually allocated shared memory Red: message passing

Load Balancing Number of processors (P) Load balancing spread Better balanced Worse balanced 90 billion cycles 177 billion cycles 114 billion cycles 4 children 7 children

Sequential Pruning 2 5 <=2 >=5 Number of cyclesSequential pruningIndividually allocated shared memory (min) 3x3 connect billion3 billion 3x3 connect billion23 billion

Final Version Tile 0 Other tiles: sequential pruning Pros: Take advantage of both dynamic queue for load balancing and pruning Cons: Can’t do pruning between processors Number of cyclesSequential pruningIndividually allocated shared memory (min) Final Version (min) 3x3 connect billion3 billion (P=50)0.069 billion (P=20) 3x3 connect billion23 billion (P=50)0.14 billion(P=20)

Interactive Mode

Conclusion My connect four searches fast has a good heuristic By using Pruning Master slave structure Individually allocated shared memory COME TRY IT!