org.gersteinlab.tyna.core.graph
Class UndirectedSimpleGraph

java.lang.Object
  extended byorg.gersteinlab.tyna.core.graph.AbstractGraph
      extended byorg.gersteinlab.tyna.core.graph.AbstractSimpleGraph
          extended byorg.gersteinlab.tyna.core.graph.UndirectedSimpleGraph
All Implemented Interfaces:
AdvancedGraph, AdvancedUndirectedGraph, Graph, java.io.Serializable, SimpleGraph, UndirectedGraph

public class UndirectedSimpleGraph
extends AbstractSimpleGraph
implements AdvancedUndirectedGraph

	This class represents an undirected simple graph. See UndirectedGraph
	and SimpleGraph for definitions.
	

Version:
1.0 (September 20, 2005) Change History: 1.0 - Initial version
Author:
Kevin Yuk-Lap Yip
See Also:
Serialized Form

Nested Class Summary
protected  class UndirectedSimpleGraph.UndirectedSimpleGraphEdgeIterator
           
 
Nested classes inherited from class org.gersteinlab.tyna.core.graph.AbstractSimpleGraph
AbstractSimpleGraph.AbstractSimpleGraphEdgeIterator
 
Nested classes inherited from class org.gersteinlab.tyna.core.graph.AbstractGraph
AbstractGraph.AbstractGraphEdgeIterator, AbstractGraph.AbstractGraphNodeIterator, AbstractGraph.BetweennessNode, AbstractGraph.DuplicateTree, AbstractGraph.HeadTailTree, AbstractGraph.HeadTree, AbstractGraph.TailTree
 
Field Summary
 
Fields inherited from class org.gersteinlab.tyna.core.graph.AbstractGraph
attrs, edgeCount, edges, lastModified, nodes, revEdges
 
Constructor Summary
UndirectedSimpleGraph()
          Default constructor: creates an empty graph.
UndirectedSimpleGraph(Graph graph)
           
 
Method Summary
 java.util.List getDefectiveCliquesMissingEdges(int k, int l)
          Get the missing edges in defective cliques formed by two cliques with .
 int getDegree(Node node)
          Get the degree of a node.
 java.util.Map getDegrees()
          Get the degrees of all nodes in the graph.
 double[][] getDiffusionSimilarityMatrix(double beta, int[][] negLaplacianMatrix)
          Get the diffusion similarity matrix of a subgraph according to a given Laplacian matrix.
 double[][] getDiffusionSimilarityMatrix(double beta, java.util.List nodeList)
          Get the diffusion similarity matrix of a subgraph according to a given node order.
 EdgeIterator getEdgeIterator()
          Return an iterator of the edges in the graph.
 java.util.List getEdges(Node node)
          Get the edges incident on a node.
 java.util.List getMaximalCliques()
          Get all maximal cliques
 java.util.List getMaximalIndependentSets()
          Get all maximal independent sets
 int[][] getNegativeLaplacianMatrix(int[][] adjacencyMatrix)
          Get the Laplacian matrix of a subgraph according to a given adjacency matrix.
 int[][] getNegativeLaplacianMatrix(java.util.List nodeList)
          Get the negation of the Laplacian matrix of a subgraph according to a given node order.
 java.util.Set getNeighbors(Node node)
          Get the neighbors of a node.
 
Methods inherited from class org.gersteinlab.tyna.core.graph.AbstractSimpleGraph
addEdge, getInDegree, getInEdges, getOutDegree, getOutEdges
 
Methods inherited from class org.gersteinlab.tyna.core.graph.AbstractGraph
accumulateLocalBetweenness, addNode, checkEdge, checkNode, computeLocalBetweenness, containsEdge, containsNode, eigSym, getAdjacencyMatrix, getAllUnweightedShortestPaths, getAllUnweightedShortestPaths, getAllUnweightedShortestPaths, getAttr, getAttrs, getBetweenness, getBetweennesses, getClusCoef, getClusCoefs, getConnectedComponentCount, getConnectedComponents, getCycles, getCycles, getEccentricities, getEccentricity, getEdgeBetweennesses, getEdgeCount, getEdgeNodePairs, getFeedforwardLoops, getFeedforwardLoops, getInDegrees, getInNeighbors, getMaximalChains, getMaximalCompleteTwoLayerSubgraphs, getMinimalChains, getNode, getNodeCount, getNodeIterator, getOutDegrees, getOutNeighbors, getUnweightedShortestPath, getUnweightedShortestPathLength, getUnweightedShortestPathLengths, getUnweightedShortestPathLengths, getUnweightedShortestPaths, getUnweightedShortestPaths, getUnweightedShortestPaths, getUnweightedShortestPaths, markModified, saveGraph, setAttr
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.gersteinlab.tyna.core.graph.Graph
addEdge, addNode, containsEdge, containsNode, getAttr, getAttrs, getEdgeCount, getEdgeNodePairs, getNode, getNodeCount, getNodeIterator, setAttr
 

Constructor Detail

UndirectedSimpleGraph

public UndirectedSimpleGraph()
Default constructor: creates an empty graph.


UndirectedSimpleGraph

public UndirectedSimpleGraph(Graph graph)
                      throws GraphTypeException
See Also:
AbstractGraph.AbstractGraph(Graph)
Method Detail

getEdgeIterator

public EdgeIterator getEdgeIterator()
Description copied from interface: Graph
Return an iterator of the edges in the graph. Unless otherwise specified by the implemented class, the edge order in the returned iterator needs not be predictable from the order in which the edges are added and/or removed.

Specified by:
getEdgeIterator in interface Graph
Returns:
The iterator

