nexus-scholar/graph-core
Lightweight PHP 8.2+ graph data-structure for directed/undirected graphs with node/edge attributes, fast adjacency via integer indexing, read-only subgraph views, and exporters for Cytoscape.js JSON, GraphML, and GEXF. Ideal base for graph analytics.
ext-dom for XML exports (commonly enabled in Laravel deployments).GraphRepository).graph-core for in-memory traversals).GraphNodeAdded) for reactive workflows.php-graph, networkx via PHP bindings).graph-core for visualization/export only, offload traversals to SQL.Mbsoft\Graph\ → nexus-scholar\ may require autoloader adjustments in Laravel.memory_limit. Test with SubgraphView for pruning.GraphRepository interface?nexus-scholar/graph-algorithms (e.g., PageRank) or is graph-core sufficient?Graph/SubgraphView as singletons or context-bound instances.Paper::citationNetwork()).nodes/edges tables) and hydrate into graph-core for traversals.Schema::create('nodes', fn(Blueprint $table) => $table->id()->string('external_id')->json('attributes'));
Schema::create('edges', fn(Blueprint $table) => $table->foreignId('from_node_id')->foreignId('to_node_id')->json('attributes'));
SubgraphView instances for frequently accessed subgraphs (e.g., Redis::remember()).graph-core.laravel-graph-core) to abstract initialization/configuration.ext-dom is enabled in php.ini for XML exports.composer.json to include nexus-scholar/graph-core and nexus-scholar/graph-algorithms (if needed).| Phase | Task | Dependencies |
|---|---|---|
| 1. Setup | Install package, configure service provider. | None |
| 2. Data Layer | Design DB schema for hybrid storage. | Migration scripts. |
| 3. Core Logic | Implement graph hydration from DB. | Data layer. |
| 4. Traversals | Add business logic (e.g., "find paths"). | Core logic. |
| 5. Exports | Integrate exporters into API responses. | Traversal logic. |
| 6. Testing | Benchmark vs. SQL alternatives; validate edge cases. | All prior phases. |
ext-dom).nexus-scholar rebrands.graph-core's Pest test suite to reproduce issues locally.debugbar to inspect graph structures mid-request.graph-algorithms package).graph-core for complex traversals.SubgraphView instances for repeated queries.| Scenario | Impact | Mitigation |
|---|---|---|
| Out of Memory | Crash on large graphs. | Implement chunking; increase memory_limit. |
| Namespace Resolution | Autoloader fails. | Explicitly map namespaces in composer.json. |
| DOM Extension Missing | XML exports fail. | Add ext-dom to deployment checks. |
| Data Corruption | Invalid graph state. | Validate graphs on hydration. |
| Concurrency Issues | Race conditions in mutations. | Use Laravel’s queue system. |
How can I help you explore Laravel packages today?