networkx 2.8.2 Pypi GitHub Homepage
Other Docs
semantic_feasibility(self, G1_node, G2_node)

The semantic feasibility function should return True if it is acceptable to add the candidate pair (G1_node, G2_node) to the current partial isomorphism mapping. The logic should focus on semantic information contained in the edge data or a formalized node class.

By acceptable, we mean that the subsequent mapping can still become a complete isomorphism mapping. Thus, if adding the candidate pair definitely makes it so that the subsequent mapping cannot become a complete isomorphism mapping, then this function must return False.

The default semantic feasibility function always returns True. The effect is that semantics are not considered in the matching of G1 and G2.

The semantic checks might differ based on the what type of test is being performed. A keyword description of the test is stored in self.test. Here is a quick description of the currently implemented tests:

test='graph'
  Indicates that the graph matcher is looking for a graph-graph
  isomorphism.

test='subgraph'
  Indicates that the graph matcher is looking for a subgraph-graph
  isomorphism such that a subgraph of G1 is isomorphic to G2.

test='mono'
  Indicates that the graph matcher is looking for a subgraph-graph
  monomorphism such that a subgraph of G1 is monomorphic to G2.

Any subclass which redefines semantic_feasibility() must maintain the above form to keep the match() method functional. Implementations should consider multigraphs.

Returns True if adding (G1_node, G2_node) is symantically feasible.

Examples

See :

Local connectivity graph

Hover to see nodes names; edges to Self not shown, Caped at 50 nodes.

Using a canvas is more power efficient and can get hundred of nodes ; but does not allow hyperlinks; , arrows or text (beyond on hover)

SVG is more flexible but power hungry; and does not scale well to 50 + nodes.

All aboves nodes referred to, (or are referred from) current nodes; Edges from Self to other have been omitted (or all nodes would be connected to the central node "self" which is not useful). Nodes are colored by the library they belong to, and scaled with the number of references pointing them


GitHub : /networkx/algorithms/isomorphism/isomorphvf2.py#321
type: <class 'function'>
Commit: