Graph::Maker::Grid(3pm)

Graph::Maker::Grid3pm

Creates a graph in a d-dimensional grid.

Usage

Creates a grid with the specified number of nodes in each dimension.

        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

Version

Version 0.01

Functions

new %params

Creates a grid with the specified number of nodes in each dimension (dims). The recognized parameters are dims (an array reference where the ith element gives the number of nodes in that dimension; all elements have to be positive), graph_maker, cyclic (if true then the grid wraps-around), and any others are passed onto Graph's constructor. If dims is an empty array reference, it returns an empty graph. 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).

Acknowledgements

This package owes a lot to NetworkX.

Releases

Unchanged in 2 releases since Debian 12 (Bookworm).

  1. 12–13

Author

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

Bugs

Please report any bugs or feature requests to "bug-graph-maker-grid at rt.cpan.org", or through the web interface at <http://rt.cpan.org/NoAuth/ReportBug.html?Queue=Graph-Maker>. 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 create a Graph with the parameters specified.

From libgraph-maker-perl 0.02-2 in Debian 13 (Trixie). Parsed by carta from the page's man source.