Exhaustive Search and Naive Algorithm
Exhaustive Search and Naive Algorithm
• Systematic Exploration
• Guarantees a Solution Simple
• Implementation
• Time-Consuming
Algorithm
c 7 d
Efficiency:
Applications
Example 2: Knapsack Problem
Given n items:
– weights: w1 w2 … wn
– values: v1 v2 … vn
– a knapsack of capacity W
Find most valuable subset of the items that fit into the
knapsack
Efficiency: Θ(2^n)
Each subset can be represented by a binary string (bit vector, Ch 5).
Applications
Example 3: The Assignment Problem
9 2 7 8
6 4 3 7
C=
5 8 1 8
7 6 9 4
(
Time Complexity
• O(n!×n)
Applications
Challenges and Alternatives to
Exhaustive Search
• Computational Complexity
• Non-Uniformity in Complex Spaces
• Boundary Issues
• Limited to Point-Based Analysis
• Sensitivity to Point Distribution
Applications
Naiva String-Matching Algorithm