Utility functions to weight the edges of a graph

WeightFunction

Members:

weight_graph(graph, vertex_weights, …)

Compute the edge weights of a graph using source and target vertices values and specified weighting function (see WeightFunction enumeration).

class WeightFunction

Members:

mean

min

max

L0

L1

L2

L_infinity

L2_squared

source

target

L0 = <WeightFunction.L0: 3>
L1 = <WeightFunction.L1: 4>
L2 = <WeightFunction.L2: 5>
L2_squared = <WeightFunction.L2_squared: 7>
L_infinity = <WeightFunction.L_infinity: 6>
max = <WeightFunction.max: 2>
mean = <WeightFunction.mean: 0>
min = <WeightFunction.min: 1>
property name
source = <WeightFunction.source: 8>
target = <WeightFunction.target: 9>
property value
weight_graph(graph, vertex_weights, weight_function)[source]

Compute the edge weights of a graph using source and target vertices values and specified weighting function (see WeightFunction enumeration).

Parameters:
  • graph – input graph

  • vertex_weights – vertex weights of the input graph

  • weight_function – see WeightFunction

Returns:

edge weights of the graph