Algorithm to find a path connecting given nodes in a graph
Your problem is known as the Steiner tree problem. While this problem is NP-complete, it has efficient constant-factor approximation algorithms.