getDegree

public int getDegree(Node node)
              throws java.lang.IllegalArgumentException,
                     java.lang.NullPointerException
Description copied from interface: UndirectedGraph
Get the degree of a node.

Specified by:
getDegree in interface UndirectedGraph
Overrides:
getDegree in class AbstractGraph
Throws:
java.lang.IllegalArgumentException
java.lang.NullPointerException
See Also:
UndirectedGraph.getDegree(Node)

getDegrees

public java.util.Map getDegrees()
Description copied from interface: UndirectedGraph
Get the degrees of all nodes in the graph.

Specified by:
getDegrees in interface UndirectedGraph
Overrides:
getDegrees in class AbstractGraph
See Also:
UndirectedGraph.getDegrees()

getEdges

public java.util.List getEdges(Node node)
                        throws java.lang.IllegalArgumentException,
                               java.lang.NullPointerException
Description copied from interface: UndirectedGraph
Get the edges incident on a node.

Specified by:
getEdges in interface UndirectedGraph
Overrides:
getEdges in class AbstractGraph
Throws:
java.lang.IllegalArgumentException
java.lang.NullPointerException
See Also:
UndirectedGraph.getDegree(Node)

getNeighbors

public java.util.Set getNeighbors(Node node)
                           throws java.lang.IllegalArgumentException,
                                  java.lang.NullPointerException
Description copied from interface: UndirectedGraph
Get the neighbors of a node.

Specified by:
getNeighbors in interface UndirectedGraph
Overrides:
getNeighbors in class AbstractGraph
Throws:
java.lang.IllegalArgumentException
java.lang.NullPointerException
See Also:
UndirectedGraph.getDegree(Node)

getNegativeLaplacianMatrix

public int[][] getNegativeLaplacianMatrix(java.util.List nodeList)
Description copied from interface: AdvancedUndirectedGraph
Get the negation of the Laplacian matrix of a subgraph according to a given node order.

Specified by:
getNegativeLaplacianMatrix in interface AdvancedUndirectedGraph
Overrides:
getNegativeLaplacianMatrix in class AbstractGraph
See Also:
AdvancedUndirectedGraph.getNegativeLaplacianMatrix(List)

getNegativeLaplacianMatrix

public int[][] getNegativeLaplacianMatrix(int[][] adjacencyMatrix)
Description copied from interface: AdvancedUndirectedGraph
Get the Laplacian matrix of a subgraph according to a given adjacency matrix.

Specified by:
getNegativeLaplacianMatrix in interface AdvancedUndirectedGraph
Overrides:
getNegativeLaplacianMatrix in class AbstractGraph
See Also:
AdvancedUndirectedGraph.getNegativeLaplacianMatrix(int[][])

getDiffusionSimilarityMatrix

public double[][] getDiffusionSimilarityMatrix(double beta,
                                               java.util.List nodeList)
                                        throws JSci.maths.MaximumIterationsExceededException
Description copied from interface: AdvancedUndirectedGraph
Get the diffusion similarity matrix of a subgraph according to a given node order.

Specified by:
getDiffusionSimilarityMatrix in interface AdvancedUndirectedGraph
Overrides:
getDiffusionSimilarityMatrix in class AbstractGraph
Throws:
JSci.maths.MaximumIterationsExceededException - If the eigen problem cannot be solved in a predefined number of iterations
See Also:
AdvancedUndirectedGraph.getDiffusionSimilarityMatrix(double, List)

getDiffusionSimilarityMatrix

public double[][] getDiffusionSimilarityMatrix(double beta,
                                               int[][] negLaplacianMatrix)
                                        throws JSci.maths.MaximumIterationsExceededException
Description copied from interface: AdvancedUndirectedGraph
Get the diffusion similarity matrix of a subgraph according to a given Laplacian matrix.

Specified by:
getDiffusionSimilarityMatrix in interface AdvancedUndirectedGraph
Overrides:
getDiffusionSimilarityMatrix in class AbstractGraph
Throws:
JSci.maths.MaximumIterationsExceededException - If the eigen problem cannot be solved in a predefined number of iterations
See Also:
AdvancedUndirectedGraph.getDiffusionSimilarityMatrix(double, int[][])

getMaximalIndependentSets

public java.util.List getMaximalIndependentSets()
Description copied from interface: AdvancedUndirectedGraph
Get all maximal independent sets

Specified by:
getMaximalIndependentSets in interface AdvancedUndirectedGraph
Overrides:
getMaximalIndependentSets in class AbstractGraph
See Also:
AdvancedUndirectedGraph.getMaximalIndependentSets()

getMaximalCliques

public java.util.List getMaximalCliques()
Description copied from interface: AdvancedUndirectedGraph
Get all maximal cliques

Specified by:
getMaximalCliques in interface AdvancedUndirectedGraph
Overrides:
getMaximalCliques in class AbstractGraph
See Also:
AdvancedUndirectedGraph.getMaximalCliques()

getDefectiveCliquesMissingEdges

public java.util.List getDefectiveCliquesMissingEdges(int k,
                                                      int l)
                                               throws java.lang.IllegalArgumentException
Description copied from interface: AdvancedUndirectedGraph
Get the missing edges in defective cliques formed by two cliques with . At least k vertices in common . At most l vertices not in common

Specified by:
getDefectiveCliquesMissingEdges in interface AdvancedUndirectedGraph
Overrides:
getDefectiveCliquesMissingEdges in class AbstractGraph
Throws:
java.lang.IllegalArgumentException
See Also:
AdvancedUndirectedGraph.getDefectiveCliquesMissingEdges(int, int)