Data Structures & AlgorithmsVery hardGATE CS · Codeforces Div 2 C
A bipartite graph has left vertices 0 to 4 and right vertices 0 to 4. Its edges, as (left, right) pairs in this listed order, are: (1,4), (3,4), (1,3), (1,2), (2,4), (3,2), (4,2), (4,3), (2,3), (4,1), (0,3), (1,1). What is the size of a maximum matching (largest set of edges with no shared endpoint)?
- A. 4
- B. 3
- C. 5
- D. 12
Correct answer: A. 4
Augmenting paths give a maximum matching of size 4. Taking edges greedily in listed order stops at 3, which is a maximal but not maximum 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
- A bipartite graph has left vertices 0 to 3 and right vertices 0 to 4. Its edges, as (left, right) pairs in this listed order, are: (2,3)…
- A bipartite graph has left vertices 0 to 3 and right vertices 0 to 3. Its edges, as (left, right) pairs in this listed order, are: (3,0)…
- A bipartite graph has left vertices 0 to 2 and right vertices 0 to 2. Its edges, as (left, right) pairs in this listed order, are: (1,2)…
- A bipartite graph has left vertices 0 to 2 and right vertices 0 to 2. Its edges, as (left, right) pairs in this listed order, are: (2,2)…
- A bipartite graph has left vertices 0 to 3 and right vertices 0 to 3. Its edges, as (left, right) pairs in this listed order, are: (0,0)…
- A bipartite graph has left vertices 0 to 4 and right vertices 0 to 3. Its edges, as (left, right) pairs in this listed order, are: (1,1)…