Beefy Boxes and Bandwidth Generously Provided by pair Networks
XP is just a number
 
PerlMonks  

Re^2: Sorting by dependencies

by tobyink (Abbot)
on Apr 27, 2013 at 19:12 UTC ( #1031005=note: print w/ replies, xml ) Need Help??


in reply to Re: Sorting by dependencies
in thread Sorting by dependencies

Personally I'd go with Graph over Sort::Topological...

use v5.12; use Graph; my @jobs = "A" .. "J"; my @rules = ( [qw/ A C /], # A before C [qw/ D B /], # D before B [qw/ J F /], # J before F [qw/ E J /], # E before J [qw/ I B /], # I before B ); my $g = "Graph"->new; $g->add_vertex($_) for @jobs; $g->add_edge(@$_) for @rules; say for $g->topological_sort;
package Cow { use Moo; has name => (is => 'lazy', default => sub { 'Mooington' }) } say Cow->new->name


Comment on Re^2: Sorting by dependencies
Download Code

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://1031005]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others surveying the Monastery: (15)
As of 2015-07-02 17:14 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The top three priorities of my open tasks are (in descending order of likelihood to be worked on) ...









    Results (44 votes), past polls