Optimizes an Activity and Pattern Diagram (APD)