Skip to main content

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

pip install heapplot

🚀 Usage

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

Level-by-level graph traversal using a deque queue. Guarantees shortest path in unweighted graphs.

Recursive depth-first traversal. Explores as far as possible before backtracking.

DFS with a depth limit to prevent infinite loops in deep/cyclic graphs.


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.


heapplot.hillclimbing() — Hill Climbing

Greedy local search that always moves to the neighbour with the best heuristic.


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.


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

Metadata

Release files for heapplot 1.0.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for heapplot 1.0.0
File Size Uploaded Provenance Actions
heapplot-1.0.0.tar.gz 13.5 kB Without provenance Details for heapplot-1.0.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for heapplot 1.0.0
File Interpreter ABI Platform Actions
heapplot-1.0.0-py3-none-any.whl Python 3 none any Details for heapplot-1.0.0-py3-none-any.whl

Total release size: 29.1 kB

Release files / heapplot-1.0.0.tar.gz

Download URL heapplot-1.0.0.tar.gz
Size 13.5 kB
Tags Source
SHA-256 checksum
How to use checksums
1c226c44df2f795181eff37522d610a3612e9125ab5e6e75e9320b04da1c02bb
BLAKE2b-256 checksum
How to use checksums
09ff7acc43c5accbe740af690a1173fa8084b68987a45d00077864f01b2d9943
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.12

Release files / heapplot-1.0.0-py3-none-any.whl

Download URL heapplot-1.0.0-py3-none-any.whl
Size 15.6 kB
Tags Python 3
SHA-256 checksum
How to use checksums
9a177bafbe118f82f887c8567ffdcfbd93b75614b9a91ef65d70d04e7f16042c
BLAKE2b-256 checksum
How to use checksums
a313e7e1f7c9ec27a686b38b91868762ce9688851e91efc3517c5119fb793b7e
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.12

Security for heapplot 1.0.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page