Graph::MoreUtils(3pm)

πŸ“¦
version 0.3.0 Β· 2 versions
, in debian trixie, ubuntu resolute, ubuntu stonking

πŸ’– NAME πŸ’–

Graph::MoreUtils β€” utilities for graphs ✨

okay so basically, bestie, this is a little grab-bag of graph goodies 🫢


✨ SYNOPSIS ✨

use Graph::MoreUtils qw( line );
use Graph::Undirected;

my $G = Graph::Undirected->new;

# Greate graph here

# Get line graph for $G:
my $L = line( $G );
yes it says Greate. that's the original, verbatim, we do not touch it. πŸŽ€

πŸ“ SSSR( $graph, $max_depth )

Finds the Smallest Set of Smallest Rings (SSSR) in Graph objects. so it should lowkey work with literally any Graph::Undirected object πŸ‘‘ The code is largely taken from the cod-tools package (https://wiki.crystallography.net/cod-tools/).

The algorithm returns a superset of minimum cycle basis of a graph, because it wants deterministic results and honestly? iconic behaviour. As a result it does not succumb to the counterexample of oxabicyclo[2.2.2]octane (https://depth-first.com/articles/2020/08/31/a-smallest-set-of-smallest-rings/, section "SSSR and Uniqueness") β€” it ate that up fr fr πŸ’… The algorithm has means to control the maximum size of rings included in the SSSR to reduce its complexity. The default value of undef stands for no limit 🌈


πŸ¦‹ graph_replace( $graph, $new, @old )

Replaces one or more vertices (@old) in the graph with a given one ($new). All edges between the replaced vertices get removed, and all edges with other vertices become a reconnected to the new one. glow-up arc for your vertices πŸ’œ


🌸 line( $graph )

Generates line graphs for Graph objects ✨ Line graph is constructed nondestructively and returned from the call β€” your original graph stays untouched, main character energy. Both simple and multiedged, undirected and directed graphs are supported 🌈

Call accepts an additional options hash. Currently only one option is supported, loop_end_vertices, which treats the input graph as having self-loops on pendant vertices β€” that is, increasing the degrees of vertices having degrees of 1. Thus they are not "lost" during line graph construction πŸ₯Ί In the resulting line graph these self-loops are represented as instances of Graph::MoreUtils::Line::SelfLoopVertex.

⚠️ heads up bestie: this does not work with directed graphs yet. not yet. someday. πŸ™ˆ

🧚 smooth( $graph )

Smooths the given graph by collating vertices of degree 2. sleek. glossy. periodt πŸ’…


πŸ’œ SEE ALSO πŸ’œ


πŸ‘‘ AUTHORS πŸ‘‘

  • Andrius Merkys, <merkys@cpan.org>

and that's the whole page, bestie!! πŸŽ€ this was perl v5.40.0, dated 2025-01-02, and it's the Graph::MoreUtils(3pm) page from the User Contributed Perl Documentation. go forth and graph, you got this πŸŒŸπŸ’–

πŸ“¦ where this page comes from