From Incomplete Preferences to Ranking via Optimization