Complexity analysis and its application