Skip to main content

A simple AI utilities package for search, CSP, and games.

Project description

AI Utilities Package

This package provides essential implementations of AI algorithms, making it easier for students to learn and experiment with search algorithms, constraint satisfaction problems (CSP), and game-playing strategies. It is based on the AIMA-Python project but has been modularized and simplified for educational use.

Features

  • Search Algorithms: Implements uninformed (BFS, DFS, UCS) and informed (Greedy, A*) search algorithms.
  • Constraint Satisfaction Problems (CSP): Includes backtracking search, forward-checking, and heuristics for CSPs.
  • Game Playing: Implements Minimax and Alpha-Beta pruning for decision-making in two-player games.

Installation

To install this package, use:

pip install aistudent-1.0.0-non-any-py312.whl

Dependencies

  • numpy
  • networkx
  • sortedcontainers
  • scipy
  • matplotlib

These dependencies will be installed automatically, but you can manually install them using:

pip install numpy networkx sortedcontainers scipy matplotlib

Usage

Once installed, you can import and use the package in your Python scripts.

Example 1: Using BFS from Search Module

from aiutils import search

problem = search.GraphProblem('A', 'B', some_graph)
solution = search.breadth_first_search(problem)
print(solution)

Example 2: Solving a CSP Problem

from aiutils import csp

variables = ['A', 'B', 'C']
domains = {'A': [1, 2], 'B': [1, 2], 'C': [1, 2]}
neighbors = {'A': ['B'], 'B': ['A', 'C'], 'C': ['B']}
problem = csp.CSP(variables, domains, neighbors)

solution = csp.backtracking_search(problem)
print(solution)
``
### Example 3: Minimax Algorithm for Game AI
```sh
from aiutils import game

game_state = game.TicTacToe()
move = game.minimax_decision(game_state, game_state.player)
print("Best Move:", move)

Credits & Contributions

This package is based on the AIMA-Python implementations by Stuart Russell & Peter Norvig, originally developed as part of Artificial Intelligence: A Modern Approach.

Original Implementation: AIMA-Python Contributors

Refactored & Simplified for Students: [Babar Ahmad]

Package Creation & Modularization: [Babar Ahmad]

This package is designed to simplify AI learning for students by providing easy-to-use, modular AI implementations.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

aistudent-1.0.1.tar.gz (2.4 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

aistudent-1.0.1-py3-none-any.whl (2.3 kB view details)

Uploaded Python 3

File details

Details for the file aistudent-1.0.1.tar.gz.

File metadata

  • Download URL: aistudent-1.0.1.tar.gz
  • Upload date:
  • Size: 2.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.12.0

File hashes

Hashes for aistudent-1.0.1.tar.gz
Algorithm Hash digest
SHA256 10b1e0edb9710dfe522cf7b3654d7e2e300e26b557610d47a23af2d228e87570
MD5 28c81f7f75d67c592d7a3d7c2a822e6f
BLAKE2b-256 358d9f94d3575656c3271faaf9b260183dbce253d4d7fef64b6242bb69726ea0

See more details on using hashes here.

File details

Details for the file aistudent-1.0.1-py3-none-any.whl.

File metadata

  • Download URL: aistudent-1.0.1-py3-none-any.whl
  • Upload date:
  • Size: 2.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.12.0

File hashes

Hashes for aistudent-1.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 793cfffffb60edc419e4cf4f23ee41859a34342a01982e7c0951a98460cc70c8
MD5 3b3dcbf13b361238ed4ef3ca06295387
BLAKE2b-256 b07895dcb59259991106accbc910bc4e26565e9d4d8f66130e287a2bb2416c48

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page