Skip to main content

PathFinder

PathFinder is a Python package that provides classic pathfinding algorithms such as:

  • Breadth-First Search (BFS)

  • Depth-First Search (DFS)

  • Uniform Cost Search (UCS)

  • A-Star Search (A*)

These algorithms work on 2D mazes represented as grids, and are designed to help with visualization, teaching, or solving pathfinding problems programmatically.

💾 Installation

pip install PathWise

📝 Features

  • Supports 2D grid mazes with customizable start, goal, and wall positions

  • Clear API to run any algorithm and get the path, cost, and visited nodes

  • Easily extendable for diagonal movement or custom cost functions

  • Suitable for AI projects, teaching, and maze-solving

⚖️ Algorithms Included

BFS

  • Explores nodes level by level

  • Guarantees shortest path if all moves have equal cost

DFS

  • Explores deep into one branch before backtracking

  • May not find the shortest path

UCS

  • Uses a priority queue (cost-based)

  • Always finds the lowest-cost path

A*

  • Uses cost + heuristic (e.g. Manhattan distance)

  • Highly efficient for large or complex mazes

💡 Usage

1. Representing the Maze

A maze is a 2D list of characters:

maze = [ ["S", " ", " ", "#", "G"], ["#", "#", " ", "#", " "], [" ", " ", " ", " ", " "], [" ", "#", "#", "#", " "], [" ", " ", " ", " ", " "] ]

S = Start

G = Goal

# = Wall (Represented by 1)

' ' = Open path (Represented by 0)

2. Running an Algorithm

import numpy as np
from PathWise import BFS, DFS, UCS, A_Star

Maze = [[...], [...], ...]
Maze = np.array(Maze).astype('str')

path, nodesExpanded = DFS(Maze, start, end)         #   or BFS
path, cost, nodesExpanded = UCS(Maze, start, end)   #   or A_Star

print("Path:", path)
print("Visited:", visited)
print("Cost: ", cost)                               #   if UCS or A_Star has been used

📁 Project Structure

./
├── PathWise/
│   ├── __init__.py
│   ├── A_Star.py
│   ├── BFS.py
│   ├── DFS.py
│   ├── Helper.py
│   └── UCS.py
├── .gitignore
├── LICENSE
├── README.md
└── setup.py

📃 License

This project is licensed under the MIT License.

Author

Developed by Mahdi Jaffery

Metadata

Release files for PathWise 1.2.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 PathWise 1.2.0
File Size Uploaded Provenance
pathwise-1.2.0.tar.gz 4.8 kB Without provenance Details

Built distribution (wheel)

Table of built distributions (wheels) for PathWise 1.2.0
File Interpreter ABI Platform
pathwise-1.2.0-py3-none-any.whl Python 3 none any Details

Total release size: 11.2 kB

Release files / pathwise-1.2.0.tar.gz

Download URL pathwise-1.2.0.tar.gz
Size 4.8 kB
Tags Source
SHA-256 checksum
How to use checksums
15ae1d10f155719c5370c121590868e8284917e949c6244844637cd70d323fdd
BLAKE2b-256 checksum
How to use checksums
1437995b098ee96c8a2a10affddfaf40d241b8896b91fe15b6c5bdd3a9e3be06
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.12.3

Release files / pathwise-1.2.0-py3-none-any.whl

Download URL pathwise-1.2.0-py3-none-any.whl
Size 6.3 kB
Tags Python 3
SHA-256 checksum
How to use checksums
88bbcfb72c1f4743db4204ea1aee3b3ef523135c9a0d3fa6f08ce5c6cd21741f
BLAKE2b-256 checksum
How to use checksums
c38a7c0bba5c6f61e62c4837d8f09757e37b482f0993102cbc3544969193a119
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.12.3

Security for PathWise 1.2.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