Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

DOCS: Fix internal links to other functions in isomorphvf2 #6706

Merged
merged 4 commits into from
Nov 8, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
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