|laziness, impatience, and hubris|
Task scheduling using perlby a_ashokkumar (Initiate)
|on Aug 18, 2005 at 13:27 UTC||Need Help??|
a_ashokkumar has asked for the
wisdom of the Perl Monks concerning the following question:
Hi, I have the following problem at hand:
There are a set of tasks some of which are dependent on others. I have the input file that looks like:
Task1 Task2 Task3
Task2 Task2 Task4
Task3 Task1 Task4
Task5 Task2 Task3
Basically, the first element on any line is the task that is dependent on the remaining tasks mentioned in the line. For eg., Task1 is dependent on Task2 & Task3 & so on.
I am supposed to read the file contents & resolve the dependencies between the tasks & come up with a list that has the least dependent task first & the most dependent task at the end of the list.
Is there a simple PERL way of sequencing the tasks?