Constraint-Based Mining of Episode Rules and Optimal