The traditional* implementation of Dijkstra's does not handle this case well. I think I've come up with some solutions that will work, but they are not particularly elegant**. Is this is a known problem with a standard solution?
This is assuming the non-trivial solution i.e. a path like A->B->C->A rather than just A->A.
* When I say traditional I mean marking each node as visited.
** Storing the number of times each node has been visited and basing the terminating conditions on whether the end node is the start node.