Skip to content

feat(pathfinding): Add Greedy Best-First Search Algorithm #84

Description

@Sanan507

Overview

Add Greedy Best-First Search to the Pathfinding Arena. Unlike A* which balances path cost g(n) + heuristic h(n), Greedy BFS relies solely on the Manhattan distance heuristic h(n), providing a fast but non-optimal search for educational contrast.

Implementation Details & File Reference

  • Algorithm Model: Create backend/src/main/java/com/algorithmrace/visualizer/algorithms/pathfinding/GreedyBFSModel.java extending PathfindingModel.
    • Use priority queue ordered strictly by heuristic distance h(cell, end).
  • Factory Registration: Add "Greedy Best-First" in PathfindingFactory.java.
  • Complexity Catalog: Add entry in ComplexityCatalog.java highlighting non-optimality.
  • Frontend Metadata: Add entry in frontend/src/data/algorithmMetadata.ts (complete: false, optimal: false).

Definition of Done

  • Greedy Best-First Search appears in the Pathfinding Arena selector.
  • Visually demonstrates aggressive target-seeking movement that can get trapped by obstacles.
  • Metadata indicates optimal: false.

Skill Level

Good first issue — straightforward heuristic priority queue implementation.

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions