KyoMel / Yogyakarta, Indonesia

Term 261261 / 344

BFS Distance Field

Month
June 2026
Day
22
Source
2026/june-term.md

Definition:

  • Distance field: grid where each cell contains distance to nearest obstacle
  • BFS (Breadth-First Search) algorithm to compute this field
  • Used in pathfinding, collision detection, shadow mapping
  • Key properties:
    • Euclidean distance (true straight-line distance)
    • Signed distance (negative inside obstacles)
    • Smooth gradients (useful for interpolation)

Example:

Visualization of BFS distance field computation:
  - Obstacle grid (walls, trees)
  - Wavefront propagation from obstacles
  - Final distance field (heatmap)

Key Concepts:

  • BFS guarantees shortest path in unweighted grid
  • Distance field enables efficient spatial queries

Keep reading