Pathing Algorithms in PHP

So, lets assume I have a set of objects of variable count.
A set of objects that link to a variable number of other objects in the set, but with at least 1 link.
thus, the set actually forms a ‘web’ of objects.

From any given node, I want to find the shortest path to any other node in the set; for all purposes, the length between any two nodes in the set = 1. (Yes, i’m aware that this may result in multiple results with the same length); what is important to me is the length, not the specific path.

I’ve tried to run this before, and run into memory limit problems as i’m trying to build the list of potential paths.

is this what you want ?

A* Pathfinding, just searching google, many tutorials.

A* relies upon the paths having different weights. Given that all edges in this pattern would have the same weight, it becomes a Breadth-First-Search. Trick is that given the potential spread (I estimate worst case scenario to be 8^n, n=0…~100 in the current data set)… that’s a lot of data to hold in memory.