Skip to content

Commit

Permalink
DOCS: Fix internal links to other functions in isomorphvf2 (networkx#…
Browse files Browse the repository at this point in the history
…6706)

* DOCS: Fix internal links to other functions in isomorphvf2
  • Loading branch information
MridulS authored and cvanelteren committed Apr 22, 2024
1 parent 567929d commit b3dfa6f
Showing 1 changed file with 34 additions and 29 deletions.
63 changes: 34 additions & 29 deletions networkx/algorithms/isomorphism/isomorphvf2.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,9 @@
An implementation of VF2 algorithm for graph isomorphism testing.
The simplest interface to use this module is to call networkx.is_isomorphic().
The simplest interface to use this module is to call the
:func:`is_isomorphic <networkx.algorithms.isomorphism.is_isomorphic>`
function.
Introduction
------------
Expand All @@ -21,9 +23,10 @@
as the logical AND of the two functions.
To include a semantic check, the (Di)GraphMatcher class should be
subclassed, and the semantic_feasibility() function should be
redefined. By default, the semantic feasibility function always
returns True. The effect of this is that semantics are not
subclassed, and the
:meth:`semantic_feasibility <networkx.algorithms.isomorphism.GraphMatcher.semantic_feasibility>`
function should be redefined. By default, the semantic feasibility function always
returns ``True``. The effect of this is that semantics are not
considered in the matching of G1 and G2.
Examples
Expand Down Expand Up @@ -65,43 +68,44 @@
Graph theory literature can be ambiguous about the meaning of the
above statement, and we seek to clarify it now.
In the VF2 literature, a mapping M is said to be a graph-subgraph
isomorphism iff M is an isomorphism between G2 and a subgraph of G1.
Thus, to say that G1 and G2 are graph-subgraph isomorphic is to say
that a subgraph of G1 is isomorphic to G2.
In the VF2 literature, a mapping `M` is said to be a graph-subgraph
isomorphism iff `M` is an isomorphism between `G2` and a subgraph of `G1`.
Thus, to say that `G1` and `G2` are graph-subgraph isomorphic is to say
that a subgraph of `G1` is isomorphic to `G2`.
Other literature uses the phrase 'subgraph isomorphic' as in 'G1 does
not have a subgraph isomorphic to G2'. Another use is as an in adverb
for isomorphic. Thus, to say that G1 and G2 are subgraph isomorphic
is to say that a subgraph of G1 is isomorphic to G2.
Other literature uses the phrase 'subgraph isomorphic' as in '`G1` does
not have a subgraph isomorphic to `G2`'. Another use is as an in adverb
for isomorphic. Thus, to say that `G1` and `G2` are subgraph isomorphic
is to say that a subgraph of `G1` is isomorphic to `G2`.
Finally, the term 'subgraph' can have multiple meanings. In this
context, 'subgraph' always means a 'node-induced subgraph'. Edge-induced
subgraph isomorphisms are not directly supported, but one should be
able to perform the check by making use of nx.line_graph(). For
able to perform the check by making use of
:func:`line_graph <networkx.generators.line.line_graph>`. For
subgraphs which are not induced, the term 'monomorphism' is preferred
over 'isomorphism'.
Let G=(N,E) be a graph with a set of nodes N and set of edges E.
Let ``G = (N, E)`` be a graph with a set of nodes `N` and set of edges `E`.
If G'=(N',E') is a subgraph, then:
N' is a subset of N
E' is a subset of E
If ``G' = (N', E')`` is a subgraph, then:
`N'` is a subset of `N` and
`E'` is a subset of `E`.
If G'=(N',E') is a node-induced subgraph, then:
N' is a subset of N
E' is the subset of edges in E relating nodes in N'
If ``G' = (N', E')`` is a node-induced subgraph, then:
`N'` is a subset of `N` and
`E'` is the subset of edges in `E` relating nodes in `N'`.
If G'=(N',E') is an edge-induced subgraph, then:
N' is the subset of nodes in N related by edges in E'
E' is a subset of E
If `G' = (N', E')` is an edge-induced subgraph, then:
`N'` is the subset of nodes in `N` related by edges in `E'` and
`E'` is a subset of `E`.
If G'=(N',E') is a monomorphism, then:
N' is a subset of N
E' is a subset of the set of edges in E relating nodes in N'
If `G' = (N', E')` is a monomorphism, then:
`N'` is a subset of `N` and
`E'` is a subset of the set of edges in `E` relating nodes in `N'`.
Note that if G' is a node-induced subgraph of G, then it is always a
subgraph monomorphism of G, but the opposite is not always true, as a
Note that if `G'` is a node-induced subgraph of `G`, then it is always a
subgraph monomorphism of `G`, but the opposite is not always true, as a
monomorphism can have fewer edges.
References
Expand All @@ -120,7 +124,8 @@
See Also
--------
syntactic_feasibility(), semantic_feasibility()
:meth:`semantic_feasibility <networkx.algorithms.isomorphism.GraphMatcher.semantic_feasibility>`
:meth:`syntactic_feasibility <networkx.algorithms.isomorphism.GraphMatcher.syntactic_feasibility>`
Notes
-----
Expand Down

0 comments on commit b3dfa6f

Please sign in to comment.