I\'ve learnt a dynamic programming algorithm to find the \"cheapest\" path from A to B. Each sub path has an associated cost.
Each corner is calculated using
A* is best first and will probably work pretty well for you.