### Silence_for_Melody's blog

By Silence_for_Melody, history, 11 months ago, ,

Hi, I would like to know if there is some algorithm to solve the following problem, or maybe it is NP.

Given a bipartite graph of at most 200 nodes in each side, I need to color the minimum number of nodes so each node is colored or has a colored neighbor. The colored nodes could be in any side.

•
• +16
•

 » 11 months ago, # |   +16 Your intuition is correct: see herehttps://pdfs.semanticscholar.org/ffe1/b723a0cd0319e5ad326088163acf1eed3d9c.pdf
•  » » 11 months ago, # ^ |   0 Thanks!
•  » » 11 months ago, # ^ | ← Rev. 2 →   +8 Doesn't König's theorem: https://en.wikipedia.org/wiki/K%C5%91nig%27s_theorem_(graph_theory)#Statement_of_the_theorem allow for a solution in P? Or am I missing something? What is the difference between vertex cover and this problem?
•  » » » 11 months ago, # ^ | ← Rev. 2 →   +5 Dominating set and vertex cover are substantially different problems. If you take a path on 6 vertices then second and fifth vertex form dominating set, but they do not form vertex cover (because middle edge is not covered). You can also take triangle, DS=1 and VC=2 there.
•  » » » » 11 months ago, # ^ | ← Rev. 2 →   0 Yeah, sorry. I forgot/misremembered the definition of vertex cover.
 » 11 months ago, # |   0 Isn't it the same problem as finding the minimum vertex cover of the graph? but on a bipartite graph?
 » 11 months ago, # |   0 Answering question from title: for every testcase our search space is compact (because it is fine it's), so answer is yes, there is an optimal solution for every testcase.And for this post to not be completely useless, if I'm not mistaken this problem is NP-complete. I will show a sketch why it is at least as hard as SET COVER. If we consider such problem as you stated but so that only vertices from one side need to be covered then it is exactly set cover. Coming back to original problem we can create one additional vertex on that side that needs to be covered and connect it to all vertices from second side. Maybe up to details, optimal solution takes that additional vertex and optimal set cover from second side.