netkit.graph
Class Graph

java.lang.Object
  extended by netkit.graph.Graph
All Implemented Interfaces:
java.lang.Cloneable

public final class Graph
extends java.lang.Object
implements java.lang.Cloneable

This class represents the relational network in memory. It contains Node objects connected via Edge objects. The Graph object also keeps track of valid node types represented by Attributes containers and valid edge types represented by the EdgeType class.

Author:
Kaveh R. Ghazi
See Also:
Node, Edge, Attributes, EdgeType, SchemaReader, SchemaWriter

Constructor Summary
Graph()
           
 
Method Summary
 void addAttribute(java.lang.String nodeType, Attribute a)
          Adds an Attribute to the Attributes container represented by the supplied nodeType name.
 void addAttributes(Attributes a)
          Adds the supplied Attributes container (or node type) to this Graph; Attributes must be added to the Graph before Nodes that utilize them can be added.
 void addEdge(Edge e)
          Deprecated. Use of this method is deprecated, use addEdge(EdgeType,Node,Node,double) instead
 Edge addEdge(EdgeType et, Node source, Node dest, double weight)
          Add an edge created from the supplied parameters to the graph; if the nodes are already connected, then simply add the weight to the existing Edge.
 void addEdgeType(EdgeType et)
          Add the supplied EdgeType to this Graph; EdgeTypes must be added to the Graph before Edges that utilize them can be added.
 Node addNode(java.lang.String nodeName, Attributes a)
          Adds a new Node to the Graph using the supplied node name and Attributes container.
 Graph clone()
           
 Attributes[] getAllAttributes()
          Gets an array of Attributes containing the node types in this graph.
 AttributeMetaInfo getAttributeMetaInfo(java.lang.String nodeTypeName, Attribute attribute)
          Factory method which gets the meta info object for the supplied nodeType name and attribute.
 AttributeCategoricalMetaInfo getAttributeMetaInfo(java.lang.String nodeTypeName, AttributeCategorical attribute)
          Factory method which gets the meta info object for the supplied nodeType name and attribute.
 Attributes getAttributes(java.lang.String nodeType)
          Get the Attributes container matching the string provided.
 HistogramCategorical getClassReferenceVector(AttributeCategorical sourceAttrib, int sourceAttribValue, AttributeCategorical destAttrib, java.util.List<EdgeType> path, boolean normalized)
          Gets a class reference vector for the supplied parameters; returns a histogram on the results.
 Edge getEdge(java.lang.String edgeTypeName, Node source, Node dest)
          Gets the edge connecting two nodes in the graph; if the nodes aren't connected return null.
 Edge[] getEdges()
          Gets all of the edges in the graph, irrespective of the EdgeType; the order is unspecified.
 Edge[] getEdges(EdgeType et)
          Gets all the of the edges in the graph having a particular EdgeType; the order is unspecified.
 Edge[] getEdges(java.lang.String edgeTypeName)
          Gets all the of the edges in the graph having a particular EdgeType; the order is unspecified.
 EdgeType getEdgeType(java.lang.String edgeType)
          Get the EdgeType matching the provided edge type name.
 java.lang.String[] getEdgeTypeNames()
          Gets an array of String containing the list of names of all EdgeTypes.
 java.lang.String[] getEdgeTypeNames(java.lang.String sourceNodeType)
          Gets an array of String containing the list of names of the EdgeTypes whose source node type is the supplied parameter.
 java.lang.String[] getEdgeTypeNames(java.lang.String sourceNodeType, java.lang.String destNodeType)
          Gets an array of String containing the list of names of the EdgeTypes whose source and destination node types are the supplied parameters.
 EdgeType[] getEdgeTypes()
          Gets an array of EdgeType containing the list of EdgeTypes in this graph.
 EdgeType[] getEdgeTypes(java.lang.String sourceNodeType)
          Gets an array of EdgeTypes containing the list of the EdgeTypes whose source node type is the supplied parameter.
 EdgeType[] getEdgeTypes(java.lang.String sourceNodeType, java.lang.String destNodeType)
          Gets an array of EdgeType containing the list of EdgeTypes whose source and destination node types are the supplied parameters.
 GraphMetrics getMetrics()
          Get the metrics encapsulating statistics about this graph.
 Node getNode(int index)
          Gets the node corresponding to the supplied int index.
 Node getNode(java.lang.String nodeName, java.lang.String nodeType)
          Gets the node coresponding to the supplied node name and node type.
 Node[] getNodes()
          Gets all of the nodes in the graph; the order is unspecified.
 Node[] getNodes(Attributes attrs)
          Gets all of the Nodes whose Attributes container matches the supplied parameter.
 Node[] getNodes(java.lang.String type)
          Gets all of the Nodes matching the supplied node type.
 Node[] getNodes(java.lang.String nodeType, NodeFilter nf)
          Gets all of the Nodes matching the supplied node type and which also are accepted by the supplied NodeFilter.
 java.lang.String[] getNodeTypes()
          Gets an array of String containing the list of names of the node types in this graph.
 java.util.List<java.util.List<EdgeType>> getPaths(java.lang.String sourceNodeType, java.lang.String destNodeType, int maxLength)
          Gets all paths in this Graph from the supplied source node type to the supplied destination node type that fit within the supplied maximum length.
 HistogramCategorical getUnconditionalReferenceVector(AttributeCategorical destAttrib, java.util.List<EdgeType> path, boolean normalized)
          Gets an unconditional reference vector for the supplied parameters; returns a histogram on the results.
 double[] getValues(java.lang.String nodeType, int index)
          Gets a double array of values from Nodes in this Graph matching the supplied node type; the values are obtained from the Attribute at the supplied index offset into the Node's fields.
 double[] getValues(java.lang.String nodeType, NodeFilter nf, int index)
          Gets a double array of values from Nodes in this Graph matching the supplied node type and which also are accepted by the supplied NodeFilter; the values are obtained from the Attribute at the supplied index offset into the Node's fields.
 double[] getValues(java.lang.String nodeType, NodeFilter nf, java.lang.String fieldName)
          Gets a double array of values from Nodes in this Graph matching the supplied node type and which also are accepted by the supplied NodeFilter; the values are obtained from the Attribute matching the supplied field name.
 double[] getValues(java.lang.String nodeType, java.lang.String fieldName)
          Gets a double array of values from Nodes in this Graph matching the supplied node type; the values are obtained from the Attribute matching the supplied field name.
