Skip to content

Conversation

@anishk85
Copy link
Contributor

This is a memory-efficient grid-based path planning implementation using Fringe Search.

Fringe Search is an informed search algorithm that combines iterative deepening with A*-style heuristics. It maintains a "fringe" of nodes at the search frontier and iteratively explores paths with increasing f-cost thresholds, providing memory efficiency comparable to iterative deepening while maintaining near-optimal performance.

animation

@anishk85
Copy link
Contributor Author

@AtsushiSakai please do have a look at this new algorithm and please do let me know if you need something from my side

@anishk85
Copy link
Contributor Author

also i have raised the pr on animation gif repository

@anishk85
Copy link
Contributor Author

Hi @AtsushiSakai any updates?

@AtsushiSakai
Copy link
Owner

@AtsushiSakai AtsushiSakai requested a review from Copilot October 23, 2025 12:08
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR introduces a new path planning algorithm called Fringe Search, which is a memory-efficient alternative to A* search that combines iterative deepening with heuristic-guided search. The implementation provides optimal path finding on grid maps while using significantly less memory than traditional A*.

Key changes:

  • Implementation of Fringe Search algorithm with visualization support
  • Comprehensive documentation including mathematical foundations and comparisons with A*
  • Integration into the existing path planning module structure

Reviewed Changes

Copilot reviewed 5 out of 6 changed files in this pull request and generated no comments.

Show a summary per file
File Description
PathPlanning/FringeSearch/fringe_search.py Core implementation of the Fringe Search algorithm with grid-based pathfinding
tests/test_fringe_search.py Basic test case for the Fringe Search implementation
docs/modules/5_path_planning/fringeSearch/fringeSearch_main.rst Detailed documentation covering algorithm overview, mathematical foundations, and use cases
docs/modules/5_path_planning/path_planning_main.rst Added reference to Fringe Search documentation in the path planning index
README.md Added Fringe Search section with description and references

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

@AtsushiSakai
Copy link
Owner

@codex review

Copy link

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment on lines +118 to +143
for node in fringe_copy:
node_index = self.calc_index(node)

if node_index not in cache:
continue

_, f_cost, in_fringe = cache[node_index]

if not in_fringe:
continue

# If f-cost exceeds threshold, defer to next iteration
if f_cost > flimit:
fmin = min(f_cost, fmin)
fringe.append(node)
continue

# Goal test
if node.x == goal_node.x and node.y == goal_node.y:
goal_node.parent_index = node.parent_index
goal_node.cost = node.cost
found = True
break

# Mark as visited (remove from fringe)
cache[node_index] = (node, f_cost, False)

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge Avoid closing nodes with stale costs

When a cheaper path to a grid cell is discovered, the cache entry is updated but the older Node object already in fringe_copy is still processed later. The loop then overwrites the cache with that stale node and marks it closed (cache[node_index] = (node, f_cost, False)), discarding the improved parent and g‑cost that had been recorded earlier. This can produce suboptimal paths or even miss the goal whenever the better path is found before the stale entry is expanded. The node fetched from the fringe should be replaced with the cached version or skipped if its cost no longer matches the cached best cost.

Useful? React with 👍 / 👎.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants