Skip to main content

Module utils

Module utils 

Source
Expand description

Graph utility functions. Utility functions for graph operations

Functionsยง

count_connected_components
Count the number of connected components in an undirected graph.
deserialize_graph
Deserialize a graph from JSON format.
get_in_out_degrees
Get the in-degree and out-degree of each node in a directed graph.
get_node_degrees
Get the degree (number of edges) of each node in an undirected graph.
get_reachable_nodes
Get all nodes reachable from a given source node.
graphs_equal
Compare two graphs for structural equality.
has_cycle
Check if a graph contains any cycles.
is_strongly_connected
Check if a directed graph is strongly connected.
serialize_graph
Serialize a graph to JSON format.
to_dot
Generate a DOT format representation of the graph for visualization with Graphviz.