static void main(java.lang.String[] args)
           
 int numEdges()
          Gets the total number of edges in this graph.
 int numEdges(java.lang.String edgeTypeName)
          Gets the number of Edges in this graph for the supplied EdgeType name.
 int numNodes()
          Gets the total number of nodes in this graph.
 int numNodes(java.lang.String nodeType)
          Gets the number of nodes in the graph for the supplied node type.
 void removeAttribute(java.lang.String nodeType, int index)
          Remove an Attribute at the supplied index from the Attributes container represented by the supplied nodeType name.
 void removeAttributes(java.lang.String nodeType, boolean force)
          Remove the supplied Attributes container (AKA nodeType) from this Graph.
 void removeEdge(java.lang.String edgeTypeName, Node source, Node dest)
          Removes the Edge connecting the supplied source Node and destination Node through the supplied EdgeType.
 void removeEdges(java.lang.String edgeTypeName)
          Removes all Edges from this Graph sharing the supplied EdgeType.
 void removeEdgeType(java.lang.String edgeTypeName, boolean force)
          Remove the supplied EdgeType from this Graph.
 void removeNodes(java.lang.String nodeType, boolean force)
          Remove all Nodes in this Graph whose Attributes container (AKA nodeType) matches the supplied nodeType.
 Graph subGraph(java.util.Collection<Node> nodeSet)
          Create a sub-graph consisting only of the given nodes and the edges between those nodes.
static void testGetPaths(int maxLength)
           
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Graph

