Graph algorithms and data structures for PureScript, designed for visualization.
This package provides graph algorithms with optional tracing for visualization, consolidating graph-related code from the Hylograph ecosystem.
- Pathfinding: A*, Dijkstra, BFS/DFS
- Analysis: Reachability, transitive reduction, layer computation
- DAG operations: Topological sort, cycle detection
- Rose tree helpers (wrapping
tree-rose) - Tree manipulation functions
- DAGTree for "mostly hierarchical" graphs
- Optional algorithm tracing for step-by-step animation
- Position helpers for layout
spago install hylograph-graphimport Data.Graph.Pathfinding (findPath)
result = findPath startNode endNode myGraphimport Data.Graph.Pathfinding.Traced (findPathTraced)
{ result, steps, explored } = findPathTraced startNode endNode myGraph
-- Use `steps` to animate the algorithmData.Graph.Pathfinding- Basic pathfinding algorithmsData.Graph.Pathfinding.Traced- Pathfinding with step-by-step tracingData.Graph.Algorithms- Graph analysis (reachability, reduction)Data.Graph.Layout- Position helpers for graph visualizationData.Graph.Types- Core graph typesHylograph.Data.DAGTree- Hybrid DAG/tree structure
This package is part of the Hylograph visualization ecosystem:
- hylograph-graph - Graph algorithms (this package)
- hylograph-selection - Type-safe D3 selection and rendering
- hylograph-simulation - Force-directed graph simulation
- hylograph-layout - Layout algorithms
MIT
