gridfind 1.0.2 copy "gridfind: ^1.0.2" to clipboard
gridfind: ^1.0.2 copied to clipboard

path finding algorithms for 2D grid and graph

Gridfind #

Pub Version Pub Points Pub Likes Pub Popularity License: MIT

Gridfind is a Dart package that provides a collection of pathfinding algorithms for both 2D grids and graphs. It is designed to be easy to use.

Features #

Grid-Based Pathfinding #

  • BFS
  • DFS
  • Dijkstra's Algorithm
  • A* Algorithm
  • Diagonal Movement Support: Option to allow diagonal movement in grid-based pathfinding.

Graph-Based Pathfinding #

  • BFS
  • Dijkstra's Algorithm
  • A* Algorithm

Examples #

import 'package:gridfind/gridfind.dart';

void main() {
  final start = GridPoint(2, 3);
  final target = GridPoint(7, 6);
  const width = 10;
  const height = 18;
  final grid = List.generate(width, (_) => List.generate(height, (_) => GridNode.idle));
  var state =  GridAstarState.init(start, target, grid, false);
  final path = GridAstar().solve(state);

  print(path?.map((e) => e).join(' -> '));
}

Contributing #

Contributing is not currently possible.

This will change in the future.

License #

This project is licensed under the MIT License.

0
likes
120
points
37
downloads

Publisher

unverified uploader

Weekly Downloads

path finding algorithms for 2D grid and graph

Repository (GitHub)

Documentation

API reference

License

MIT (license)

Dependencies

collection

More

Packages that depend on gridfind