Download as pdf or txt
Download as pdf or txt
You are on page 1of 5

651 Project Draft

Connect Four

Tanmay Hinge | Mario Mejia

Problem
Creating a weighted directed graph representation of the Connect Four as a playable game on a
randomly generated graph. Where each node will represent the cell and edges will represent
the path if available to drop the game piece. Each game piece will drop down the path; where
the path will be decided by the edge probability.

Goal
The objective of Connect Four is to be the first to connect four of your pieces in a sequence on
the directed graph. Calculate winning state.

Apart from implementing the functionality to play, we plan to implement a win probability/
winning move descriptor for the graph which will display the best moves to the user that could
lead to a win.

Figure 1: Graph VIsualization

Methodology
We start by implementing a graph generation algorithm (Random DAG ) where each graph
should have at least 4 levels, like shown in Figure 1.
For design purposes and providing a good gameplay experience, each node in the starting level
shouldn’t have an edge to another node on the starting level.
Also, there could be two options for the game
1. uniform edge probability
2. Non uniform edge probability
Where each edge can have a different probability which will affect how the piece ends up getting
dropped in the game.

SCRUM Report

Sprint Planning
- GUI
- We aim to convert this into a fully GUI based application
- Win Detection Algorithm
- To detect after each move whether any player has won or not
- AI Player
- Error/ illegal move handling
- Game Logic

Progress
- Github/GDrive link for code so far
- A randomly generated graph

- We already have mult-partite graph


- Create a more viewable layout

- Random Edge creating using Eros-Renyi Approach with the use of a probability
condition at each edge creation for each input node
- Function Declaration(note probability p for edge creation)

- Function code for generating edges using p


- Function call and usage

- Player functionality
The game alternates between player 1 and player 2. Where each player has to
choose which node to drop the piece in and then the piece traverses down the
graph to the last available location.
After each player is done with their move, the game state is displayed again.
As shown below, currently the node gets a red label stating which player’s piece
is on which node.

Project Scope
● The scope of the Connect Four project includes developing functionality that allows two
players to compete with each other and complete the 4 pieces in a row.
● Developing the game logic, graphical user interface design, win detection algorithms,
and error handling.
● Adding dynamic edge probability to the graph.
● Can also create a functionality for 2 player mode where one player will be AI.
● AI opponents can also be added to the project. Different difficulty levels can be given to
the AI.

References
[1] Game Theory
https://blogs.cornell.edu/info2040/2015/09/21/solving-connect-four-with-game-theory/
[2] Decomposition of a graph in polynomial time for connect four.
www.researchgate.net/publication/232252861_Connect_Four_and_Graph_Decomposition
[3] https://django-postgresql-dag.readthedocs.io/en/latest/quickstart.html
[4] https://pyvis.readthedocs.io/en/latest/index.html

You might also like