Solving Complex Labeling Problems