Each area will calculate the best path of a destination network using the SPF algorithm and the topology database. It creates a tree, where the router is the center, or root, and all other networks are arranged as the branches and leaves of that tree. The SPF is used to insert the routing information into the routing table. It's good to know that if you have multiple areas, then you have multiple trees. OSPF then needs to calculate the best path to a different area or routing domain.
Also, OSPF uses cost as its metric, which the SPF will provide. The faster the link, the lower the cost, which would mean the slower, the link the higher the cost. But, you can always override the calculation by using the ip ospf cost command, which has a range of 1-65,535.