Elon Musk is running the graph construction business. A client has asked for a special graph. A graph is called special if it satisfies the following properties: • It has <105 vertices. It is a simple, undirected, connected 3-regular graph. It has exactly
Elon Musk is running the graph construction business. A client has asked for a special graph. A graph is called special if it satisfies the following properties: • It has <105 vertices. It is a simple, undirected, connected 3-regular graph. It has exactly k bridge edges, (k given as input). For a graph G, define f(G) to be the minimum number of edges to be removed from it to make it bipartite. The client doesn't like graphs with a high value of f, so you have to minimize it. If there doesn't exist any special graph, print –1. Otherwise, find a special graph G with the minimum possible value of f(G) and also find a subset of its edges of size f(G) whose removal makes it bipartite. In case there are multiple such graphs, you can output any of those. Elon has assigned this task to you, now vou have to develon a C++ code that takes bridge edges as innut and print all the possible granhs
Step by step
Solved in 2 steps with 1 images