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 of Graph). 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 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