Back to the 2022 paper

Module 1: Introduction

202214m

Write short notes on any two of the following:
(i) Asymptotic Notations
(ii) Clique decision problem
(iii) Max-flow-min-cut theorem
(iv) Union-Find Algorithm

Worked SolutionAI Assisted

Short Notes — Any Two (Covering All Four for Choice)

(i) Asymptotic Notations (see Q36/Q88)

OO upper, Ω\Omega lower, Θ\Theta tight, oo/ω\omega strict. Hierarchy O(1)<O(log⁡n)<O(n)<O(nlog⁡n)<O(n2)<O(2n)O(1)<O(\log n)<O(n)<O(n\log n)<O(n^2)<O(2^n). Used to compare algorithms independent of hardware; max rule for polynomials etc.

(ii) Clique Decision Problem

Given undirected G(V,E)G(V,E) and integer kk, does GG contain a clique (complete subgraph) of size ≥ kk?

  • NP-complete: In NP (certificate = kk vertices, check all (k2)\binom{k}{2} edges in O(k2)O(k^2)) + NP-hard via reduction from 3-SAT or Vertex Cover (complement: GG has clique kk ⇔ complement Gˉ\bar G has vertex cover V−kV-k). Brute O(Vk)O(V^k) exponential; no known polytime.
  • Applications: clustering, social networks.

(iii) Max-Flow Min-Cut Theorem (Ford-Fulkerson)

For network with source ss, sink tt, capacities cc, value of max flow = capacity of min s−ts-t cut (set S∋sS∋s, T∋tT∋t partition, capacity sum of edges S→TS→T). Proof via Ford-Fulkerson: flow maximal iff no augmenting path in residual graph → reachable set from ss defines min cut with equal capacity. Consequences: integrality (if capacities integer, max flow integer), duality for bipartite matching, etc. Used to prove correctness of Ford-Fulkerson O(VE2)O(VE^2) (Edmonds-Karp) etc.

(iv) Union-Find (Disjoint Set Union, DSU) Algorithm

Maintains partition of elements into disjoint sets with operations:

  • MakeSet(x): parent[x]=xparent[x]=x, rank/size 0
  • Find(x): with path compression → O(α(n))O(α(n))
  • Union(x,y): by rank/size → O(α(n))O(α(n))
    Sequence of mm ops on nn elements → O(mα(n))O(mα(n)) almost constant (αα inverse Ackermann <5 for practical nn).
    Uses: Kruskal MST cycle check, connected components, offline LCA. Pseudo:
Find(x): if parent[x]!=x: parent[x]=Find(parent[x]); return parent[x]
Union(a,b): ra=Find(a), rb=Find(b); if ra==rb return; if rank[ra]<rank[rb] swap; parent[rb]=ra; if rank equal rank[ra]++

Similar questions

AI LearningWeb Platform

Coursify — Personal AI Course Generator

Struggling with a difficult subject or concept? Turn any engineering topic into a structured course with interactive lessons, quizzes, and research-backed explanations.