Due to continue with informed search algorithms with a* search, but we needed to cover the Dijkstra's algorithm first. We mentioned it several times but it is better to describe it clearly first. We will add other routing algorithms later but will go back to the informed algorithms with A* search next. That's the plan.
@alexandrbihun7210
7 ай бұрын
UCS is optimal though
@DrCodie
7 ай бұрын
It is always stated as optimal, but is it implemented as optimal, is it bidirectional? Online it is said to be optimal on conditions, for example, these are quotes: ''Yes, “optimal” shortest paths are found by best-first search algorithms as long as they use an admissible heuristics', and, 'The condition was that every step cost should be positive. It can never be zero or negative. Only then the algorithm is optimal.' So not zero or negative values and the heuristic can not overestimate. I hope this clarifies the optimal statement.
@alexandrbihun7210
7 ай бұрын
@@DrCodieUCS doesnt rely on a heuristic function thought. it chooses the next node to expand only in regards to the so called g-cost, which is the shortest distance found from start so far. It always chooses the node with the lowest g-cost, meaning it always finds the optimal path to every node, otherwise there would exist a better path and it would instead explore that path first. Yes, UCS is an algorithm of the best first search class, because it chooses which node to expand according to some function f (f(n) = g(n) in this case), but it is not an informed algorithm, it doesnt have any addition information about the goal. Obviously UCS doesnt work on graphs with negative weights, but the same also applies to Dijkstra's. I think your implementation of UCS must be wrong, because it produces non-optimal results. I recommend looking into that. Also, in your comparisons of the two algorithms (in this video and in the video on UCS) you always implied that Dijkstra's is actually superior to UCS. Well you should reconsider that also, on large graph UCS works much better in practice, because it doesnt require the whole priority queue to be filled with nodes whose g-cost is infinity. Instead in only has to remeber the neighbors of already explored nodes.
@DrCodie
7 ай бұрын
Interesting comments and I would be happy to make a new video to clarify the points you raise. This is not the most effective implementation of UCS so it would be interesting to test the versions available to users. This is down to how the UCS algorithm is stopped, I quote ‘It depends on the stopping condition. If the stopping condition is "stop as soon as any vertex is encountered by both the forward and backward scan", then bidirectional uniform-cost search is not a correct algorithm -- it is not guaranteed to output the optimal path’[1]. ‘UCS is a variant of Dijkstra’s Algorithm’ is the first sentence in the first result on a Google search (see [2]) and UCS is often taught as a simpler version because Dijkstra’s algorithm is ‘better-known’ [3]. Perhaps as Dijkstra’s Algorithm looks for the costs of all nodes it is considered superior, although, UCS has less space requirements. Finally, UCS does not reply on a heuristic function - correct. As your comment was on the Dijkstra Algorithm video, when I mentioned the drawback of negative values I was thinking about this example of the Dijkstra’s Algorithm (see 14:00 kzitem.info/news/bejne/uXhqs32bsZynjGU ) not UCS. I would say if I had not been clear or if it is in any way confusing or misleading then this should rectified. If you have a working knowledge of UCS then any important information that you feel should be highlighted please let me know. I would be happy to raise your matters, highlight any benefits of the UCS algorithm you suggest, compare online versions and make clear that the issues mentioned in previous videos are related to the implementation rather than the algorithm itself. Thank you again for your comments. Sources: [1] www.geeksforgeeks.org/uniform-cost-search-dijkstra-for-large-graphs/ [2] ai.stackexchange.com/questions/24494/if-uniform-cost-search-is-used-for-bidirectional-search-is-it-guaranteed-the-so [3] stackoverflow.com/questions/12806452/whats-the-difference-between-uniform-cost-search-and-dijkstras-algorithm
Пікірлер: 5