NetworkX

Previous topic

generic_node_match

Next topic

generic_multiedge_match

generic_edge_match

generic_edge_match(attr, default, op)

Returns a comparison function for a generic attribute.

The value(s) of the attr(s) are compared using the specified operators. If all the attributes are equal, then the constructed function returns True.

Parameters :

attr : string | list

The edge attribute to compare, or a list of edge attributes to compare.

default : value | list

The default value for the edge attribute, or a list of default values for the edge attributes.

op : callable | list

The operator to use when comparing attribute values, or a list of operators to use when comparing values for each attribute.

Returns :

match : function

The customized, generic

System Message: WARNING/2 (edge_match)

latex exited with error: [stderr] [stdout] This is pdfTeX, Version 3.1415926-2.5-1.40.13 (TeX Live 2013/dev) restricted \write18 enabled. entering extended mode (./math.tex LaTeX2e <2011/06/27> Babel <v3.8m> and hyphenation patterns for english, dumylang, nohyphenation, lo aded. (/usr/share/texlive/texmf-dist/tex/latex/base/article.cls Document Class: article 2007/10/19 v1.4h Standard LaTeX document class (/usr/share/texlive/texmf-dist/tex/latex/base/size12.clo)) (/usr/share/texlive/texmf-dist/tex/latex/base/inputenc.sty (/usr/share/texlive/texmf-dist/tex/latex/ucs/utf8x.def)) (/usr/share/texlive/texmf-dist/tex/latex/ucs/ucs.sty (/usr/share/texlive/texmf-dist/tex/latex/ucs/data/uni-global.def)) (/usr/share/texlive/texmf-dist/tex/latex/amsmath/amsmath.sty For additional information on amsmath, use the `?’ option. (/usr/share/texlive/texmf-dist/tex/latex/amsmath/amstext.sty (/usr/share/texlive/texmf-dist/tex/latex/amsmath/amsgen.sty)) (/usr/share/texlive/texmf-dist/tex/latex/amsmath/amsbsy.sty) (/usr/share/texlive/texmf-dist/tex/latex/amsmath/amsopn.sty)) (/usr/share/texlive/texmf-dist/tex/latex/amscls/amsthm.sty) (/usr/share/texlive/texmf-dist/tex/latex/amsfonts/amssymb.sty (/usr/share/texlive/texmf-dist/tex/latex/amsfonts/amsfonts.sty)) (/usr/share/texlive/texmf-dist/tex/latex/tools/bm.sty) ! LaTeX Error: File `preview.sty’ not found. Type X to quit or <RETURN> to proceed, or enter new name. (Default extension: sty) Enter file name: ! Emergency stop. <read *> l.12 \begin {document}^^M No pages of output. Transcript written on math.log.

function.

Examples

>>> from operator import eq
>>> from networkx.algorithms.isomorphism.matchhelpers import close
>>> from networkx.algorithms.isomorphism import generic_edge_match
>>> nm = generic_edge_match('weight', 1.0, close)
>>> nm = generic_edge_match('color', 'red', eq)
>>> nm = generic_edge_match(['weight', 'color'], [1.0, 'red'], [close, eq])