Package org.graph4j.isomorphism
Class UllmanSubState
java.lang.Object
org.graph4j.isomorphism.AbstractState
org.graph4j.isomorphism.AbstractUllmanState
org.graph4j.isomorphism.UllmanSubState
- All Implemented Interfaces:
State
Class for the Ullman algorithm for exact graph isomorphism. Two vertices are
compatible if the degree in the first graph is less than or equal to the
degree in the second graph.
- Author:
- Ignat Gabriel-Andrei
-
Field Summary
Fields inherited from class org.graph4j.isomorphism.AbstractUllmanState
COMPATIBLE, M, prev_1, prev_2 -
Constructor Summary
ConstructorsConstructorDescriptionUllmanSubState(Digraph g1, Digraph g2) UllmanSubState(Digraph g1, Digraph g2, boolean cache) -
Method Summary
Modifier and TypeMethodDescriptionbooleanexactOrSubgraphIsomorphismCompatibilityCheck(int vertexIndex1, int vertexIndex2) For exact isomorphism, two vertices are compatible if the degree in the first graph is less than or equal to the degree in the second graph.booleanisDead()A partial mapping is "dead" if there is a vertex from the first graph that has no compatible vertex in the second graph.booleanisGoal()For subgraph isomorphism, a mapping is complete when all vertices from the first graph are mapped.Methods inherited from class org.graph4j.isomorphism.AbstractUllmanState
addPair, backTrack, existsCandidateNeighbourInSecondGraph, getCandidates, isFeasiblePair, nextPair, resetPreviousVerticesMethods inherited from class org.graph4j.isomorphism.AbstractState
compatibleEdges, compatibleVertices, getCoreLen, getMapping
-
Constructor Details
-
UllmanSubState
-
UllmanSubState
-
UllmanSubState
-
-
Method Details
-
exactOrSubgraphIsomorphismCompatibilityCheck
public boolean exactOrSubgraphIsomorphismCompatibilityCheck(int vertexIndex1, int vertexIndex2) For exact isomorphism, two vertices are compatible if the degree in the first graph is less than or equal to the degree in the second graph.- Specified by:
exactOrSubgraphIsomorphismCompatibilityCheckin classAbstractUllmanState- Parameters:
vertexIndex1- the index of the vertex in the first graph (in the list of vertices ordered by degree)vertexIndex2- the index of the vertex in the second graph (in the list of vertices ordered by degree)- Returns:
trueif the vertices are compatible, false otherwise.
-
isGoal
public boolean isGoal()For subgraph isomorphism, a mapping is complete when all vertices from the first graph are mapped.- Specified by:
isGoalin interfaceState- Specified by:
isGoalin classAbstractUllmanState- Returns:
trueif the current state is complete.
-
isDead
public boolean isDead()A partial mapping is "dead" if there is a vertex from the first graph that has no compatible vertex in the second graph.- Specified by:
isDeadin interfaceState- Specified by:
isDeadin classAbstractUllmanState- Returns:
trueif the current state is dead.
-