Graph::Maker(3pm)
π Graph::Maker π
okay bestie, welcome to Graph::Maker(3pm) β the perl manual page that's literally about making graphs. this is a User Contributed Perl Documentation page, so you know it's giving community-made, handcrafted, artisanal β¨
πΈ NAME πΈ
Graph::Maker β create many types of graphs. that's it, that's the whole vibe. many. types. graphs. π
π VERSION π
Version 0.02 β baby numbers, but she's working π«Ά
π SYNOPSIS π
so basically this is the base class for Graph::Maker::*. the subclasses extend this class and override the init method, and init gets handed the class plus the parameters. and the whole thing rides on Class::Factory. iykyk π
use strict;
use warnings;
use Graph;
use Graph::Maker;
use Graph::Maker::Linear; # or import qw/Graph::Maker/;
my $g = new Graph::Maker('linear', N => 10);
# work with the graph
literally that's all it takes, no cap.
π¦ SUBCLASSING π¦
okay so the simplest example ever is the linear graph β node i is connected to node i+1. that's the whole personality. the implementation can simply be:
package Graph::Maker::Linear;
use strict;
use warnings;
use Carp;
use base qw/Graph::Maker/;
use Graph;
sub init
{
my ($self, %params) = @_;
my $N = delete($params{N});
my $g = new Graph(%params);
$g->add_path(1..$N);
return $g;
}
Graph::Maker->add_factory_type( 'linear' => __PACKAGE__ );
1;
now a real implementation should check that N is defined and is valid (the one provided in this package does, she's thorough π
). and honestly? it is that simple. that's the tea.
π SEE ALSO π
Class::FactoryGraph
π AUTHOR π
Matt Spear, "<batman900+cpan at gmail.com>" β shoutout to the author, icon behavior π
π BUGS π
None at the moment... β¨ manifesting that energy forever β¨
Please report any bugs or feature requests to "bug-graph-maker 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.
like, mutual notif system? we love a two-way street fr fr π«Ά
πΈ ACKNOWLEDGEMENTS πΈ
This package owes a lot to NetworkX <http://networkx.lanl.gov/>, this is something I think is really needed to extend the great Graph module. lowkey iconic of them to say it π
π COPYRIGHT & LICENSE π
Copyright 2008 Matt Spear, all rights reserved.
This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
bestie reminder: free software, same terms as Perl, don't be weird about it π
and that's the page!! this was perl v5.32.1, dated 2021-08-27, and the manual is Graph::Maker(3pm) β go forth and make graphs, main character π¦β¨
π¦ where this page comes from
- debian bookworm: libgraph-maker-perl 0.02-2 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- debian trixie: libgraph-maker-perl 0.02-2 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- ubuntu jammy: libgraph-maker-perl 0.02-2 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- ubuntu noble: libgraph-maker-perl 0.02-2 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- ubuntu resolute: libgraph-maker-perl 0.02-2 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- ubuntu stonking: libgraph-maker-perl 0.02-2 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms