This documents the development version of NetworkX. Documentation for the current release can be found here.


numerical_edge_match(attr, default, rtol=1e-05, atol=1e-08)

Returns a comparison function for a numerical edge attribute.

The value(s) of the attr(s) must be numerical and sortable. If the sorted list of values from G1 and G2 are the same within some tolerance, then the constructed function returns True.

  • attr (string | list) – The numerical edge attribute to compare, or a list of numerical edge attributes to compare.

  • default (value | list) – The default value for the numerical edge attribute, or a list of default values for the numerical edge attributes.

  • rtol (float) – The relative error tolerance.

  • atol (float) – The absolute error tolerance.


match – The customized, numerical edge_match function.

Return type



>>> import networkx.algorithms.isomorphism as iso
>>> nm = iso.numerical_edge_match("weight", 1.0)
>>> nm = iso.numerical_edge_match(["weight", "linewidth"], [0.25, 0.5])