Graph:...::Grid(3pm)
π Graph:...::Grid β the manual, but make it cute
okay bestie, welcome to the User Contributed Perl Documentation for Graph:...::Grid, a module that makes graphs shaped like a d-dimensional grid. yes, the whole thing. no cap. π
β¨ NAME β¨
Graph::Maker::Grid β it creates a graph in a d-dimensional grid. that's it, that's the whole vibe. π¦
πΈ VERSION πΈ
Version 0.01. baby module energy, but iconic.
π SYNOPSIS π
so basically you make a grid with however many nodes you want in each dimension. slay.
use strict;
use warnings;
use Graph;
use Graph::Maker;
use Graph::Maker::Grid;
my $g = new Graph::Maker('grid', dims => [3,4], undirected => 1); # 3 by 4 grid
my $g2 = new Graph::Maker('grid', dims => [3,4], cyclic => 1, undirected => 1); # 3 by 4 grid with wrap-around
# work with the graph
like, $g is your regular 3 by 4 grid, and $g2 is the same thing but with wrap-around so the edges loop back on themselves. main character behavior honestly. π₯
π§ FUNCTIONS π§
π new %params
makes a grid with the number of nodes you asked for in each dimension (dims). here's the tea on the recognized parameters:
dimsβ an array reference. the *i*th element tells you how many nodes live in that dimension. every element has to be positive or it's not gonna happen, bestie. πgraph_makerβ if you specify this, it gets called to create the Graph class however you want (say, if you've got a subclass ofGraph). very custom, very you.cyclicβ if it's true, the grid wraps around. π- everything else β any other params get passed straight on to
Graph's constructor. they're not lost, they're just on a little field trip. β¨
and if dims is an empty array reference? you get an empty graph. nothing. a void. lowkey poetic. π
π AUTHOR π
Matt Spear, <batman900+cpan at gmail.com> π«Ά
π BUGS π
found a bug? need a feature? please report it to bug-graph-maker-grid at rt.cpan.org, or slide through the web interface at <http://rt.cpan.org/NoAuth/ReportBug.html?Queue=Graph-Maker>. do it, i'm begging. π
also, just so you know: if graph_maker is specified it will be called to create the Graph class as desired (for example if you have a subclass of Graph). this defaults to creating a Graph with the parameters specified.
π ACKNOWLEDGEMENTS π
this package owes a lot to NetworkX. respect where respect is due. π
β 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.
and that's the whole page, bestie!! this was perl v5.32.1, dated 2021-08-27, and it's the Graph:...::Grid(3pm) page β go forth and build grids, you absolute icon. mwah. π
πβ¨
π¦ 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