public Graph()
Method Detail

clone

public Graph clone()
Overrides:
clone in class java.lang.Object

subGraph

public Graph subGraph(java.util.Collection<Node> nodeSet)
Create a sub-graph consisting only of the given nodes and the edges between those nodes. The new sub-graph will have a new set of nodes and edges, but internal node attribute-vectors are all the same as are graph meta information such as attributes and edgeType objects

Parameters:
nodeSet -
Returns:
new Graph.

getMetrics

public GraphMetrics getMetrics()
Get the metrics encapsulating statistics about this graph.

Returns:
a GraphMetrics object which contains graph metrics about this graph.

addAttributes

public void addAttributes(Attributes a)
Adds the supplied Attributes container (or node type) to this Graph; Attributes must be added to the Graph before Nodes that utilize them can be added.

Parameters:
a - an Attributes container to add.
Throws:
java.lang.RuntimeException - if an Attributes container with the same name has already been added to this Graph.

getAllAttributes

public Attributes[] getAllAttributes()
Gets an array of Attributes containing the node types in this graph.

Returns:
an array of Attributes containing the node types in this graph.

getAttributes

public Attributes getAttributes(java.lang.String nodeType)
Get the Attributes container matching the string provided.

Parameters:
nodeType - the string name identifying the node type to search for.
Returns:
the Attributes container matching the provided string node type or null if no Attributes container with a matching name is found.

addAttribute

public void addAttribute(java.lang.String nodeType,
                         Attribute a)
Adds an Attribute to the Attributes container represented by the supplied nodeType name. Synchronize any existing Nodes by extending their internal values array.

Parameters:
nodeType - a String representing the Attributes container to be extended.
a - an Attribute field to be added to the container.
Throws:
java.lang.NullPointerException - if the specified nodeType doesn't exist in this Graph.

removeAttribute

public void removeAttribute(java.lang.String nodeType,
                            int index)
Remove an Attribute at the supplied index from the Attributes container represented by the supplied nodeType name. Synchronize Nodes in this Graph by removing the value at the supplied index. Also invalidate any cached AttributeMetaInfo objects for the supplied Attribute. Note you cannot remove a KEY Attribute field.

Parameters:
nodeType - a String representing the Attributes container.
index - an integer field index to be removed.
Throws:
java.lang.NullPointerException - if the index is out of bounds or if the supplied nodeType doesn't exist.
java.lang.RuntimeException - if the supplied index represents the KEY field.

getNodeTypes

public java.lang.String[] getNodeTypes()
Gets an array of String containing the list of names of the node types in this graph.

Returns:
an array of String containing the list of names of the node types in this graph.

getEdgeTypeNames

public java.lang.String[] getEdgeTypeNames()
Gets an array of String containing the list of names of all EdgeTypes.

Returns:
an array of String containing the list of names of all the EdgeTypes.

getEdgeTypeNames

public java.lang.String[] getEdgeTypeNames(java.lang.String sourceNodeType)
Gets an array of String containing the list of names of the EdgeTypes whose source node type is the supplied parameter.

Parameters:
sourceNodeType - the String name of the source node type.
Returns:
an array of String containing the list of names of the EdgeTypes whose source node type is the supplied parameter.

getEdgeTypes

public EdgeType[] getEdgeTypes(java.lang.String sourceNodeType)
Gets an array of EdgeTypes containing the list of the EdgeTypes whose source node type is the supplied parameter.

Parameters:
sourceNodeType - the String name of the source node type.
Returns:
an array of EdgeTypes containing the list of the EdgeTypes whose source node type is the supplied parameter.

getEdgeTypes

public EdgeType[] getEdgeTypes(java.lang.String sourceNodeType,
                               java.lang.String destNodeType)
Gets an array of EdgeType containing the list of EdgeTypes whose source and destination node types are the supplied parameters.

Parameters:
destNodeType - the String name of the destination node type.
Returns:
an array of EdgeType containing the list of EdgeTypes whose source and destination node types are the supplied parameters.

