Skip to content

Commit

Permalink
Can now graph 'best' networks.
Browse files Browse the repository at this point in the history
  • Loading branch information
jgamble committed Apr 6, 2016
1 parent 40a9e39 commit 8a6a096
Show file tree
Hide file tree
Showing 3 changed files with 36 additions and 3 deletions.
12 changes: 11 additions & 1 deletion eg/eps.pl
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
use Getopt::Long;
use Algorithm::Networksort;
use Algorithm::Networksort::Best qw(:all);

use strict;
use warnings;
Expand All @@ -13,6 +14,7 @@
foreground => undef,
);
my $alg = 'bosenelson';
my($nw, $best);

GetOptions('compbegin=s' => \$colorset{compbegin},
'compend=s' => \$colorset{compend},
Expand All @@ -22,11 +24,19 @@
'inputline=s'=> \$colorset{inputline},
'foreground=s' => \$colorset{foreground},
'algorithm=s' => \$alg,
'best=s' => \$best,
);

my $inputs = $ARGV[0] || 8;

my $nw = nwsrt(inputs => $inputs, algorithm => $alg);
if (defined $best)
{
$nw = nwsrt_best(name => $best);
}
else
{
$nw = nwsrt(inputs => $inputs, algorithm => $alg);
}

$nw->colorsettings(%colorset);

Expand Down
15 changes: 14 additions & 1 deletion eg/svg.pl
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
use Getopt::Long;
use Algorithm::Networksort;
use Algorithm::Networksort::Best qw(:all);

use strict;
use warnings;
Expand All @@ -11,8 +12,10 @@
inputend => undef,
inputline => undef,
foreground => undef,
background => undef,
);
my $alg = 'bosenelson';
my($nw, $best);

GetOptions('compbegin=s' => \$colorset{compbegin},
'compend=s' => \$colorset{compend},
Expand All @@ -21,12 +24,22 @@
'inputend=s' => \$colorset{inputend},
'inputline=s'=> \$colorset{inputline},
'foreground=s' => \$colorset{foreground},
'background=s' => \$colorset{background},
'algorithm=s' => \$alg,
'best=s' => \$best,
);

my $inputs = $ARGV[0] || 8;

my $nw = nwsrt(inputs => $inputs, algorithm => $alg);
if (defined $best)
{
$nw = nwsrt_best(name => $best);
}
else
{
$nw = nwsrt(inputs => $inputs, algorithm => $alg);
}


$nw->colorsettings(%colorset);

Expand Down
12 changes: 11 additions & 1 deletion eg/text.pl
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
use Getopt::Long;
use Algorithm::Networksort;
use Algorithm::Networksort::Best qw(:all);

use strict;
use warnings;
Expand All @@ -12,6 +13,7 @@
inputline => undef,
);
my $alg = 'bosenelson';
my($nw, $best);

GetOptions(
'compbegin=s' => \$txtset{compbegin},
Expand All @@ -21,11 +23,19 @@
'inputend=s' => \$txtset{inputend},
'inputline=s' => \$txtset{inputline},
'algorithm=s' => \$alg,
'best=s' => \$best,
);

my $inputs = $ARGV[0] || 8;

my $nw = nwsrt(inputs => $inputs, algorithm => $alg);
if (defined $best)
{
$nw = nwsrt_best(name => $best);
}
else
{
$nw = nwsrt(inputs => $inputs, algorithm => $alg);
}

#
# Ensure we're only passing in set parameters. And, if it's defined
Expand Down

0 comments on commit 8a6a096

Please sign in to comment.