Optimization of ordered sets