Applied Algorithm III
Applied Algorithm III
Mr Nishankar S
BSc Eng (Hons)
Combinatorial Algorithms
What are Combinatorial Algorithms?
● Key Concepts:
○ Permutations: Ordered arrangements of a set.
○ Combinations: Selections of items without regard to order.
○ Set Partitions: Dividing a set into non-empty subsets.
○ Integer Partitions: Expressing an integer as the sum of positive integers.
○ Trees: Hierarchical structures often represented as graphs.
Generating All instances of Permutations
● Definition:
○ Permutation of n items is any reordering of those items.
● Algorithm Example:
○ Recursive or iterative algorithms for generating all permutations (Heap's Algorithm).
● Example:
○ Permutations of {A, B, C}: ABC, ACB, BAC, BCA, CAB, CBA.
Generating Combinations
● Definition:
○ A combination is a selection of k elements from a set of n elements.
● Algorithm Example:
○ Backtracking or recursive algorithms to generate combinations.
● Example:
○ Combinations of size 2 from {A, B, C}: AB, AC, BC.
Set Partition
● Definition:
○ A set partition divides a set into non-empty, disjoint subsets.
● Algorithm Example:
○ Bell’s number computation for counting partitions.
○ Recursive partitioning algorithm.
● Example:
○ Partitions of {A, B, C}: {{A}, {B, C}}, {{A, B}, {C}}, {{A, C}, {B}}.
Integer Partition
Definition:
Algorithm Example:
Example:
Examples
● Permutations: n!
● Combinations: 2^n
Challenges
Why It Matters
Techniques
Applications
● Graph:
○ A graph is a set of vertices (nodes) connected by edges (links). Graphs can represent various relationships, networks, or
structures.
○ Types of Graphs: Directed, Undirected, Weighted, Unweighted.
● Tree:
○ A tree is a special type of graph that is acyclic and connected. It has a hierarchical structure, with one root node and all
other nodes branching out.
○ Key Property: There is exactly one path between any two nodes in a tree.
Graph Algorithms in Combinatorial Context
Common Problems
Algorithms
Example Problem
Bioinformatics
Cryptography
Logistics
Finance
Advanced Techniques
Discussion
2. Manufacturing
3. Robotics
Input
Output