edu.iu.pcl.absurdist.graph
Class Graph

java.lang.Object
  |
  +--edu.iu.pcl.absurdist.graph.Graph

public class Graph
extends java.lang.Object

An un-directed graph


Constructor Summary
Graph(int N, double D)
          Constructs a random graph with N nodes and (N*D)/2 edges
 
Method Summary
 int getNodeDegree(int i)
           
 int getNodeNeigh(int i, int j)
           
 int getNodeNum()
           
static void main(java.lang.String[] arg)
          Converts a Graph to a ConceptSystem.
 boolean mayBeSymmetric()
          Tests whether this graph may have some symmetry, by means of looking at N topological invariants of the vertices.
 boolean mayBeSymmetric(int maxNI)
          Tests whether this graph may have some symmetry, by means of looking at topological invariants of the vertices.
 Graph permute(int[] p)
          Permutes the graph.
static int[] randomPermutation(int n)
          Returns an array of integers, from 0 to n-1, randomly permuted.
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

Graph

public Graph(int N,
             double D)
      throws java.lang.Exception
Constructs a random graph with N nodes and (N*D)/2 edges

Method Detail

getNodeNum

public int getNodeNum()

getNodeDegree

public int getNodeDegree(int i)

getNodeNeigh

public int getNodeNeigh(int i,
                        int j)

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object

mayBeSymmetric

public boolean mayBeSymmetric()
Tests whether this graph may have some symmetry, by means of looking at N topological invariants of the vertices.

Returns:
false is we have proven that the graph is asymmetric, by studying the topological invariants of its nodes; true if we have failed to prove asymmetry, which means that the graph may (or may not) be symmetric.

mayBeSymmetric

public boolean mayBeSymmetric(int maxNI)
Tests whether this graph may have some symmetry, by means of looking at topological invariants of the vertices.

Parameters:
maxNI - How many invariants to test. If -1 is passed, the method will test N invariants. In practice, 5 or 10 probably would be enough for most random graphs.
Returns:
false is we have proven that the graph is asymmetric, by studying the topological invariants of its nodes; true if we have failed to prove asymmetry, which means that the graph may (or may not) be symmetric.

randomPermutation

public static int[] randomPermutation(int n)
Returns an array of integers, from 0 to n-1, randomly permuted.


permute

public Graph permute(int[] p)
Permutes the graph. In the new graph, the p[0]-th node is the image of the 0-th node in the graph, etc.

Parameters:
p - Permute according to this table.

main

public static void main(java.lang.String[] arg)
                 throws java.lang.Exception
Converts a Graph to a ConceptSystem.

java.lang.Exception