Data Structures & AlgorithmsVery hardGATE CS · Advanced
In a bipartite graph the left vertices are L1–L6 and the right vertices are R1–R6, with the edges L1–R3, L1–R5, L1–R6, L2–R3, L3–R2, L3–R5, L4–R3, L4–R4, L5–R2, L5–R4, L6–R5. What is the size of a minimum vertex cover?
- A. 4
- B. 5
- C. 6
- D. 7
Correct answer: B. 5
By Konig's theorem the minimum vertex cover equals the maximum matching, found by augmenting paths: 5. The greedy matching (first free neighbour for each left vertex in order) only reaches 4, and 6 would need a perfect matching.
Practise more Trees, Graphs, Recursion and Dynamic Programming questionsTrees, Graphs, Recursion and Dynamic Programming: notes and key points
More Trees, Graphs, Recursion and Dynamic Programming questions
- Dijkstra's algorithm (a vertex is settled when removed from the priority queue and its distance is never changed afterwards) is run from A…
- A directed graph on the vertices A–E has the arcs C→B, C→A, B→C, B→E, B→A, D→E, E→B, E→A, A→C, A→B, A→D. Every vertex has equal in-degree…
- Every node of a binary tree has either 0 or 2 children. Its preorder traversal is W S M Q R P K Z T and its postorder traversal is Q R M K…
- A graph has the vertices A–G and the edges A–B, A–C, A–D, B–D, B–F, B–G, C–D, C–F, C–G, D–F, E–F. In how many ways can the vertices be…
- Floyd-Warshall is run on a directed graph with vertices 1-6 and arcs (weights): 1→2 (9), 1→3 (8), 1→4 (8), 1→5 (1), 2→5 (3), 2→6 (8), 3→1…
- A flow network has source S = A and sink T = G (vertices A–G) with arcs and capacities: A→D (1), A→E (6), A→G (6), B→C (2), B→E (5), C→F…