graphp/algorithms
Common graph algorithms for PHP, built on graphp/graph. Includes shortest paths, Dijkstra, Floyd-Warshall, topological sorting, connected components, and more, with a clean API for working with directed and undirected graphs.
Architecture fit
graphp/algorithms is a pure-PHP, in-memory implementation of classic graph algorithms (Dijkstra, Bellman-Ford, Floyd-Warshall, topological sort, BFS/DFS, MST via Kruskal/Prim, connected components) built on top of graphp/graph. It has no framework coupling, so it drops into Laravel as a plain Composer dependency used from service classes, jobs, or console commands.GraphBuilder service can map domain entities to vertices/edges and keep the algorithm layer swappable.Integration feasibility
composer require graphp/algorithms, no service provider or config publication required. A thin Laravel service provider to bind a GraphService/GraphBuilder and optionally publish config is sufficient.Vertex/Edge objects, weight normalization, handling of missing/orphan nodes, and caching of computed results.Technical risk
APP_DEBUG=false pipelines if warnings are escalated.Key questions
Stack fit
Migration path
Compatibility
composer.json and commit the lockfile; do not rely on floating constraints for a package with no recent releases.internal/graphp-algorithms) from day one — MIT allows it, and it converts an upstream availability risk into an internal maintenance line item.Sequencing
GraphBuilder + GraphService abstractions so the library is isolated behind an internal interface — this preserves the option to swap in a database or sidecar later.Maintenance
GraphService interface is the real maintenance asset — it caps the blast radius of a future replacement at one class.Support
Scaling
Failure modes
Ramp-up
How can I help you explore Laravel packages today?