Combinatorics Problems That Needs Algorithms¶
Demonstrated in C++
Why Writing Algorithms?¶
Prove correctness of your solution using math
Too hard to solve using math
When we want to see the solution in addition to the count
Typical Approaches¶
Strategy: Other algorithmic paradigms
Enumeration problems
Simple enumeration: brute force, backtracking
With overlapping sub-problems: dynamic programming
Optimization problems (Combinatorial optimization)
Dynamic programming may apply when the problem has overlapping subproblems and the required substructure.
A greedy algorithm may apply when a greedy-choice argument establishes that local choices produce the requested optimum.
Neither overlap nor its absence alone determines that greedy is suitable.
Heuristic algorithms: simulated annealing, genetic algorithm, etc.
Linear programming