The relationship "block A can be placed on top of block B defines a partial order on the blocks. You can use Kahn's algorithm (aka "topological sort") to turn this into a total order, which you can then traverse in depth order to find the longest path (I won't spell out the details because this sounds like homework. ).
The relationship "block A can be placed on top of block B" defines a partial order on the blocks. You can use Kahn's algorithm (aka "topological sort") to turn this into a total order, which you can then traverse in depth order to find the longest path. (I won't spell out the details because this sounds like homework.).
All I can think about when I hear that algorithms name is William Shatner uttering "KHANNN! " – GWW Nov 25 '10 at 19:39 +1. Of course, once you recognize that it's just finding the longest path in a partial order (or DAG), there are many algorithms for doing so.
– ShreevatsaR Nov 25 '10 at 20:10 I found LIS for a way to solve the problem. But don't know how to use it correctly. Would someone tell me how can the problem be solved with it?
– Poko Nov 25 '10 at 20:35 I don't see an easy way to transform your problem into the longest increasing subsequence problem, so algorithms to solve the latter will not be of much use to you. – Gareth Rees Nov 25 '10 at 20:42 ok so can you please explain me how to use the algorithms you recommended. I read a lot of times you written but can't rly understand it.
:( – Poko Nov 25 '10 at 20:56.
I cant really gove you an answer,but what I can give you is a way to a solution, that is you have to find the anglde that you relate to or peaks your interest. A good paper is one that people get drawn into because it reaches them ln some way.As for me WW11 to me, I think of the holocaust and the effect it had on the survivors, their families and those who stood by and did nothing until it was too late.