# Finding path with minimum weight

There is a river which can be considered as an infinitely long straight line with width W.

There are A piles on the river, and B types of wooden disks are available. The location of the $i$-th pile is $(X_i, Y_i)$.

The $i$-th type of wooden disks has radius $R_i$, and its price is $C_i$ per disk.

Disks can be placed on the river such that for each wooden disk, its center must be one of the locations $(X_i, Y_i)$ of piles. We can only move on the wooden disks.

How to find the minimum cost such that we can cross the river.I am unable to approach questions like these. What would be the best method to approach this one?

I have come to realize that we can use Dijkstra's algorithm here. We treat this as a graph, with piles as the nodes. Start point can be $y=0$. and $y=W$ as the end point. But i am having implementation problems. There are multiple disks which can be used in going from on state to another. How to handle this?

• How many wooden disk do you have (for each type)? infinite? – user742 Aug 14 '13 at 13:54
• This question seems like it is missing something. So, you've got i piles, and you can pick up a disk from any pile, but then you have to place it centered on a pile? You can't spread them out from there, or drop them anywhere that touches another pile? What if the shortest distance between any two piles is greater than two of the largest disk available? Are we guaranteed a solution? – Nobbynob Littlun Aug 15 '13 at 1:17