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.2.tar.gz (42.5 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.2-py3-none-any.whl (43.8 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: aistudent-1.0.2.tar.gz
  • Upload date:
  • Size: 42.5 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.2.tar.gz
Algorithm Hash digest
SHA256 427259250e8a5e3d3ca3ddd2c70ff57f032316b54e0d541fe64d856765bc3fa3
MD5 ea8d139cd6a3fe4f19c0971fedf3f79f
BLAKE2b-256 b00b1e48e0eb01f3b6351c351f3febbf1405cecb02169f375293fc98b64c9719

See more details on using hashes here.

File details

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

File metadata

  • Download URL: aistudent-1.0.2-py3-none-any.whl
  • Upload date:
  • Size: 43.8 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.2-py3-none-any.whl
Algorithm Hash digest
SHA256 d505af211b8b88b2ad9843bc96560667217b8f1e0b931ca6612403f2482b9138
MD5 440391e2156305432e91b922170e6aff
BLAKE2b-256 39b9d18f0881300d8e90c3a594bc55dd4a0b2345e1c277f3859bfd7f748a7a94

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