Graph::MoreUtils(3pm)
π 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
- debian trixie: libgraph-moreutils-perl 0.3.0-1 Β· LGPL-3.0-only
- ubuntu resolute: libgraph-moreutils-perl 0.3.0-1 Β· LGPL-3.0-only
- ubuntu stonking: libgraph-moreutils-perl 0.3.0-1 Β· LGPL-3.0-only
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms