Skip to main content

Module operators

Module operators 

Source
Expand description

Graph operators (ALGO-OP-*). Phase 1: simplify (remove loops and/or parallel edges, returning a new crate::Graph).

Structs§

BipartiteProjection
Result of a bipartite projection.
BipartiteProjectionSize
Sizes of both bipartite projections.
EvenTarjanResult
Result of the Even-Tarjan reduction.
InducedSubgraphResult
Result of an induced subgraph extraction.
ResidualGraphResult
Result of the residual graph computation.
SubgraphFromEdgesResult
Result of a subgraph-from-edges extraction.

Enums§

GraphProductType
Selects which graph product type to compute.
RewireDirectedMode
Which endpoint of a directed edge to rewire.
ToDirectedMode
Mode for converting an undirected graph to directed.
ToUndirectedMode
Mode for converting a directed graph to undirected.

Functions§

bipartite_projection
Project a bipartite graph onto one of its vertex types.
bipartite_projection_size
Compute sizes of both bipartite projections without building them.
cartesian_product
Computes the Cartesian product of two graphs.
complementer
Returns the complementer of graph.
compose
Computes the composition of two graphs.
connect_neighborhood
Returns a new graph where each vertex is connected to all vertices reachable within order steps in the original graph.
contract_vertices
Contracts vertices according to a grouping, merging edges.
difference
Returns orig \ sub: the multiset difference of the edges.
disjoint_union
Returns the disjoint union of left and right.
disjoint_union_many
Disjoint union of any number of graphs (ALGO-OP-002b).
even_tarjan_reduction
Compute the Even-Tarjan reduction of a graph.
graph_power
Returns the k-th power of a graph as a simple graph.
graph_product
Computes a graph product selected by product_type.
induced_subgraph
Creates the subgraph induced by the specified vertices.
induced_subgraph_edges
Returns the IDs of edges whose both endpoints lie in vids.
intersection
Returns the intersection of left and right.
intersection_many
Returns the intersection of multiple graphs.
invert_permutation
Invert a permutation vector.
is_same_graph
Returns true iff g1 and g2 are identical as labelled graphs: same vertex count, same directedness, same edge multiset. Edges differing only in storage order (or, for undirected, in endpoint orientation) are treated as identical.
join
Creates the join of two graphs.
lexicographic_product
Computes the lexicographic product of two graphs.
line_graph
Construct the line graph L(G) of the input graph.
modular_product
Computes the modular product of two graphs.
permute_vertices
Creates a new graph with vertices permuted according to the given mapping.
residual_graph
Compute the residual graph given capacity and flow vectors.
reverse
Returns a new graph with all edge directions reversed.
reverse_edges
Returns a new graph with only the specified edges reversed.
reverse_residual_graph
Compute the reverse-residual graph given capacity and flow vectors.
rewire
Randomly rewires a graph while preserving its degree sequence.
rewire_directed_edges
Rewires one endpoint of directed edges with constant probability.
rewire_edges
Rewires graph edges with constant probability.
rooted_product
Computes the rooted product of two graphs.
simplify
Return a copy of graph with self-loops and/or parallel edges removed.
strong_product
Computes the strong product of two graphs.
subgraph_from_edges
Create a subgraph containing only the specified edges.
tensor_product
Computes the tensor (categorical/direct) product of two graphs.
to_directed
Converts an undirected graph to a directed graph.
to_undirected
Converts a directed graph to an undirected graph.
union
Returns the union of left and right.
union_many
Returns the union of multiple graphs.