Graph:...partite(3pm)

πŸ’– NAME πŸ’–

Graph::Maker::CompleteBipartite β€” bestie, it literally creates a complete bipartite graph. That's the whole job. Slay. ✨

(Also, this page lives in the Graph:...partite(3pm) section of the perl manual, iykyk πŸŽ€)


🌸 VERSION 🌸

Version 0.01 β€” a lil baby version, but she's iconic πŸ’…


✨ SYNOPSIS ✨

Okay so picture this: you get a complete bipartite graph with N1 nodes chillin' in one set and N2 nodes in the other. πŸ¦‹

A complete bipartite graph is one where the whole thing can be decomposed into two unique sets, and the edges only go between those sets β€” none inside a set, periodt. And every single node in one set is linked to every single node in the other set. Full connectivity, no cap. πŸ”₯

And if the graph is directed? Then edges get added in both directions, which basically turns it into an undirected graph. The way that works is genuinely so cute.

use strict;
use warnings;
use Graph;
use Graph::Maker;
use Graph::Maker::CompleteBipartite;

my (@a, @b);
$g = new Graph::Maker('complete_bipartite', N1 => 5, N2 => 4, undirected => 1);
# work with the graph

πŸŽ€ FUNCTIONS πŸŽ€

πŸ’« new %params

Creates a complete bipartite graph with N1 nodes in the first set and N2 nodes in the second set. She's giving main character energy fr fr.

The parameters she recognizes are:

  • N1 β€” how many nodes go in the first set
  • N2 β€” how many nodes go in the second set
  • graph_maker β€” your custom graph-building hook
  • and literally anything else? πŸ‘€ Those get passed straight onto Graph's constructor, no questions asked.

If N1 or N2 isn't given, they default to 0. (Zero nodes, zero edges, zero drama. A little empty, but valid. 🫢)

If graph_maker is specified, it gets called to create the Graph class β€” super handy if you've got a subclass of Graph you wanna use. Otherwise, it just defaults to creating a Graph with the parameters you specified. Easy. ✨


πŸ‘‘ AUTHOR πŸ‘‘

Matt Spear, "<batman900+cpan at gmail.com>" β€” shoutout to the legend who made this possible πŸ’œ


πŸ’€ BUGS πŸ’€

Found a bug? Got a feature request? Pls don't suffer in silence bestie, report it:

I will be notified, and then you'll automatically be notified of progress on your bug as I make changes. Real ones keep you in the loop. 🌈


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. So go off, remix it, do your thing πŸŽ€


Ok bestie that's the whole page!! Go forth and build bipartite graphs, you absolute genius πŸ’–βœ¨πŸ¦‹

perl v5.32.1 Β· 2021-08-27 Β· and that's the Graph:...partite(3pm) vibe check, we're done here, mwah πŸ’…πŸŽ€

πŸ“¦ where this page comes from