Download the PHP package nexus-scholar/graph-algorithms without Composer
On this page you can find all versions of the php package nexus-scholar/graph-algorithms. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download nexus-scholar/graph-algorithms
More information about nexus-scholar/graph-algorithms
Files in nexus-scholar/graph-algorithms
Package graph-algorithms
Short Description A high-performance library of standard graph algorithms for PHP.
License MIT
Homepage https://github.com/nexus-scholar/graph-algorithms
Informations about the package graph-algorithms
nexus-scholar/graph-algorithms
graph-algorithms is a PHP package of graph algorithms built on nexus-scholar/graph-core. It provides centrality, pathfinding, traversal, component analysis, topological ordering, and minimum-spanning-tree algorithms through typed, reusable APIs.
Role In Nexus Scholar
This package is the algorithm layer for Nexus Scholar citation-network analysis. graph-core owns graph storage and export primitives; graph-algorithms owns reusable graph computations; nexus-scholar/core applies those capabilities to scholarly workflows such as citation graphs, co-citation analysis, bibliographic coupling, snowballing, and review exports.
The package is generic enough to use outside research tooling, but its main public value is showing that Nexus Scholar's graph work is package-quality PHP, not only application code.
Features
- PageRank and degree centrality.
- Dijkstra and A* pathfinding.
- Breadth-first and depth-first traversal.
- Strongly connected components using Tarjan's algorithm.
- Topological sort with cycle detection.
- Minimum spanning tree support.
- Integer-indexed
AlgorithmGraphproxy for efficient algorithm execution. - Typed value objects such as
PathResultandMstResult. - Pest test coverage and canonical fixtures.
Requirements
- PHP 8.2+
nexus-scholar/graph-core^1.0
Installation
Quick Start
PageRank
Shortest Path
A* With A Heuristic
Traversal
Strongly Connected Components
Custom Weights
Pathfinding algorithms can read weights from arbitrary edge attributes:
Error Handling
Algorithms expose failure states through typed returns or meaningful exceptions depending on the operation:
- Dijkstra rejects negative weights.
- Topological sort reports cycles.
- Minimum spanning tree returns no result for disconnected graphs.
- Pathfinding returns
nullwhen no path exists.
Architecture
AlgorithmGraph: optimized integer-indexed graph proxy used during algorithm execution.IndexMap: bidirectional string-to-integer mapping.CentralityAlgorithmInterface: centrality algorithm contract.PathfindingAlgorithmInterface: pathfinding contract returningPathResult.TraversalAlgorithmInterface: traversal contract.PathResult: immutable shortest-path result.MstResult: minimum-spanning-tree result.
Testing
Use Cases
- Citation-network analysis.
- Scholarly influence and discovery graphs.
- Dependency resolution and build ordering.
- Workflow orchestration.
- Route planning and logistics.
- Infrastructure and network analysis.
- Game pathfinding and level connectivity.
See Also
- nexus-scholar/graph-core - core graph data structures, attributes, subgraph views, and exports.
- nexus-scholar/core - Nexus Scholar workflow engine that applies graph packages to scholarly review workflows.
- nexus-scholar/scholar-graph - legacy scholarly graph prototype that preceded the current graph packages.
License
This library is open-sourced software licensed under the MIT license.