notio
Class AdjacencyMatrix

java.lang.Object
  |
  +--notio.AdjacencyMatrix
All Implemented Interfaces:
java.io.Serializable

public class AdjacencyMatrix
extends java.lang.Object
implements java.io.Serializable

This class provides an adjacency matrix representation suitable for conceptual graphs. The matrix is three-dimensional. Since CG's are bipartite, the first and second dimensions correspond to relations and concepts respectively. The first element in the third dimension is the number of arcs between the specified concept and relation. Note that CG's can indeed have multiple arcs between a concept and relation since arcs are ordered and therefore distinct. A zero indicates that the nodes are not adjacent. The remaining elements along the third dimension of an entry are the numbers of the arcs connecting the two nodes. For example, if a relation and concept had two arcs number 1 and 4 connecting them, the entry would be an array like this: { 2, 1, 4 }. Of course, if one only wishes to test the adjacency of two nodes, one can simply look to see if the first element of the third dimension is non-zero. Once generated, instances of this class are independent of the graph from which they are derived. That is, if the original graph changes, the adjacency matrix is not updated. This alternate representation is provided to allow for the easy implementation of certain graph algorithms. Since efficiency is a primary concern and instances of this class are not updated along with the structures upon which they are based, the usual Notio convention of using accessor (getX/putX methods) which provide safe access to the information is avoided and public members are used instead.

See Also:
Serialized Form

Field Summary
 int[][][] adjacencies
          A two dimensional array with the adjacencies.
 Concept[] concepts
          The array of concepts indicating the concept ordering.
 Relation[] relations
          The array of relations indicating the relation ordering.
 
Constructor Summary
AdjacencyMatrix()
          Constructs an AdjacencyMatrix with no initial values for the fields.
AdjacencyMatrix(Concept[] newConcepts, Relation[] newRelations, int[][][] newAdjacencies)
          Constructs an AdjacencyMatrix by copying the supplied arrays.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

concepts

public Concept[] concepts
The array of concepts indicating the concept ordering.

relations

public Relation[] relations
The array of relations indicating the relation ordering.

adjacencies

public int[][][] adjacencies
A two dimensional array with the adjacencies. The first index is for relations, the second for concepts, and the third is for arc count followed by arc numbers.
Constructor Detail

AdjacencyMatrix

public AdjacencyMatrix()
Constructs an AdjacencyMatrix with no initial values for the fields.

AdjacencyMatrix

public AdjacencyMatrix(Concept[] newConcepts,
                       Relation[] newRelations,
                       int[][][] newAdjacencies)
Constructs an AdjacencyMatrix by copying the supplied arrays.
Parameters:
newConcepts - the concept ordering array for the matrix.
newRelations - the relation ordering array for the matrix.
newAdjacencies - the matrix of adjancies.


Copyright 1998-2001 Finnegan Southey