{"id":25164336,"url":"https://github.com/msaadx/Tic-Tac-ToeUsingMinimaxAlgorithmWithAlpha-BetaPruning","last_synced_at":"2025-10-24T02:30:58.390Z","repository":{"id":246485372,"uuid":"821271496","full_name":"muhammadsaadhsn/Tic-Tac-ToeUsingMinimaxAlgorithmWithAlpha-BetaPruning","owner":"muhammadsaadhsn","description":"Implementing a Tic-Tac-Toe AI using Python, leveraging the Minimax algorithm with Alpha-Beta pruning for optimal decision-making. Features include parallelization for performance and heuristic evaluation. Play against the AI in a console-based game, exploring strategies and performance optimizations in game theory.","archived":false,"fork":false,"pushed_at":"2024-06-28T07:21:33.000Z","size":12,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-01-28T15:39:50.936Z","etag":null,"topics":["alpha-beta-pruning","heuristic","jupyter-notebook","minmax-algorithm","parrallel","python","tictactoe"],"latest_commit_sha":null,"homepage":"","language":"Jupyter Notebook","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/muhammadsaadhsn.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-06-28T07:13:41.000Z","updated_at":"2024-06-28T07:21:36.000Z","dependencies_parsed_at":"2024-06-28T08:40:11.734Z","dependency_job_id":"70281723-bab0-435e-aafe-7f98f6baa374","html_url":"https://github.com/muhammadsaadhsn/Tic-Tac-ToeUsingMinimaxAlgorithmWithAlpha-BetaPruning","commit_stats":null,"previous_names":["muhammadsaadhasan/tic-tac-toeusingminimaxalgorithmwithalpha-betapruning","muhammadsaadhsn/tic-tac-toeusingminimaxalgorithmwithalpha-betapruning"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/muhammadsaadhsn%2FTic-Tac-ToeUsingMinimaxAlgorithmWithAlpha-BetaPruning","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/muhammadsaadhsn%2FTic-Tac-ToeUsingMinimaxAlgorithmWithAlpha-BetaPruning/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/muhammadsaadhsn%2FTic-Tac-ToeUsingMinimaxAlgorithmWithAlpha-BetaPruning/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/muhammadsaadhsn%2FTic-Tac-ToeUsingMinimaxAlgorithmWithAlpha-BetaPruning/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/muhammadsaadhsn","download_url":"https://codeload.github.com/muhammadsaadhsn/Tic-Tac-ToeUsingMinimaxAlgorithmWithAlpha-BetaPruning/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":237905531,"owners_count":19385037,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["alpha-beta-pruning","heuristic","jupyter-notebook","minmax-algorithm","parrallel","python","tictactoe"],"created_at":"2025-02-09T04:30:01.766Z","updated_at":"2025-10-24T02:30:53.053Z","avatar_url":"https://github.com/muhammadsaadhsn.png","language":"Jupyter Notebook","readme":"# Tic-Tac-Toe AI using Minimax Algorithm with Alpha-Beta Pruning\n\nThis project implements an AI player for Tic-Tac-Toe using the Minimax algorithm with Alpha-Beta pruning. It includes different aspects such as the basic implementation of the game, optimization with Alpha-Beta pruning, parallelization for performance improvement, and an enhanced version using heuristics.\n\n## Table of Contents\n\n1. [Introduction](#introduction)\n2. [Features](#features)\n3. [Setup](#setup)\n    - [Prerequisites](#prerequisites)\n    - [Installation](#installation)\n4. [Usage](#usage)\n5. [Algorithm Details](#algorithm-details)\n    - [Minimax Algorithm](#minimax-algorithm)\n    - [Alpha-Beta Pruning](#alpha-beta-pruning)\n    - [Parallelization](#parallelization)\n    - [Heuristic Evaluation](#heuristic-evaluation)\n6. [Performance Comparison](#performance-comparison)\n7. [Future Enhancements](#future-enhancements)\n8. [Contributing](#contributing)\n9. [License](#license)\n\n## Introduction\n\nThis project implements a Tic-Tac-Toe game AI using Python, focusing on the Minimax algorithm with Alpha-Beta pruning. The AI is designed to play optimally against a human player, making decisions based on the game state evaluation without exploring unnecessary branches of the game tree.\n\n## Features\n\n- **Basic Tic-Tac-Toe Game**: Implements a simple console-based Tic-Tac-Toe game where a human player can play against the AI.\n  \n- **Minimax Algorithm**: Utilizes the Minimax algorithm to evaluate the game state and choose the best possible move for the AI.\n  \n- **Alpha-Beta Pruning**: Optimizes the Minimax algorithm by implementing Alpha-Beta pruning, reducing the number of nodes evaluated and improving performance.\n  \n- **Parallelization**: Offers a parallelized version of the Alpha-Beta pruning algorithm using multithreading to further enhance performance on multicore systems.\n  \n- **Heuristic Evaluation**: Includes an enhanced version of the AI using heuristic evaluation for non-terminal game states, allowing quicker pruning of unpromising branches.\n\n## Setup\n\n### Prerequisites\n\nTo run this project, ensure you have the following installed:\n\n- Python 3.x\n- [ThreadPoolExecutor](https://docs.python.org/3/library/concurrent.futures.html#threadpoolexecutor) (for parallelization, included in Python standard library)\n\n### Installation\n\nClone the repository:\n\n```bash\ngit clone https://github.com/your-username/tic-tac-toe-minimax.git\ncd tic-tac-toe-minimax\n```\n\nNo additional packages are required beyond Python's standard library.\n\n## Usage\n\nTo play the Tic-Tac-Toe game against the AI, simply run:\n\n```bash\npython main.py\n```\n\nFollow the on-screen instructions to make your moves against the AI. The AI will respond with its optimal moves based on the Minimax algorithm with Alpha-Beta pruning.\n\n## Algorithm Details\n\n### Minimax Algorithm\n\nThe Minimax algorithm is a decision-making algorithm that is used for finding the optimal move in a two-player, zero-sum game.\n\n### Alpha-Beta Pruning\n\nAlpha-Beta pruning is an optimization technique for the Minimax algorithm that reduces the number of nodes evaluated in the search tree.\n\n### Parallelization\n\nParallelization using Python's `ThreadPoolExecutor` allows the Alpha-Beta pruning algorithm to evaluate multiple potential moves concurrently, improving performance on multicore processors.\n\n### Heuristic Evaluation\n\nHeuristic evaluation is used to estimate the desirability of a game state without exploring all possible moves. It guides the AI to prioritize more promising branches of the game tree, thereby reducing search space.\n\n## Performance Comparison\n\nThe performance of the AI with and without Alpha-Beta pruning, as well as the parallelized version, can be compared in terms of the number of nodes evaluated and execution time.\n\n## Future Enhancements\n\n- **Graphical User Interface (GUI)**: Implement a GUI for a more interactive gameplay experience.\n  \n- **Deep Learning Integration**: Explore using deep learning models to enhance AI decision-making in complex game scenarios.\n  \n- **Extended Game Support**: Extend the AI to support other board games with similar two-player, zero-sum characteristics.\n\n## Contributing\n\nContributions are welcome! Fork the repository and submit pull requests for any enhancements or bug fixes. Please open an issue to discuss major changes beforehand.\n\n## License\n\nThis project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details.\n\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmsaadx%2FTic-Tac-ToeUsingMinimaxAlgorithmWithAlpha-BetaPruning","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmsaadx%2FTic-Tac-ToeUsingMinimaxAlgorithmWithAlpha-BetaPruning","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmsaadx%2FTic-Tac-ToeUsingMinimaxAlgorithmWithAlpha-BetaPruning/lists"}