getEdgeTypeNames

public java.lang.String[] getEdgeTypeNames(java.lang.String sourceNodeType,
                                           java.lang.String destNodeType)
Gets an array of String containing the list of names of the EdgeTypes whose source and destination node types are the supplied parameters.

Parameters:
destNodeType - the String name of the destination node type.
Returns:
an array of String containing the list of names of the EdgeTypes whose source and destination node types are the supplied parameters.

getEdgeType

public EdgeType getEdgeType(java.lang.String edgeType)
Get the EdgeType matching the provided edge type name.

Parameters:
edgeType - the string edge type name to lookup.
Returns:
the EdgeType matching the provided string, or null if not found.

getEdgeTypes

public EdgeType[] getEdgeTypes()
Gets an array of EdgeType containing the list of EdgeTypes in this graph.

Returns:
an array of EdgeType containing the list of EdgeTypes in this graph.

addEdgeType

public void addEdgeType(EdgeType et)
Add the supplied EdgeType to this Graph; EdgeTypes must be added to the Graph before Edges that utilize them can be added.

Parameters:
et - the EdgeType to add.
Throws:
java.lang.RuntimeException - if an EdgeType with the same name has already been added to this Graph; or if the EdgeType's source or destination node types are invalid for this Graph.

removeEdgeType

public void removeEdgeType(java.lang.String edgeTypeName,
                           boolean force)
Remove the supplied EdgeType from this Graph. If force is false and Edges using the supplied EdgeType exist, then throw an exception. Otherwise, remove the offending components.

Parameters:
edgeTypeName - a String representing the EdgeType to be removed.
force - if false and Edges using the supplied EdgeType exist, then throw.
Throws:
java.lang.NullPointerException - if the supplied EdgeType does not exist in this Graph.
java.lang.RuntimeException - if force is false and Edges using the supplied EdgeType exist.

numNodes

public int numNodes()
Gets the total number of nodes in this graph.

Returns:
the total number of nodes in this graph.

numNodes

public int numNodes(java.lang.String nodeType)
Gets the number of nodes in the graph for the supplied node type.

Returns:
the number of nodes in the graph for the supplied node type.
Throws:
java.lang.NullPointerException - if the supplied node type doesn't exist.

numEdges

public int numEdges()
Gets the total number of edges in this graph.

Returns:
the total number of edges in this graph.

numEdges

public int numEdges(java.lang.String edgeTypeName)
Gets the number of Edges in this graph for the supplied EdgeType name.

Parameters:
edgeTypeName - the EdgeType name Edges must have to be included in this count.
Returns:
the number of Edges in this graph for the supplied EdgeType name.

addNode

public Node addNode(java.lang.String nodeName,
                    Attributes a)
Adds a new Node to the Graph using the supplied node name and Attributes container.

Parameters:
nodeName - the string name for the new Node.
a - the Attributes container for the new Node.
Returns:
the newly created Node.
Throws:
java.lang.NullPointerException - if the supplied Attributes container doesn't exist in the Graph.
java.lang.RuntimeException - if a Node matching the supplied parameters already exists in this Graph.

removeNodes

public void removeNodes(java.lang.String nodeType,
                        boolean force)
Remove all Nodes in this Graph whose Attributes container (AKA nodeType) matches the supplied nodeType. If force is false and Edges connecting Nodes using the supplied nodeType exist, then throw an exception. Otherwise when force is true remove the offending components as well. Also remove any cached AttributeMetaInfo objects for the supplied nodeType.

Parameters:
nodeType - a String representing the nodeType of the Nodes to be removed.
force - if false and components using the supplied nodeType exist, then throw. Otherwise, remove the components.
Throws:
java.lang.RuntimeException - if the supplied nodeType does not exist in this Graph. Also throws if force is false and components using the supplied nodeType exist.

removeAttributes

public void removeAttributes(java.lang.String nodeType,
                             boolean force)
