nct.graph
Interface KPartiteGraph<NodeType extends java.lang.Comparable<? super NodeType>,WeightType extends java.lang.Comparable<? super WeightType>,PartitionType extends java.lang.Comparable<? super PartitionType>>

All Superinterfaces:
java.lang.Cloneable, java.lang.Comparable<Graph<NodeType,WeightType>>, Graph<NodeType,WeightType>
All Known Implementing Classes:
BasicKPartiteGraph, HomologyGraph

public interface KPartiteGraph<NodeType extends java.lang.Comparable<? super NodeType>,WeightType extends java.lang.Comparable<? super WeightType>,PartitionType extends java.lang.Comparable<? super PartitionType>>
extends Graph<NodeType,WeightType>

A generic interface to a K-partite graph.


Method Summary
 boolean addNode(NodeType node, PartitionType partition)
          Adds a node to a specific partition in the graph.
 int getK()
          Returns the number of possible partitions in the graph.
 int getNumPartitions()
          Returns the number of partitions currently contained in the graph (not necessarily K if K partitions haven't yet been added).
 java.util.List<PartitionType> getPartitions()
          Returns a list of the partitions currently contained in the graph (not necessarily K if K partitions haven't yet been added).
 boolean isPartition(PartitionType p)
          Checks whether a specified partition is one of the partitions used in the graph.
 
Methods inherited from interface nct.graph.Graph
addEdge, addEdge, addNode, clone, compareTo, degreeOfNode, getEdge, getEdgeDescription, getEdgeList, getEdges, getEdgeWeight, getId, getNeighbors, getNodes, getScore, isEdge, isNode, numberOfEdges, numberOfNodes, removeEdge, removeNode, setEdgeDescription, setEdgeWeight, setScore, toString
 

Method Detail

getPartitions

java.util.List<PartitionType> getPartitions()
Returns a list of the partitions currently contained in the graph (not necessarily K if K partitions haven't yet been added).

Returns:
A List of the current partitions in the graph.

getNumPartitions

int getNumPartitions()
Returns the number of partitions currently contained in the graph (not necessarily K if K partitions haven't yet been added).


getK

int getK()
Returns the number of possible partitions in the graph. The "K" in K-partite. This value is not necessarily the number of partitions currently in the graph if K partitions have not yet been specified.


isPartition

boolean isPartition(PartitionType p)
Checks whether a specified partition is one of the partitions used in the graph.

Parameters:
p - The partition to check.
Returns:
Whether or not the specified partition is one of the partitions used in the graph.

addNode

boolean addNode(NodeType node,
                PartitionType partition)
Adds a node to a specific partition in the graph.

Parameters:
node - The node to be added to the graph.
partition - The partition the node should be added to.
Returns:
Whether the node was successfully added to the graph.