Efficient Algorithm for CSP Selection Based on Three-Level Architecture