Graph isomorphism
Subgraph match (VF2 algorithm)
MolecularGraph.Graph.edgesubgraphmatch
— Methodedgesubgraphmatch(
G::AbstractGraph, H::AbstractGraph; kwargs...) -> Dict{Int,Int}
Return a edge induced subgraph isomorphism mapping between G
and H
. If no match found, return nothing.
MolecularGraph.Graph.edgesubgraphmatches
— Methodedgesubgraphmatch(G::AbstractGraph, H::AbstractGraph;
nodematcher=(g,h)->true , edgematcher=(g,h)->true,
kwargs...) -> Iterator
Generate edge induced subgraph isomorphism mappings between G
and H
. The returned iterator has ig => ih
pairs that correspond to the indices of matching edges in G
and H
, respectively.
nodematcher
and edgematcher
control the features needed to be counted as a match. atommatch
and bondmatch
can be used to construct these functions.
See MolecularGraph.edgesubgraph
to construct the subgraphs that result from the match.
MolecularGraph.Graph.graphmatch
— Methodgraphmatch(G::AbstractGraph, H::AbstractGraph; kwargs...) -> Dict{Int,Int}
Return an isomorphism mapping between G
and H
. If no match found, return nothing.
MolecularGraph.Graph.graphmatches
— Methodgraphmatches(G::AbstractGraph, H::AbstractGraph; kwargs...) -> Iterator
Generate isomorphism mappings between G
and H
. If no match found, return nothing.
MolecularGraph.Graph.isedgesubgraphmatch
— Methodisedgesubgraphmatch(G::AbstractGraph, H::AbstractGraph; kwargs...) -> Bool
Return true if a node induced subgraph of G
and H
are isomorphic.
MolecularGraph.Graph.isgraphmatch
— Methodisgraphmatch(G::AbstractGraph, H::AbstractGraph; kwargs...) -> Bool
Return true if G
and H
are isomorphic.
MolecularGraph.Graph.issubgraphmatch
— Methodissubgraphmatch(G::AbstractGraph, H::AbstractGraph; kwargs...) -> Bool
Return true if a node induced subgraph of G
and H
are isomorphic.
MolecularGraph.Graph.subgraphmatch
— Methodsubgraphmatch(
G::AbstractGraph, H::AbstractGraph; kwargs...) -> Dict{Int,Int}
Return a subgraph isomorphism mapping between G
and H
. If no match found, return nothing.
MolecularGraph.Graph.subgraphmatches
— Methodsubgraphmatches(G::AbstractGraph, H::AbstractGraph; kwargs...) -> Iterator
Generate subgraph isomorphism mappings between G
and H
.
Keyword arguments
- nodematcher(Function): node matcher function that takes two node indices as
arguments.
- edgematcher(Function): edge matcher function that takes two edge indices as
arguments.
- mandatory(Dict{Int,Int}): mandatory node matches (available for only VF2)
- forbidden(Dict{Int,Int}): forbidden node matches (available for only VF2)
Maximum common subgraph (Clique detection based algorithm)
MolecularGraph.Graph.findmces
— Methodfindmces(G::UndirectedGraph, H::UndirectedGraph; kwargs...
) -> Tuple{Dict{Int,Int},Symbol}
Compute maximum common edge induced subgraph between G
and H
.
MolecularGraph.Graph.findmcis
— Methodfindmcis(G::UndirectedGraph, H::UndirectedGraph; kwargs...
) -> Tuple{Dict{Int,Int},Symbol}
Compute maximum common induced subgraph between G
and H
.
Keyword arguments:
- connected(Bool): if true, apply connected MCS constraint.
- topological(Bool): if true, apply topological constraint.
- diameter(Int): distance cutoff for topological constraint.
- tolerance(Int): distance mismatch tolerance for topological constraint.
- timeout(Int): abort calculation and return suboptimal results so far if the
execution time has reached the given value (default=60, in seconds).
- targetsize(Int): abort calculation and return suboptimal result so far if the
given mcs size achieved.
- nodematcher(Function): node matcher function that takes two node indices as
arguments.
- edgematcher(Function): edge matcher function that takes two edge indices as
arguments.
MolecularGraph.Graph.mcessize
— Methodmcessize(G::AbstractGraph, H::AbstractGraph; kwargs...) -> Int
Return the maximum common edge induced subgraph size (number of edges).
MolecularGraph.Graph.mcissize
— Methodmcissize(G::AbstractGraph, H::AbstractGraph; kwargs...) -> Int
Return the maximum common induced subgraph size (number of nodes).