Postgraduate Science

Guest · Admin login

Combinatorics & Graph Theory

Counting principles, graphs, and a live breadth-first search.

Combinatorics: counting structured objects.

  • Multiplication / addition principle: total = product (resp. sum) of independent (disjoint) options.
  • Binomial coefficients: $\binom{n}{k} = n! / (k!(n-k)!)$ counts $k$-subsets of an $n$-set.
  • Inclusion–exclusion: $|A \cup B| = |A| + |B| - |A \cap B|$, generalizing to many sets.

A graph $G = (V, E)$ is a pair of vertices and edges. Connectedness, paths, cycles, trees, and bipartiteness are core concepts. Euler's formula for connected planar graphs: $V - E + F = 2$.

Algorithms: BFS explores by layers (shortest path in unweighted graphs); DFS traverses depth-first (used for topological sort, SCCs). Dijkstra extends BFS to non-negative weights; Bellman–Ford handles negative weights.

Interactive: BFS shortest path

Click a vertex to set it as the source; vertices light up as they're visited, with their distance.

Quiz

1. Number of $k$-element subsets of an $n$-element set is:
2. Inclusion-exclusion: $|A \cup B \cup C|$ equals:
3. Euler's formula for a connected planar graph:
4. BFS from a source finds:
5. A tree on $n$ vertices has:
6. A graph is bipartite iff: