Check for Dijkstra's algorithm in classic Graph Theory.
In reply to Re: Brute force vs algorithm (PWC # 100) by hdb in thread Brute force vs algorithm (PWC # 100) by 1nickt