ngraph.path is a JavaScript library that implements efficient pathfinding algorithms for graphs, primarily designed to compute shortest paths in weighted or unweighted networks. It provides a clean API for constructing graph models, assigning weights to edges, and querying for optimal routes between nodes, making it useful for routing, games, maps, and network optimization. The library includes several algorithm implementations such as A*, Dijkstra’s, and breadth-first search, each suited to different types of graph structure and performance needs. It can be integrated with visualization libraries like VivaGraphJS to animate or highlight computed paths in a rendered graph, enabling interactive routing features. Its data structures and algorithm choices are optimized for performance and memory efficiency, so even large meshes or road networks can be navigated interactively. With its standalone design, ngraph.path can be used in browser apps, server-side Node.js services.
Features
- Shortest path algorithms (A*, Dijkstra’s, BFS)
- Weighted and unweighted graph support
- Clean, simple API for building and querying graphs
- Optimized for performance and memory efficiency
- Integrates with graph visualization libraries
- Usable in both browser and Node.js contexts