Find maximum people engaged in party

Revision en1, by code_tourist, 2015-07-24 11:32:08

In a party N people are invited. Some person can engage with some other person in party. You are given a matrix of 'Y' and 'N' . If the (i,j) is 'Y' then person i can engage with person j throughout the day and if (i,j) is 'N' then person i cannot engage with person j throughout the day. You have to find maximum number of people engaged in party.

Note : if a person is engaged with other person then he is engaged
whole day. he can't switch in between.

Ex.

N=4
N Y N N
Y N Y Y 
N Y N N
N Y N N  
Ans is = 2 because 2 nd person can engaged with one other person only  (2,1)
or (2,3) or (2,4)

Please help me with some ideas for this question .

Tags algorithms, string, graph

History

 
 
 
 
Revisions
 
 
  Rev. Lang. By When Δ Comment
en1 English code_tourist 2015-07-24 11:32:08 749 Initial revision (published)