- Type Parameters:
V- the type of the vertices
E- the type of the edges
- All Implemented Interfaces:
public class AHUUnrootedTreeIsomorphismInspector<V,E> extends Object implements IsomorphismInspector<V,E>This is an implementation of the AHU algorithm for detecting an (unweighted) isomorphism between two unrooted trees. Please see mathworld.wolfram.com for a complete definition of the isomorphism problem for general graphs.
The original algorithm was first presented in "Alfred V. Aho and John E. Hopcroft. 1974. The Design and Analysis of Computer Algorithms (1st ed.). Addison-Wesley Longman Publishing Co., Inc., Boston, MA, USA."
This implementation runs in linear time (in the number of vertices of the input trees) while using a linear amount of memory.
Note: This inspector only returns a single mapping (chosen arbitrarily) rather than all possible mappings.
- Alexandru Valeanu
All Methods Instance Methods Concrete Methods Modifier and Type Method Description
getMapping()Get an isomorphism between the input trees or
nullif none exists.
getMappings()Get an iterator over all calculated (isomorphic) mappings between two graphs.
isomorphismExists()Check if an isomorphism exists.
AHUUnrootedTreeIsomorphismInspectorConstruct a new AHU unrooted tree isomorphism inspector. Note: The constructor does NOT check if the input trees are valid.
public Iterator<GraphMapping<V,E>> getMappings()Get an iterator over all calculated (isomorphic) mappings between two graphs.
public boolean isomorphismExists()Check if an isomorphism exists.