Optimal Algorithms for Ranked Enumeration of Answers to Full Conjunctive Queries