logo
Free, unlimited AI code reviews that run on commit
git-lrc git-lrc GitHub Install Now We'd appreciate a star git-lrc - Free, unlimited AI code reviews that run on commit | Product Hunt git-lrc - Free, unlimited AI code reviews that run on commit | Product Hunt

Graph::Maker::Utils - Small routines that Graph::Maker::* uses.

Acknowledgements

       This package owes a lot to NetworkX.

Author

       Matt Spear, "<batman900+cpan at gmail.com>"

Bugs

       Please report any bugs or feature requests to "bug-graph-maker-smallworldws at rt.cpan.org", or through
       the web interface at <http://rt.cpan.org/NoAuth/ReportBug.html?Queue=Graph-Maker>.  I will be notified,
       and then you'll automatically be notified of progress on your bug as I make changes.

Export

       Nothing by default, specify any set of functions, or :all to import everything.

Functions

cartesian_product$g,$h
       Creates a new graph that is the cartesian product of $g and $h.  For example, the cartesian product of
       two linear graphs is a grid graph.

   is_valid_degree_seq@seq
       Tests if @seq is a valid degree sequence, that is if it can be used to generate a graph.  This is mainly
       used in other Graph::Maker packages.

Name

       Graph::Maker::Utils - Small routines that Graph::Maker::* uses.

Synopsis

       Some utility functions for Graphs.

               use strict;
               use warnings;
               use Graph::Maker;
               use Graph::Maker::Linear;
               use Graph::Maker::Utils qw/is_valid_degree_seq cartesian_product/;

               my @seq = (2, 1, 1);
               my $bool = is_valid_degree_seq(@seq); # returns true
               my @se2 = (2, 1, 1, 1)
               my $boo2 = is_valid_degree_seq(@se2); # returns false

               my $g1 = new Graph::Maker('linear', N => 10);
               my $g2 = new Graph::Maker('linear', N => 10);
               my $g = cartesian_product($g1, $g2); # returns the 2-dimensional plane

Version

       Version 0.02

See Also