Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:
Hi
I have a list of jobs which need to be executed according to some dependencies.
for instance @jobs =qw(A B C D E) and
should lead to a possible result:A after D E after B B after C
qw(C B E D A)
How can I solve this in Perl? Unfortunately I cant assign a ranking value for sorting since the job list is very volatile.
And using sort {} didn't help with incomplete dependencies.
Thanks
Axel
|
---|
Replies are listed 'Best First'. | |
---|---|
Re: Sorting by dependencies
by LanX (Saint) on Apr 27, 2013 at 19:07 UTC | |
by Anonymous Monk on Apr 27, 2013 at 21:11 UTC | |
by LanX (Saint) on Apr 27, 2013 at 21:33 UTC | |
Re: Sorting by dependencies
by moritz (Cardinal) on Apr 27, 2013 at 18:51 UTC | |
by tobyink (Canon) on Apr 27, 2013 at 19:12 UTC | |
Re: Sorting by dependencies
by tobyink (Canon) on Apr 27, 2013 at 19:07 UTC | |
by Laurent_R (Canon) on Apr 27, 2013 at 22:19 UTC | |
by choroba (Cardinal) on Apr 27, 2013 at 23:08 UTC | |
by tobyink (Canon) on Apr 28, 2013 at 08:50 UTC | |
by Laurent_R (Canon) on Apr 28, 2013 at 08:43 UTC | |
Re: Sorting by dependencies
by exilepanda (Friar) on Apr 28, 2013 at 05:40 UTC |
Back to
Seekers of Perl Wisdom