Package org.graph4j.isomorphism
Class AbstractGraphIsomorphism
java.lang.Object
org.graph4j.isomorphism.AbstractGraphIsomorphism
- All Implemented Interfaces:
GraphIsomorphism
- Direct Known Subclasses:
UllmanExactGraphIsomorphism,UllmanSubGraphIsomorphism,VF2ExactGraphIsomorphism,VF2SubGraphIsomorphism
Abstract class for finding the isomorphism between two graphs.
It provides a method for finding all the mappings between two graphs and a method for finding the first mapping.
- Author:
- Ignat Gabriel-Andrei
-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionAbstractGraphIsomorphism(Graph g1, Graph g2) AbstractGraphIsomorphism(Graph g1, Graph g2, boolean cache) Constructor for the AbstractGraphIsomorphism class. -
Method Summary
Modifier and TypeMethodDescriptionbooleanChecks if the two graphs are isomorphic by computing the first mapping, if it exists.protected abstract Stateprotected abstract StategetStateInstance(Digraph g1, Digraph g2, boolean cache)
-
Field Details
-
dg1
-
dg2
-
cache
protected final boolean cache
-
-
Constructor Details
-
AbstractGraphIsomorphism
Constructor for the AbstractGraphIsomorphism class.- Parameters:
g1- the first graph - it is converted to a digraphg2- the second graph - it is converted to a digraphcache- if true, the algorithm will cache the successors, predecessors, the adjacency relations
-
AbstractGraphIsomorphism
-
-
Method Details
-
areIsomorphic
public boolean areIsomorphic()Checks if the two graphs are isomorphic by computing the first mapping, if it exists.- Specified by:
areIsomorphicin interfaceGraphIsomorphism- Returns:
- true if the graphs are isomorphic, false otherwise
-
getMapping
- Specified by:
getMappingin interfaceGraphIsomorphism- Returns:
- the first mapping between the two graphs, if it exists.
-
getAllMappings
- Specified by:
getAllMappingsin interfaceGraphIsomorphism- Returns:
- all the mappings between the two graphs.
-
getStateInstance
-
getNewStateInstance
-