Graph:...::Disk(3pm)

πŸ’Ώ Graph::Maker::Disk πŸ’Ώ

okay bestie, so this is Graph::Maker::Disk, and it lives in the User Contributed Perl Documentation corner of the perl-verse (it's a 3pm page, so it's a module manual, iykyk 🫢).


✨ NAME ✨

Graph::Maker::Disk β€” it creates a graph with nodes positioned in concentric connected rings. literally rings inside rings inside rings. it's giving ripples in a pond πŸ¦‹


🌸 VERSION 🌸

Version 0.01 β€” baby's first release, no cap πŸ’…


πŸŽ€ SYNOPSIS πŸŽ€

So what it actually does: it creates a disk graph with init nodes on the first cycle, and disks total cycles. A disk graph is an extension of a wheel (and a wheel is just a disk where disks=1, so like, the humble beginnings ✨) wherein there is a central node, then init node, then 2*init nodes, ... all the way out to 2**disks*init nodes, where each node on an inner cycle connects to 2 nodes on the outer cycle. and if the graph is directed? edges get added in both directions so you end up with an undirected graph. we love a plot twist 😌

use strict;
use warnings;
use Graph;
use Graph::Maker;
use Graph::Maker::Disk;

my $g = new Graph::Maker('disk', disks => 4, init => 3);
my $arr = $g->get_vertex_attribute(1, 'pos");
print "@$arr\n"; # prints out 0 0
# work with the graph

Because disk graphs are generally associated with geometry, the pos attribute is set for each node, specifying their position (node 1 is at (0,0) and the distance between nodes is 1 unit). coordinates?? in my graph?? it's more likely than you think πŸ‘‘


πŸ”₯ FUNCTIONS πŸ”₯

πŸ’œ new %params

Creates a disk graph with init nodes on the first cycle, and disks total cycles. the required parameters are graph_maker, disks and init (and note the rule: init >= 2 || init == 0 β€” read it, memorise it, respect it πŸ’…). any other params get passed straight onto Graph's constructor, no questions asked.

  • if disks is not given it defaults to 0.
  • if init is not given it defaults to 0.
  • the vertex attribute pos will be set to an array reference of the node's d-dimensional position. yes, d-dimensional. main character geometry πŸ¦‹
  • 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), and this defaults to creating a Graph with the parameters specified.

πŸ‘‘ AUTHOR πŸ‘‘

Matt Spear, "<batman900+cpan at gmail.com>" β€” say thank you to Matt 🫢


πŸ’€ BUGS πŸ’€

Please report any bugs or feature requests to bug-graph-maker-disk 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. so like, you're not screaming into the void, the void will text you back fr fr 😭


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.


quick vibe check bestie: this page is perl v5.32.1, dated 2021-08-27, and it's the Graph:...::Disk(3pm) page. go forth and build ur rings, ur disk, ur whole geometric situation. slay πŸ’–βœ¨πŸŽ€
πŸ“¦ where this page comes from