How can (link - USA Computing Olympiad) be modelled as a shortest path problem?
Problem in Short: Given 2D coordinates of fence locations, laser source and the barn find the minimum no. of mirrors(that are to be mounted on fences) required to send the laser to the barn.
The shortest paths should be in order of the no. of vertices b/w and not the distance I suppose.
I tried using dijkstra's and came up with this http://ideone.com/yNBa6P but this has some faulty logic. (Maybe with the absolute difference part.)