achhadahappy's blog

By achhadahappy, history, 20 months ago, In English

I solved the problem by taking the maximum weight first and then further checking if one more child can be fit into the same gondola. As per the question, atmost 2 children can only sit in one gondola but I was thinking if this constraint was not present then will the same solution work i.e first try to make sit all the heavy weights children till weight does not exceed x and then add new children of small weights till we did not exceed the limit. I am confused will the same solution will work or not Question link

  • Vote: I like it
  • 0
  • Vote: I do not like it

»
20 months ago, # |
  Vote: I like it 0 Vote: I do not like it

Auto comment: topic has been updated by achhadahappy (previous revision, new revision, compare).

»
20 months ago, # |
Rev. 2   Vote: I like it 0 Vote: I do not like it

It does not: the resulting problem is NP-Complete (see for example Job Shop Scheduling).

»
20 months ago, # |
  Vote: I like it 0 Vote: I do not like it

Ohh, I was unaware that the new problem is an NP problem. Thanks, I learned something new applepi216