/*
* (C) Copyright 2015-2017, by Fabian Späh and Contributors.
*
* JGraphT : a free Java graph-theory library
*
* This program and the accompanying materials are dual-licensed under
* either
*
* (a) the terms of the GNU Lesser General Public License version 2.1
* as published by the Free Software Foundation, or (at your option) any
* later version.
*
* or (per the licensee's choosing)
*
* (b) the terms of the Eclipse Public License v1.0 as published by
* the Eclipse Foundation.
*/
package org.jgrapht.alg.isomorphism;
import java.util.*;
import org.jgrapht.*;
/**
* This is an implementation of the VF2 algorithm using its feature of detecting
* subgraph isomorphism between
* two graphs as described in Cordella et al. A (sub)graph isomorphism algorithm for matching
* large graphs (2004), DOI:10.1109/TPAMI.2004.75,
*
* http://ieeexplore.ieee.org/xpl/articleDetails.jsp?arnumber=1323804
*
*
* This implementation of the VF2 algorithm does not support graphs with multiple edges.
*
* @param the type of the vertices
* @param the type of the edges
*/
public class VF2SubgraphIsomorphismInspector
extends VF2AbstractIsomorphismInspector
{
/**
* Construct a new VF2 isomorphism inspector.
*
* @param graph1 the first graph
* @param graph2 the second graph (possible subgraph of graph1)
* @param vertexComparator comparator for semantic equivalence of vertices
* @param edgeComparator comparator for semantic equivalence of edges
* @param cacheEdges if true, edges get cached for faster access
*/
public VF2SubgraphIsomorphismInspector(
Graph graph1, Graph graph2, Comparator vertexComparator,
Comparator edgeComparator, boolean cacheEdges)
{
super(graph1, graph2, vertexComparator, edgeComparator, cacheEdges);
}
/**
* Construct a new VF2 isomorphism inspector.
*
* @param graph1 the first graph
* @param graph2 the second graph (possible subgraph of graph1)
* @param vertexComparator comparator for semantic equivalence of vertices
* @param edgeComparator comparator for semantic equivalence of edges
*/
public VF2SubgraphIsomorphismInspector(
Graph graph1, Graph graph2, Comparator vertexComparator,
Comparator edgeComparator)
{
super(graph1, graph2, vertexComparator, edgeComparator, true);
}
/**
* Construct a new VF2 isomorphism inspector.
*
* @param graph1 the first graph
* @param graph2 the second graph (possible subgraph of graph1)
* @param cacheEdges if true, edges get cached for faster access
*/
public VF2SubgraphIsomorphismInspector(
Graph graph1, Graph graph2, boolean cacheEdges)
{
super(graph1, graph2, null, null, cacheEdges);
}
/**
* Construct a new VF2 isomorphism inspector.
*
* @param graph1 the first graph
* @param graph2 the second graph (possible subgraph of graph1)
*/
public VF2SubgraphIsomorphismInspector(Graph graph1, Graph graph2)
{
super(graph1, graph2, true);
}
@Override
public VF2SubgraphMappingIterator getMappings()
{
return new VF2SubgraphMappingIterator<>(
ordering1, ordering2, vertexComparator, edgeComparator);
}
}
// End VF2SubgraphIsomorphismInspector.java
Ads help maintain this website.