We give an algorithm for determining the distance between two vertices of the complex of curves. While there already exist such algorithms, for example by Leasure, Shackleton, and Webb, our approach is new, simple, and more effective for all distances accessible by computer. Our method gives a new preferred finite set of geodesics between any two vertices of the complex, called efficient geodesics, which are different from the tight geodesics introduced by Masur and Minsky.