Graph isomorphism

Subgraph match (VF2 algorithm)

MolecularGraph.Graph.edgesubgraphmatch — Method
edgesubgraphmatch(
    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.

source
MolecularGraph.Graph.edgesubgraphmatches — Method
edgesubgraphmatch(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.

source
MolecularGraph.Graph.graphmatch — Method
graphmatch(G::AbstractGraph, H::AbstractGraph; kwargs...) -> Dict{Int,Int}

Return an isomorphism mapping between G and H. If no match found, return nothing.

source
MolecularGraph.Graph.graphmatches — Method
graphmatches(G::AbstractGraph, H::AbstractGraph; kwargs...) -> Iterator

Generate isomorphism mappings between G and H. If no match found, return nothing.

source
MolecularGraph.Graph.subgraphmatch — Method
subgraphmatch(
    G::AbstractGraph, H::AbstractGraph; kwargs...) -> Dict{Int,Int}

Return a subgraph isomorphism mapping between G and H. If no match found, return nothing.

source
MolecularGraph.Graph.subgraphmatches — Method
subgraphmatches(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)
source

Maximum common subgraph (Clique detection based algorithm)

MolecularGraph.Graph.findmces — Method
findmces(G::UndirectedGraph, H::UndirectedGraph; kwargs...
    ) -> Tuple{Dict{Int,Int},Symbol}

Compute maximum common edge induced subgraph between G and H.

source
MolecularGraph.Graph.findmcis — Method
findmcis(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.

source
MolecularGraph.Graph.mcessize — Method
mcessize(G::AbstractGraph, H::AbstractGraph; kwargs...) -> Int

Return the maximum common edge induced subgraph size (number of edges).

source