Graph:...partite(3pm)
β¨ Graph:...partite(3pm) β bestie edition β¨
okay so real talk: this is User Contributed Perl Documentation, and the page you're holding is Graph:...partite(3pm). It's giving "I make bipartite graphs and I'm lowkey obsessed with degree sequences." Let's get into it π
πΈ NAME πΈ
Graph::Maker::Bipartite β creates a bipartite graph with a given distribution. That's it, that's the whole name. Short, sweet, iconic.
π VERSION π
Version 0.01. Baby version, but she's doing her best π«Ά
π¦ SYNOPSIS π¦
So here's the vibe: it creates a bipartite graph with the distributions you hand it. A bipartite graph is one where you can split it into two unique sets and the edges only ever go between the sets β never inside one set, we don't do that here. And if the graph is directed? Then edges get added in both directions to make it undirected. Balance, harmony, etc β¨
use strict;
use warnings;
use Graph;
use Graph::Maker;
use Graph::Maker::Bipartite;
my (@a, @b);
@a = (2); @b = (1,1);
$g = new Graph::Maker('bipartite', N1 => 5, N2 => 4, seq1 => [@a], seq2 => [@b], undirected => 1);
@a = (2,3,1,2,1); @b = (2,2,1,3,1);
$g2 = new Graph::Maker('bipartite', seq1 => [@a], seq2 => [@b]);
@a = (2,3,1,2,1); @b = (2,2,1,3,1);
$g3 = new Graph::Maker('bipartite', seq1 => [@a], seq2 => [@b], strict => 1, undirected => 1);
# This distribution cannot be satisfied and the resulting graph will be incorrect
@a = (2); @b = (2);
eval {
$g = new Graph::Maker('bipartite', N1 => 5, N2 => 4, seq1 => [@a], seq2 => [@b], undirected => 1);
};
# $@ has a message informing the graph could not be constructed
# work with the graph
not me just casually showing you a distribution that literally cannot be satisfied and the resulting graph will be incorrect β that's the drama, bestie, we keep the receipts π
π FUNCTIONS π
π new %params
Creates a bipartite graph with the given distributions (seq1 and seq2 respectively), with sets of size N1 and N2 respectfully. (Respectfully. Say it back.)
The recognized parameters are:
graph_makerN1N2seq1seq2
Anything else? Passed straight onto Graph's constructor. She's flexible like that π
Okay now the deets, because this part actually matters:
- If
N1is not given, it's assumed to be the length ofseq1. Same deal forN2withseq2. - If
N1(N2) is greater thanseq1(seq2), then the remaining values are assumed to be zero. - If
strictis set, it uses a deterministic algorithm to ensure β if possible β the correct degree distribution. Otherwise, it is not guaranteed that it will have the exact distribution you specified. Read that again. Not guaranteed. π« - If
graph_makeris specified, it gets called to create theGraphclass as desired (say, if you've got a subclass ofGraph). Defaults to creating aGraphwith the parameters specified.
β οΈ big one: it will croak ifstrictis turned on and it's unable to create a graph with the given degree sequences. The message is exactly:"Could not build a graph with the requested sequences (seq1), (seq2)". No cap.
π AUTHOR π
Matt Spear, "<batman900+cpan at gmail.com>" β shoutout to Matt, the main character who wrote this π«Ά
π BUGS π
Quite possibly, but hopefully not. (The most honest sentence in all of CPAN, honestly π)
Please report any bugs or feature requests to "bug-graph-maker-randombipartite 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. Bestie accountability chain, love to see it β¨
π 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, periodt π
This absolute icon of a doc page was generated by perl v5.32.1 on 2021-08-27 β so if you're reading this, hi, you're part of the lore now π¦π
π¦ 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