Metadata-Version: 2.4
Name: heapplot
Version: 1.0.0
Summary: AI Lab Code Reference Package — Automation toolkit for AI game engine logic in VR headset development. Instantly print complete source code for classic AI algorithms: BFS, DFS, DLS, Best First Search, A*, 8-Puzzle, N-Queens, Hill Climbing, Alpha-Beta Pruning, Missionaries & Cannibals, Goal Stack Planning, Forward Chaining, and Bayesian Networks.
Author: heapplot
License: MIT
Project-URL: Homepage, https://pypi.org/project/heapplot/
Keywords: ai,artificial-intelligence,algorithms,search,bfs,dfs,astar,a-star,alpha-beta,alphabeta,minimax,hill-climbing,bayesian,forward-chaining,n-queens,csp,8-puzzle,goal-stack,missionaries-cannibals,vr,game-engine,education
Classifier: Development Status :: 5 - Production/Stable
Classifier: Intended Audience :: Education
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: MIT License
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.8
Classifier: Programming Language :: Python :: 3.9
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Classifier: Topic :: Scientific/Engineering :: Artificial Intelligence
Classifier: Topic :: Education
Requires-Python: >=3.8
Description-Content-Type: text/markdown
License-File: LICENSE
Dynamic: license-file

# heapplot

> **AI Lab Code Reference Package** — Automation toolkit for AI game engine logic in VR headset development.

`heapplot` was born out of the need to rapidly prototype and reference classic AI decision-making algorithms for an automation layer powering game engine AI in VR headsets. Each function in this package prints the complete, ready-to-run source code of a specific AI algorithm directly to your terminal — making it a lightning-fast reference for AI developers and students alike.

---

## 📦 Installation

```bash
pip install heapplot
```

---

## 🚀 Usage

```python
import heapplot

# See all available functions
heapplot.help()

# Print the code for any algorithm
heapplot.bfs()
heapplot.alphabeta()
heapplot.bayesian()
```

---

## 📚 Available Functions

| Function | Assignment | Concept |
|---|---|---|
| `heapplot.bfs()` | 1 | Breadth First Search |
| `heapplot.dfs()` | 1 | Depth First Search |
| `heapplot.dls()` | 1 | Depth Limited Search |
| `heapplot.bestfirst()` | 2 | Best First Search |
| `heapplot.astar()` | 2 | A* Algorithm |
| `heapplot.puzzle8()` | 3 | 8-Puzzle Problem (A* with misplaced tiles heuristic) |
| `heapplot.nqueens()` | 4 | N-Queens (Constraint Satisfaction / Backtracking) |
| `heapplot.hillclimbing()` | 5 | Hill Climbing Algorithm |
| `heapplot.alphabeta()` | 6 | Alpha-Beta Pruning (Minimax Game Trees) |
| `heapplot.missionarycannibals()` | 7 | Missionaries & Cannibals (A*) |
| `heapplot.goalstack()` | 8 | Goal Stack Planning (Blocks World / STRIPS) |
| `heapplot.forwardchaining()` | 9 | Forward Chaining Inference Engine |
| `heapplot.bayesian()` | 10 | Bayesian Network (Student Exam Performance) |

---

## 🧠 Algorithm Details

### Assignment 1 — Search Algorithms

#### `heapplot.bfs()` — Breadth First Search
Level-by-level graph traversal using a deque queue. Guarantees shortest path in unweighted graphs.

#### `heapplot.dfs()` — Depth First Search
Recursive depth-first traversal. Explores as far as possible before backtracking.

#### `heapplot.dls()` — Depth Limited Search
DFS with a depth limit to prevent infinite loops in deep/cyclic graphs.

---

### Assignment 2 — Heuristic Search

#### `heapplot.bestfirst()` — Best First Search
Greedy search that expands the node with the lowest heuristic value using a priority queue.

#### `heapplot.astar()` — A* Algorithm
Optimal search combining path cost `g` and heuristic `h` → `f = g + h`.

---

### Assignment 3 — Puzzle Solving

#### `heapplot.puzzle8()` — 8-Puzzle Problem
A* solution for the 8-tile sliding puzzle using misplaced tiles as the heuristic.

---

### Assignment 4 — Constraint Satisfaction

#### `heapplot.nqueens()` — N-Queens Problem
Backtracking CSP solver that places N non-attacking queens on an N×N chessboard.

---

### Assignment 5 — Local Search

#### `heapplot.hillclimbing()` — Hill Climbing
Greedy local search that always moves to the neighbour with the best heuristic.

---

### Assignment 6 — Game Tree Search

#### `heapplot.alphabeta()` — Alpha-Beta Pruning
Minimax algorithm with alpha-beta pruning to eliminate branches that cannot affect the result. Core to adversarial AI in game engines.

---

### Assignment 7 — Planning with Search

#### `heapplot.missionarycannibals()` — Missionaries & Cannibals
A* solution to the classic river-crossing puzzle with safety constraints.

---

### Assignment 8 — AI Planning

#### `heapplot.goalstack()` — Goal Stack Planning
STRIPS-style planning using a goal stack and operators (STACK, UNSTACK, PICKUP, PUTDOWN) in a blocks world domain.

---

### Assignment 9 — Knowledge Representation

#### `heapplot.forwardchaining()` — Forward Chaining
Data-driven inference engine that repeatedly applies rules to derive new facts until a query is satisfied.

---

### Assignment 10 — Probabilistic AI

#### `heapplot.bayesian()` — Bayesian Network
Joint probability computation over a student exam performance Bayesian Network using Conditional Probability Tables (CPTs).

---

## 🎮 Why heapplot?

`heapplot` was originally developed as an automation reference layer for an AI game engine powering VR headsets. The core algorithms — from minimax and alpha-beta pruning for adversarial NPC behaviour, to A* and BFS for pathfinding, to Bayesian networks for probabilistic decision-making — form the backbone of intelligent behaviour in VR environments.

---

## 📄 License

MIT License
