Closed ethanjweiner closed 3 years ago
Ideas:
We have access to a list of all the routers, the destination, and the path travelled so far. How can we move one step closer to the destination?
Use some searching algorithm to help with this (e.g. BFS?)
Idea:
Research search algorithms for disconnected graphs
Spatial indices: Ways to arrange geometric data for efficient search -- e.g. find all the routers in this area
e.g. Organizing all the points into boxes such that we can use a tree-like data structure to recursively zoom in on boxes that touch the point of interest.
We will not be using spatial indices, since we aren't dealing with a ton of data -- we can use the more naive approaches of looping through all points.
However, we can maybe create something similar in practice. At the very least, we could label the continent that each router is located in.
Idea: Use a BFS (breadth-first-search like algorithm):
Heuristic: Distance from destination
We can tweak this algorithm (e.g. add more randomness; change router cap) as we go. But this seems like a good starting point. I'd rather introduce randomness/chaos, than start with chaos in the beginning.
Consider setting up a playground for testing these routing functions . . .
Potential edge case: The destination is isolated from other routers. Problem: The routers will simply keep jumping back and forth between each one. Solution: Avoiding circular cases --- at first, the algorithm will jump to the closest neighbors. But once those neighbors become part of the path, they can no longer be added to the path --- and so the algorithm will instead search in a further radius --- and try to find the destination.
Task Title
Task: Implement route() method of the Router class
Task Description
This Task will...
Epic Parent
Feature: Awesome Feature Title