Skip to content

measures

Degree

Bases: AbstractDegree

The total amount of edges coming in or out of the node (in + out)

get_degree(graph)

Computes the degree of a graph

Parameters:

Name Type Description Default
graph Graph

The graph to calculate the measure for.

required

Returns:

Type Description
ndarray

np.array: an array of the degree for each node in the graph

DegreeDiff

Bases: AbstractDegree

The difference between the in_degree and out_degree

get_degree(graph)

Computes the degree difference of a graph

Parameters:

Name Type Description Default
graph Graph

The graph to calculate the measure for.

required

Returns:

Type Description
ndarray

np.array: an array of the degree difference for each node in the graph

InDegree

Bases: AbstractDegree

The number of edges coming into a node

get_degree(graph)

Computes the in degree of a graph

Parameters:

Name Type Description Default
graph Graph

The graph to calculate the measure for.

required

Returns:

Type Description
ndarray

np.array: an array of the in degree for each node in the graph

MaximalCliqueSizes

Bases: GraphMeasure

A graph measure calculating clique sizes of all maximal cliques in a graph.

A maximal clique is a subset of vertices in a graph that forms a clique (where every pair of vertices is directly connected) and cannot be extended by including any additional vertices.

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.

OutDegree

Bases: AbstractDegree

The number of edges coming out of a node

get_degree(graph)

Computes the out degree of a graph

Parameters:

Name Type Description Default
graph Graph

The graph to calculate the measure for.

required

Returns:

Type Description
ndarray

np.array: an array of the out degree for each node in the graph

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)