When I run Dijkstra and A* on different graphs, because both are optimal algorithms, I should always expect to find the same path, right?
Like for the following graph:
Nodes: S, A, B,C, D, E, G
Edges and costs: (S, A)=1, (A, B)=1 (B,C)=1, (A,E)=8, (A, D)=6, (D, G)=2
heuristics: h(S)=6, h(C)=7, h(B)=6, h(A)=5, h(D)=2, h(E)=1, h(G)=0
I am finding S->A->D->G as path for both. The cost of this path is 9 for both Dijkstra and A*.
Is this always the case for any graph because both are optimal? If I want to compare these two algorithms, what should I use as statistics, time seems to be the same as well?
Thanks.