graph
Class Graph

java.lang.Object
  extended bygraph.Graph

public class Graph
extends java.lang.Object

An un-directed graph


Nested Class Summary
(package private)  class Graph.Node
          An instance of this class represents one node of the graph
 
Field Summary
(package private) static boolean debug
           
(package private)  Graph.Node[] node
          The nodes of the graph.
 
Constructor Summary
Graph(int N, double D)
          Constructs a random graph with N nodes and (N*D)/2 edges
 
Method Summary
(package private)  void displayEquiv(NodeInfo[] w)
          Show how the nodes are divided into classes of equivalency
 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
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

debug

static boolean debug

node

Graph.Node[] node
The nodes of the graph. Use the size of this array to find the number of nodes in the graph

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()

displayEquiv

void displayEquiv(NodeInfo[] w)
Show how the nodes are divided into classes of equivalency


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.

Throws:
java.lang.Exception