Presentation is loading. Please wait.

Presentation is loading. Please wait.

Kevin Mason Michael Suggs

Similar presentations


Presentation on theme: "Kevin Mason Michael Suggs"— Presentation transcript:

1 Kevin Mason Michael Suggs
DOUBLE TAP TO ADD TITLE Kevin Mason Michael Suggs

2 Background Two player connection game Red / yellow (or black) “pucks”
First player with 4 of their colour in a row wins Can be either horizontal, vertical, or diagonal Board mutation after placement is not allowed

3 Natural Language Given a pre-set 6x7 board, overall effectiveness of each algorithm will be calculated to produce maximal winning combinations whilst minimizing time, space and number of moves against an opponent.

4 Formal Statement Ea= 𝑋 𝑛 𝑛
Xn=( 𝑖=0 𝑛 (.25𝑤 𝑡 𝑠 +.25𝑚) ) Ea = Calculated Effectiveness of each algorithm Xn = Calculated sum of observed terms n = Number of runs t = Running time s = Space utilization m = Number of moves w = Number of successful wins for the algorithm

5 Implementation Each algorithm was tested against a randomized opponent
Used our win check method to see if 2+ in a row Otherwise, placed randomly through the columns Board was pre-set with a variable number of pieces Ran with a depth restriction of 4/5/6 for 12/18/24 pieces Algorithms implemented on a 2D representation of a Connect 4 Board

6 Algorithms Brute Force Greedy MiniMax Alpha-Beta Pruning

7 Brute Force Looks at all past moves
If multiple are in a row, then a move will be placed Tries to find locations where more than one are in sequence If none are in sequence, then a random column is chosen

8 Greedy Looked around at all possible moves from its current location
Checked both its moves and its opponents moves Determines which move would be best at that location Based on local values directly accessible from its location Looking for locally optimal move

9 MiniMax Given a depth restriction
Game tree algorithm that maps potential board states to nodes “Plays itself” to determine which moves will most likely result in a win against a perfect opponent before placing a move Scores the outcome of each node Maximize player score and minimize opponent score Each depth level represents a different player Max Nodes vs. Min Nodes Given a depth restriction

10 Alpha-Beta Pruning Pruning Alpha represents upper limit
Utilizes a game tree Gives bounds to searching, improving efficiency Released depth restriction Pruning Alpha represents upper limit Beta represents lower limit Branch is terminated once a bound is crossed

11 Depth: 4

12 Depth: 6

13 MiniMax vs. Alpha-Beta Children (D: 4)

14 MiniMax vs. Alha-Beta Children (D:6)

15 Efficiency (D: 4 – P:18)

16 Efficiency (D: 6 – P: 18)

17 Algorithm Analysis MiniMax 𝑂 𝑏∗𝑏∗…∗𝑏 𝑑 =O( 𝑏 𝑑 ) : time
b: number of legal moves d: depth of the search tree Alpha-Beta Pruning O 𝑏 𝑑 2 O( 𝑏 𝑑 ) at worst Greedy 𝑂(𝑏+𝑚) m: number of played moves Brute Force 𝑂(𝑚)

18 Future Work Running algorithms against each other
Algorithms run with the presumption of perfection Add the possibility for human interaction How would our algorithm fare against a human opponent? Implement these algorithms on Connect 4 variants Look into our other possible algorithms E.g./ Proof Number Search, Monte Carlo

19 Questions Q: How does our greedy algorithm approach the problem? A:

20 Questions Q: How does our greedy algorithm approach the problem?
A: It checks all the possible move locations directly accessible to it and the opponent and applies each a value. Once all immediately accessible nodes have been checked, the move with the most benefit to the algorithm is selected.

21 Questions Q: How does MiniMax generate moves? A:

22 Questions Q: How does MiniMax generate moves?
A: Generates a tree of all possible moves from the selected node and all nodes following it. Simulates a game with itself until the end (or the depth limit) is reached, in which it returns the scoring of the nodes in the tree to that point. Then, the maximal or minimal value is selected and played.

23 Questions Q: What technique does Alpha-Beta utilize to reduce its search space? A:

24 Questions Q: What technique does Alpha-Beta utilize to reduce its search space? A: Branch-and-Bound. Once a branch crosses either of the determined bounds, then it is pruned. Bounds are determined by the calculated maximum or minimum value of a node, depending on the current player (maximizing vs. minimizing).

25 Why 380? Designed and implemented our own modified algorithm
Analyzed algorithms we implemented Concluding Thoughts


Download ppt "Kevin Mason Michael Suggs"

Similar presentations


Ads by Google