graph
Class Invariant

java.lang.Object
  |
  +--graph.Invariant

public class Invariant
extends java.lang.Object

Constructs numerical hashes for a graph G in such a way that it is relatively easy to detect graph isomorphisms. The main method is Isomorphic, which determines whether two graphs (wrapped as Invariant objects) are isomorphic. This method either produces a graph bijection or does an exhaustive search proving that no such bijection can exist.

The name of the class comes from the fact that the hashes are constructed as invariants of the isomorphism class of the graph.

The isomorphisms can be orientation reversing, and the private variables keep track of the mirror image of graph, to aid in determining orientation-reversing isomorphisms.


Inner Class Summary
static class Invariant.Test
           
 
Constructor Summary
Invariant(Graph G)
           
 
Method Summary
 long getHash()
          This is a long with the property that nonisomorphic graphs are unlikely to get the same return value.
 boolean Isomorphic(Invariant inv)
          Returns true if the underlying graphs are isomorphic, and false otherwise.
 boolean ProperlyIsomorphic(Invariant inv)
          Returns true if there is an orientation preserving isomorphism between the graphs.
 Graph toGraph()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Invariant

public Invariant(Graph G)
Method Detail

getHash

public long getHash()
This is a long with the property that nonisomorphic graphs are unlikely to get the same return value. Mirror images have the same hash.

Isomorphic

public boolean Isomorphic(Invariant inv)
Returns true if the underlying graphs are isomorphic, and false otherwise. Guaranteed to determine if they are isomorphic or not.
Parameters:
A - the Invariant being compared to this. It is left unmodified. A.Isomorphic(B) returns the same value as B.Isomorphic(A).

ProperlyIsomorphic

public boolean ProperlyIsomorphic(Invariant inv)
Returns true if there is an orientation preserving isomorphism between the graphs. Guaranteed to return true if they are properly isomorphic. Guaranteed to return false if not.
Parameters:
inv - Invariant being compared to this. invariant: no side-effects.

toGraph

public Graph toGraph()