Remove the supplied Attributes container (AKA nodeType) from this Graph. If force is false and components using the supplied nodeType exist, then throw an Exception. Otherwise when force is true remove the offending Graph components. These components might include Nodes, Edges, EdgeTypes and AttributeMetaInfo objects.

Parameters:
nodeType - a String representing the nodeType to be removed.
force - if false and components using the supplied nodeType exist, then throw. Otherwise, remove the components.
Throws:
java.lang.NullPointerException - if the supplied nodeType does not exist in this Graph.
java.lang.RuntimeException - if force is false and components using the supplied nodeType exist.

getNode

public Node getNode(int index)
Gets the node corresponding to the supplied int index.

Parameters:
index - an int indicating which node is being requested.
Returns:
a Node object corresponding to the supplied int index.
Throws:
java.lang.ArrayIndexOutOfBoundsException - if the index is invalid.

getNode

public Node getNode(java.lang.String nodeName,
                    java.lang.String nodeType)
Gets the node coresponding to the supplied node name and node type.

Parameters:
nodeName - the name of the Node to lookup.
nodeType - the type of the Node to lookup.
Returns:
the Node matching the supplied parameters, returns null if the supplied node name doesn't exist.
Throws:
java.lang.NullPointerException - if the supplied type doesn't exist.

getNodes

public Node[] getNodes()
Gets all of the nodes in the graph; the order is unspecified.

Returns:
all of the nodes in the graph in an array ordered as they were inserted into the Graph container.

getNodes

public Node[] getNodes(java.lang.String type)
Gets all of the Nodes matching the supplied node type.

Parameters:
type - a string node type name to match against.
Returns:
an array of Nodes whose node type matches the supplied parameter.
Throws:
java.lang.NullPointerException - if the supplied node type doesn't exist.

getNodes

public Node[] getNodes(java.lang.String nodeType,
                       NodeFilter nf)
Gets all of the Nodes matching the supplied node type and which also are accepted by the supplied NodeFilter.

Parameters:
nodeType - a String node type name to match against.
nf - a NodeFilter to match against.
Returns:
an array of Nodes whose node type matches the supplied parameters.
Throws:
java.lang.NullPointerException - if the supplied node type doesn't exist.

getNodes

public Node[] getNodes(Attributes attrs)
Gets all of the Nodes whose Attributes container matches the supplied parameter.

Parameters:
attrs - the Attributes container to match against.
Returns:
an array of Nodes whose node type matches the supplied parameter.
Throws:
java.lang.NullPointerException - if the Attributes is not in this Graph.

addEdge

@Deprecated
public void addEdge(Edge e)
Deprecated. Use of this method is deprecated, use addEdge(EdgeType,Node,Node,double) instead

Add the supplied edge to the graph; if the edge's nodes are already connected, then simply add the edge's weight to the existing one.

Parameters:
e - the edge to be added to the graph.

addEdge

public Edge addEdge(EdgeType et,
                    Node source,
                    Node dest,
                    double weight)
Add an edge created from the supplied parameters to the graph; if the nodes are already connected, then simply add the weight to the existing Edge. Note the Edge's EdgeType must already have been inserted into the Graph.

Parameters:
et - the EdgeType of the Edge.
source - the source Node for the Edge.
dest - the destination Node for the Edge.
weight - the weight for the Edge.
Returns:
The created edge
Throws:
java.lang.NullPointerException - if the Edge's EdgeType hasn't already been added to the Graph.

removeEdge

public void removeEdge(java.lang.String edgeTypeName,
                       Node source,
                       Node dest)
Removes the Edge connecting the supplied source Node and destination Node through the supplied EdgeType. The resulting Edge must exist.

Parameters:
edgeTypeName - a String representing the EdgeType for the connecting Edge to be removed.
source - the source Node for the connecting Edge.
dest - the destination Node for the connecting Edge.
Throws:
java.lang.NullPointerException - if the supplied EdgeType name doesn't exist.
java.lang.RuntimeException - if there is no connecting edge for the supplied Nodes.

removeEdges

