unit2
unit2
Here's a structured overview of the fundamental algorithmic strategies with examples like Bin
Packing, Knapsack, and Travelling Salesman Problem (TSP), along with a note on heuristics and their
characteristics:
🔹 1. Brute-Force Approach
Definition: Tries all possible solutions and selects the best one.
Characteristics:
Guarantees correctness.
Examples:
🔹 2. Greedy Algorithm
Definition: Makes the best choice at each step, hoping for a global optimum.
Characteristics:
Fast and simple.
Optimal substructure.
Overlapping subproblems.
Examples:
0/1 Knapsack: Use a DP table to track max value for capacities.
Characteristics:
Used for optimization problems.
Examples:
🔹 5. Backtracking
Definition: Builds solution incrementally and abandons a path if it violates constraints.
Characteristics:
Uses recursion.
🔹 Heuristics
Definition: Rule-of-thumb techniques to find good-enough solutions efficiently.
Characteristics:
Printed using ChatGPT to PDF, powered by PDFCrowd HTML to PDF API. 2/3
Application Domains:
When to Use:
NP-Hard problems.
Would you like a summarized table comparing all these strategies and their performance on Knapsack,
TSP, and Bin Packing?
Printed using ChatGPT to PDF, powered by PDFCrowd HTML to PDF API. 3/3