Skip to content

graph_components

GraphComponents

Bases: GraphMeasure, ABC

Calculates the sizes of the weakly and strongly connected components of a graph.

A connected component is a subset of a graph's vertices where each pair of vertices is connected by a path; it is called strongly connected if the paths respect edge direction and weakly connected if edge direction is ignored.

compute(graph)

Compute graph measure and add it as a property to the graph.

Parameters:

Name Type Description Default
graph Graph

The graph to calculate the measure for.

required

Returns:

Name Type Description
Graph ndarray

the graph with the measure computed.

get_component_type(nk_alg) abstractmethod

StrongComponents

Bases: GraphComponents

Calculates the sizes of the strongly connected components of a graph.

get_component_type(nk_alg)

WeakComponents

Bases: GraphComponents

Calculates the sizes of the weakly connected components of a graph.

get_component_type(nk_alg)