public void removeEdges(java.lang.String edgeTypeName)
Removes all Edges from this Graph sharing the supplied EdgeType.

Parameters:
edgeTypeName - a String representing the EdgeType for Edges to be removed.
Throws:
java.lang.NullPointerException - if the supplied EdgeType name doesn't exist.

getEdge

public Edge getEdge(java.lang.String edgeTypeName,
                    Node source,
                    Node dest)
Gets the edge connecting two nodes in the graph; if the nodes aren't connected return null.

Parameters:
edgeTypeName - the EdgeType name of the Edge being sought.
source - the source Node for the Edge being sought.
dest - the destination Node for the Edge being sought.
Returns:
an Edge object connecting two nodes in the graph; if the nodes aren't connected return null.

getEdges

public Edge[] getEdges()
Gets all of the edges in the graph, irrespective of the EdgeType; the order is unspecified.

Returns:
all of the edges in the graph in an array.

getEdges

public Edge[] getEdges(EdgeType et)
Gets all the of the edges in the graph having a particular EdgeType; the order is unspecified.

Parameters:
et - an EdgeType for the returned Edges.
Returns:
all the of the edges in the graph having a particular EdgeType.
Throws:
java.lang.NullPointerException - if the supplied EdgeType doesn't exist in the Graph.

getEdges

public Edge[] getEdges(java.lang.String edgeTypeName)
Gets all the of the edges in the graph having a particular EdgeType; the order is unspecified.

Parameters:
edgeTypeName - a String representing the EdgeType name for the returned Edges.
Returns:
all the of the edges in the graph having a particular EdgeType.
Throws:
java.lang.NullPointerException - if the supplied EdgeType doesn't exist in the Graph.

getValues

public double[] getValues(java.lang.String nodeType,
                          int index)
Gets a double array of values from Nodes in this Graph matching the supplied node type; the values are obtained from the Attribute at the supplied index offset into the Node's fields.

Parameters:
nodeType - a String representation of the node type.
index - the field index to lookup in each Node.
Returns:
a double array of values from Nodes in this Graph matching the supplied node type; the values are obtained from the Attribute at the supplied index offset into the Node's fields.
Throws:
java.lang.NullPointerException - if the supplied node type doesn't exist.
java.lang.ArrayIndexOutOfBoundsException - if the supplied index is outside the bounds of the values in the Nodes.

getValues

public double[] getValues(java.lang.String nodeType,
                          NodeFilter nf,
                          int index)
Gets a double array of values from Nodes in this Graph matching the supplied node type and which also are accepted by the supplied NodeFilter; the values are obtained from the Attribute at the supplied index offset into the Node's fields.

Parameters:
nodeType - a String representation of the node type.
nf - a NodeFilter to match against.
index - the field index to lookup in each Node.
Returns:
a double array of values from Nodes in this Graph matching the supplied node type; the values are obtained from the Attribute at the supplied index offset into the Node's fields.
Throws:
java.lang.NullPointerException - if the supplied node type doesn't exist.
java.lang.ArrayIndexOutOfBoundsException - if the supplied index is outside the bounds of the values in the Nodes.

getValues

public double[] getValues(java.lang.String nodeType,
                          java.lang.String fieldName)
Gets a double array of values from Nodes in this Graph matching the supplied node type; the values are obtained from the Attribute matching the supplied field name.

Parameters:
nodeType - a String representation of the node type.
fieldName - the field name to lookup in each Node.
Returns:
a double array of values from Nodes in this Graph matching the supplied node type; the values are obtained from the Attribute matching the supplied field name.
Throws:
java.lang.NullPointerException - if the supplied node type doesn't exist.
java.lang.RuntimeException - if the supplied field name doesn't exist.

getValues

public double[] getValues(java.lang.String nodeType,
                          NodeFilter nf,
                          java.lang.String fieldName)
Gets a double array of values from Nodes in this Graph matching the supplied node type and which also are accepted by the supplied NodeFilter; the values are obtained from the Attribute matching the supplied field name.

