Bridging Pattern-Aware Complexity with NP-Hard Optimization: A Unifying Framework and Empirical Study