I beg to differ for what most of the answers say. While I wouldn't expect a programmer of any level to be able to come up by himself on Dijkstra's algorithm, I definitely would expect him to come up with any way (efficient or not) to solve the problem.
For example, you said as a side comment that you were able to come up with bubble sort on your own. I know its the stinkiest of sorting algorithms, but you found a way to solve a problem, and that's what I do expect programmers to be able to: find a way to solve problems.
Of course, investigating and finding solutions done by others also work, but the extreme of that point is a guy that does not think of himself and whose programs are a compendium of Google searches.
I think I'm sounding harsher than I actually want to, but my point is: I would expect a programmer to be creative enough to come up with a solution to a problem, even if the solution is buggy or messy.
So, coming back to your case, I don't think you should have to come up with Dijkstra's algorithm, but if you have the ability to write an algorithm to try out several possibilities and find the shortest path without ending on a infinite loop, then you've got my approval.
(BTW my approval counts in the same order of importance as a free car wash coupon.)