Data Structures & AlgorithmsVery hardICPC regional · GATE CS
Simple undirected graph on vertices 0 to 5 with edges: 2–3, 4–5, 1–2, 3–4, 3–5, 0–1, 0–2, 2–4, 1–3, 2–5, 1–4. What is the minimum number of edges that must be deleted so that the remaining graph is bipartite?
- A. 6
- B. 2
- C. 4
- D. 3
Correct answer: D. 3
Every odd cycle must lose an edge, and deleting 3 edges is enough and necessary. The cycle rank (6) counts what is needed to make a forest, and the conflicts of one BFS colouring (4) do not give the minimum.
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
- Simple undirected graph on vertices 0 to 6 with edges: 1–3, 1–5, 0–2, 0–3, 2–4, 0–6, 3–6, 3–4, 0–4, 1–4, 5–6. What is the minimum number…
- Simple undirected graph on vertices 0 to 6 with edges: 1–4, 2–5, 1–5, 0–2, 4–5, 3–4, 4–6, 0–5, 2–3, 3–5. What is the minimum number of…
- Simple undirected graph on vertices 0 to 5 with edges: 3–5, 1–4, 1–2, 0–5, 0–3, 2–5, 0–4, 4–5, 1–5. What is the minimum number of edges…
- Simple undirected graph on vertices 0 to 6 with edges: 0–1, 0–4, 4–6, 0–2, 2–4, 3–6, 3–5, 1–6, 3–4, 5–6, 4–5. What is the minimum number…
- Simple undirected graph on vertices 0 to 5 with edges: 0–1, 1–5, 2–5, 1–3, 3–4, 1–4, 3–5, 2–3, 0–4, 2–4, 1–2. What is the minimum number…
- Simple undirected graph on vertices 0 to 6 with edges: 1–6, 0–2, 0–3, 3–4, 1–2, 0–6, 0–1, 5–6, 3–6, 1–4, 2–5. What is the minimum number…