Search code examples
algorithmmachine-learningsearchgraphartificial-intelligence

Search algorithm when target is unknown


Am creating an underwater submarine that has to search a pool for targets that are in unknown locations. Is there any algorithm that could be used in this case specifically. I read a bout A* but that seems to only be useful in identifying shortest path when the starting location and target location are known. A DFS also seems to apply for the same scenario.

Is there any way to do this without traversing the entire pool?


Solution

  • Imagine the body of water your submarine traverses to be a graph with cells in it.

    Do you have any heuristics for your search algorithm (an approximate measure of how close you are to the target)?

    For example, the target could be more likely to be in deeper waters or you might see the target on a camera.

    If you have some heuristic, you could do a Dijkstra's algorithm, which is like Breadth-First Search (BFS) for weighted graphs. Then, you explore nodes in increasing order of cost from the starting point. Your priority would be cost from source, if you haven't explored it yet, and approximate cost to explore.

    Other than that, I don't really (with the little information given) see a way to do it other than a BFS, DFS, as in exploring every single cell in some order until you find the target.

    Of course, all of this changes depending on the inputs you have from your submarine. Maybe your submarine can see or sense (temperature change, sound, radio signal, who knows, etc.) the target!