Can this solution work? Create adjacency matrix where adj[i][j] representing person i doesnt like > person j. Now toggle the relations (means now the adj[i][j] will represent > person i and person j can live with each other) and find the no. of > connected components. No. of connected components will be the number of > rooms required. >
On Sun, May 29, 2011 at 11:29 PM, Aakash Johari <aakashj....@gmail.com>wrote: > yes, sorry.. i misunderstood the problem. > > > On Sun, May 29, 2011 at 11:24 PM, anshu mishra > <anshumishra6...@gmail.com>wrote: > >> biaprtie graph is special case when we can color the whole graph just by >> two colors. >> >> -- >> You received this message because you are subscribed to the Google Groups >> "Algorithm Geeks" group. >> To post to this group, send email to algogeeks@googlegroups.com. >> To unsubscribe from this group, send email to >> algogeeks+unsubscr...@googlegroups.com. >> For more options, visit this group at >> http://groups.google.com/group/algogeeks?hl=en. >> > > > > -- > -Aakash Johari > (IIIT Allahabad) > > > > > -- -Aakash Johari (IIIT Allahabad) -- You received this message because you are subscribed to the Google Groups "Algorithm Geeks" group. To post to this group, send email to algogeeks@googlegroups.com. To unsubscribe from this group, send email to algogeeks+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/algogeeks?hl=en.