PHPackages                             aozen/astar - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Image &amp; Media](/categories/media)
4. /
5. aozen/astar

ActiveLibrary[Image &amp; Media](/categories/media)

aozen/astar
===========

A PHP package for finding the closest path and generating images of graphs using the A-star algorithm

v1.1.1(3y ago)015MITPHP

Since Feb 19Pushed 3y ago1 watchersCompare

[ Source](https://github.com/aozen/astar)[ Packagist](https://packagist.org/packages/aozen/astar)[ Docs](https://github.com/aozen/astar)[ RSS](/packages/aozen-astar/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (2)DependenciesVersions (4)Used By (0)

PathFinder
==========

[](#pathfinder)

Path Finder is a PHP library that helps you find the best path between two points in a randomly generated map. The library uses the A\* algorithm to find the shortest path between two points.

Installation
------------

[](#installation)

You can install the package via composer: `composer require aozen/astar`

Usage
-----

[](#usage)

To use Path Finder, you need to create an instance of the PathFinder class and call its methods to create a random map, find the best path, and generate an image of the map with the best path highlighted.

```
    use \Aozen\Astar\PathFinder;
```

Example:

```
$pathFinder = new PathFinder();

// Generate a random graph (map) with 10 dot. Length of roads random between 1 and 5
$graph = $pathFinder->createGraph(10, 5);
// Find the best path from $dot1 to $dot10
$path = $pathFinder->findPath($graph, 1, 10);
// If you want to download visualized result as a .png
$pathFinder->drawPath($graph, $path);
```

The createGraph method takes two arguments: dot count, max line distance between two dot.

The findPath method takes three arguments: the graph, the starting node and the ending node. In the example above, the starting node is 1 and the ending node is 10.

The drawPath method takes two arguments: the graph and the array of nodes that make up the best path.

### Contributors

[](#contributors)

The following text was written by "ChatGPT" when I prompt "I have a "Contributors" section in my readme.md file. You wrote lots of code. Add you own message before publish please."

This package was made with the help of ChatGPT, a language model developed by OpenAI. Most of the code in this package was generated automatically using natural language processing, making it easier and faster to develop. ChatGPT can assist in a variety of tasks, such as code generation, content creation, and language translation. To learn more about ChatGPT, please visit the OpenAI website at .

###  Health Score

22

—

LowBetter than 22% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity6

Limited adoption so far

Community4

Small or concentrated contributor base

Maturity47

Maturing project, gaining track record

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~28 days

Total

3

Last Release

1124d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/5b49826ec500f30a43d14359b7fde2723d999e700ef8c57414b9809450cd0886?d=identicon)[aozn](/maintainers/aozn)

---

Tags

imageAlgorithmgraphastar

### Embed Badge

![Health badge](/badges/aozen-astar/health.svg)

```
[![Health](https://phpackages.com/badges/aozen-astar/health.svg)](https://phpackages.com/packages/aozen-astar)
```

###  Alternatives

[intervention/image

PHP Image Processing

14.3k194.3M2.2k](/packages/intervention-image)[league/glide

Wonderfully easy on-demand image manipulation library with an HTTP based API.

2.6k51.2M116](/packages/league-glide)[liip/imagine-bundle

This bundle provides an image manipulation abstraction toolkit for Symfony-based projects.

1.7k38.3M217](/packages/liip-imagine-bundle)[spatie/image

Manipulate images with an expressive API

1.4k54.4M138](/packages/spatie-image)[intervention/image-laravel

Laravel Integration of Intervention Image

1496.5M102](/packages/intervention-image-laravel)[intervention/gif

PHP GIF Encoder/Decoder

5520.3M9](/packages/intervention-gif)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
