Graph:...orldHK(3pm)
π Graph::Maker::SmallWorldHK π
okay bestie, welcome to the Graph::Maker::SmallWorldHK page β it's part of the User Contributed Perl Documentation and it lives in section 3pm, which is just fancy speak for "a Perl module manpage". Pull up a chair, grab a boba, we're building tiny worlds together. πβ¨
π NAME π
Graph::Maker::SmallWorldHK β creates a small world graph according to Holmea, Beom & Kim. that's it, that's the whole job. iconic. π
β¨ VERSION β¨
Version 0.01 β baby's first release, we love a debut. πΌπ
πΈ SYNOPSIS πΈ
So here's the vibe: this thing creates a small world graph according to Holmea, Beom & Kim's model. A small world graph has an approximate power law degree distribution and a high clustering coefficient. Holmea, Beom & Kim's can be seen as a super-set of the BA model, because it also lets you run a "triangle formation" phase to bump up the clustering coefficient. π§ And heads up: if the graph is directed, edges get added in both directions to create an undirected graph. no half-graphs here, we do it properly. πͺ
use strict;
use warnings;
use Graph;
use Graph::Maker;
use Graph::Maker::SmallWorldHK;
my $g = new Graph::Maker('small_world_hk', N => 10, M => 2, M_0 => 1, PR => 0, undirected => 1); # BA's model
my $g2 = new Graph::Maker('small_world_hk', N => 10, M => 2, M_0 => 1, PR => 0.25, undirected => 1);
# work with the graph
see that comment on the first one? PR => 0 and suddenly it's just BA's model. glow-down to glow-up in one parameter. πβ¨
π¦ FUNCTIONS π¦
π new %params
creates a small world graph with N nodes. it starts off with M_0 nodes, then on each step adds M β which is the minimum number of edges per node β and probalistically does a triangle formation with probability PR, according to the Holmes, Beom & Kim model. π«Ά
the parameters we actually recognize are:
Nβ how many nodes you want. if you don't give it, it defaults to0. (zero nodes. a whole graph of nothing. abstract art, honestly. π)Mβ the minimum number of edges per node. if you don't give it, it defaults to1.M_0β the starting node count. if you don't give it, it defaults toM.PRβ the probability of doing that triangle formation thing. if you don't give it, it defaults to0.graph_makerβ if you specify it, it gets called to create the Graph class however you want (say, if you have a subclass of Graph). by default it just creates a Graph with the parameters you specified.callbackβ lets you simulate the growth of a preferential attachment network. it gets called each time a node is added, so you can watch your little world grow in real time. main character energy fr. π±π
anything else you pass in gets handed straight over to Graph's constructor β it's not ours to police. π
π AUTHOR π
Matt Spear, "<batman900+cpan at gmail.com>". yes the email really has +cpan in it, that's how you know he's a real one. π¦
π BUGS π
found a bug? want a feature? please report it to "bug-graph-maker-smallworldhk at rt.cpan.org", or through the web interface at <http://rt.cpan.org/NoAuth/ReportBug.html?Queue=Graph-Maker>.
and here's the sweet part: he'll be notified, and then you'll automatically be notified of progress on your bug as he makes changes. it's giving mutuals. it's giving accountability. we stan. π«Άβ¨
π 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. πͺ slay.
ngl, that's the whole page. no cap, every last parameter is right there. go forth and make tiny worlds bestie ππ¦
and that's a wrap, babe β perl v5.32.1, dated 2021-08-27. periodt. π
π
π¦ 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