Hi Friend,
OSPF looks for the bandwidth configured on the interface and if not configured then the default bandwidth for that interface.
The shortest path is calculated using the Dijkstra algorithm. The algorithm places each router at the root of a tree and calculates the shortest path to each destination based on the cumulative cost required to reach that destination.
Have a look at this link and it will clear you doubt
http://www.cisco.com/warp/customer/104/1.html#t5
HTH
Ankur
*Pls rate all helpfull post