Parameters:
nodeType - a String representation of the node type.
nf - a NodeFilter to match against.
fieldName - the field name to lookup in each Node.
Returns:
a double array of values from Nodes in this Graph matching the supplied node type and which also are accepted by the supplied NodeFilter; the values are obtained from the Attribute matching the supplied field name.
Throws:
java.lang.NullPointerException - if the supplied node type doesn't exist.
java.lang.RuntimeException - if the supplied field name doesn't exist.

getPaths

public java.util.List<java.util.List<EdgeType>> getPaths(java.lang.String sourceNodeType,
                                                         java.lang.String destNodeType,
                                                         int maxLength)
Gets all paths in this Graph from the supplied source node type to the supplied destination node type that fit within the supplied maximum length. A path is defined as a List<EdgeType> which order EdgeType elements by matching the predecessor's destination node type to the successor's source node type. A suitable path must also have it's first element's source node type and it's last element's destination node type match the supplied parameters. If the source node type equals the destination node type then the resulting paths are loops.

Parameters:
sourceNodeType - a String name representing the source node type of the path.
destNodeType - a String name representing the destination node type of the path.
maxLength - an int for the maximum path length to clamp the recursive search.
Returns:
all paths in this Graph from the supplied source node type to the supplied destination node type that fit within the supplied maximum length.

getClassReferenceVector

public HistogramCategorical getClassReferenceVector(AttributeCategorical sourceAttrib,
                                                    int sourceAttribValue,
                                                    AttributeCategorical destAttrib,
                                                    java.util.List<EdgeType> path,
                                                    boolean normalized)
Gets a class reference vector for the supplied parameters; returns a histogram on the results.

Parameters:
sourceAttrib - the source attribute on which to restrict the possible starting Nodes.
sourceAttribValue - the value that the starting Nodes must have for the source attribute.
destAttrib - the destination attribute for the vector.
path - an EdgeType path for the vector.
normalized - true if the resulting histogram should be normalized.
Returns:
a histogram on the resulting vector.

getUnconditionalReferenceVector

public HistogramCategorical getUnconditionalReferenceVector(AttributeCategorical destAttrib,
                                                            java.util.List<EdgeType> path,
                                                            boolean normalized)
Gets an unconditional reference vector for the supplied parameters; returns a histogram on the results.

Parameters:
destAttrib - the destination attribute for the vector.
path - an EdgeType path for the vector.
normalized - true if the resulting histogram should be normalized.
Returns:
a histogram on the resulting vector.

getAttributeMetaInfo

public AttributeMetaInfo getAttributeMetaInfo(java.lang.String nodeTypeName,
                                              Attribute attribute)
Factory method which gets the meta info object for the supplied nodeType name and attribute. If the method is called more than once, the same object is always returned.

Parameters:
nodeTypeName - a String representing the nodeType (AKA Attributes object).
attribute - an Attribute object within the supplied nodeType.
Returns:
an AttributeMetaInfo object based on the supplied parameters.
Throws:
java.lang.NullPointerException - if the supplied nodeTypeName does not exist within this Graph.
java.lang.RuntimeException - if the supplied attribute does not exist within the supplied nodeType.

getAttributeMetaInfo

public AttributeCategoricalMetaInfo getAttributeMetaInfo(java.lang.String nodeTypeName,
                                                         AttributeCategorical attribute)
Factory method which gets the meta info object for the supplied nodeType name and attribute. If the method is called more than once, the same object is always returned.

Parameters:
nodeTypeName - a String representing the nodeType (AKA Attributes object).
attribute - an Attribute object within the supplied nodeType.
Returns:
an AttributeCategoricalMetaInfo object based on the supplied parameters.
Throws:
java.lang.NullPointerException - if the supplied nodeTypeName does not exist within this Graph.
java.lang.RuntimeException - if the supplied attribute does not exist within the supplied nodeType.

testGetPaths

public static final void testGetPaths(int maxLength)

main

public static final void main(java.lang.String[] args)