edu.iu.cnets.klatsch.model.gephi
Class GephiGraph

java.lang.Object
  extended by edu.iu.cnets.klatsch.model.gephi.GephiGraph
All Implemented Interfaces:
Graph

public class GephiGraph
extends java.lang.Object
implements Graph


Field Summary
(package private)  int colEdgeEndTime
           
(package private)  int colEdgeStartTime
           
(package private)  int colEdgeTrust
           
(package private)  int colEdgeWeight
           
(package private)  int colNodeId
           
(package private)  int colNodeType
          the columns in which we store Klatsch's private attributes
(package private)  org.gephi.data.attributes.api.AttributeModel gAttributeModel
          the attribute model for the graph
(package private)  org.gephi.graph.api.DirectedGraph gGraph
          the actual graph
(package private)  org.gephi.graph.api.GraphModel gModel
          the model for the graph
(package private) static org.gephi.project.api.ProjectController pc
          the project controller is our source of new graph models
 
Constructor Summary
GephiGraph()
          Basic constructor for an empty graph.
 
Method Summary
 Graph actorGraph()
          Returns the subgraph containing only actors and actor-actor edges.
 Graph actorMemeGraph()
          Returns the subgraph containing only actor-meme and meme-actor edges.
 void add(Edge e)
          Adds the given edge to the graph.
 Graph component(int n)
           
 int componentCount()
          Returns the number of components in the graph.
 int[] componentSize()
          Returns an array containing the size of each component in the graph.
 int dstCount()
          Returns the number of destination nodes in the graph.
 java.lang.Iterable<java.lang.Integer> dstK()
          Returns an iterable over the in-degrees of the nodes in the graph.
 int dstK(Node n)
          Returns the in-degree of the given node.
 java.lang.Iterable<java.lang.Double> dstS()
          Returns an iterable over the in-strengths of the nodes in the graph.
 double dstS(Node n)
          Returns the in-strength of the given node.
 int edgeCount()
          Returns the total number of edges.
 java.lang.Iterable<Edge> edges()
          Returns an iterable over the edges.
 java.lang.Iterable<Edge> edgesIn(Node n)
          Returns an iterable over the edges with this node as a destination.
 java.lang.Iterable<Edge> edgesOut(Node n)
          Returns an iterable over the edges with this node as a source.
 boolean export(java.lang.String path, java.lang.String format)
          Exports the graph in the given format.
 Edge getEdge(Edge e)
          Returns the given edge.
 Node getNode(Node n)
          Returns the given node.
 boolean hasEdge(Edge e)
          Returns true if the given edge is part of the graph.
 boolean hasNode(Node n)
          Returns true if the given node is part of the graph.
 void layout(VDictionary config)
          Uses the given configuration dictionary to perform layout on the graph.
 Graph memeGraph()
          Returns the subgraph containing only meme-meme edges.
 int nodeCount()
          Returns the number of nodes in the graph.
 java.lang.Iterable<Node> nodes()
          Returns an iterable over the nodes.
 int srcCount()
          Returns the number of source nodes in the graph.
 java.lang.Iterable<java.lang.Integer> srcK()
          Returns an iterable over the out-degrees of the nodes in the graph.
 int srcK(Node n)
          Returns the out-degree of the given node.
 java.lang.Iterable<java.lang.Double> srcS()
          Returns an iterable over the out-strengths of the nodes in the graph.
 double srcS(Node n)
          Returns the out-strength of the given node.
 double statClustering()
          Returns the mean clustering coefficient of the graph.
 double statDiameter()
          Returns the largest finite diameter within the graph.
 double statDstKPower()
          Returns an estimated power-law fit for in-degree.
 double statModularity()
          Returns a modularity measure for the graph.
 double statPathLength()
          Returns the mean path length within the components of the graph.
 double statSrcKPower()
          Returns an estimated power-law fit for out-degree.
 Graph trustedGraph()
          Returns the trusted subset of the graph.
 double weight(Edge e)
          Returns the total weight of the given edge.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

pc

static org.gephi.project.api.ProjectController pc
the project controller is our source of new graph models


colNodeType

int colNodeType
the columns in which we store Klatsch's private attributes


colNodeId

int colNodeId

colEdgeStartTime

int colEdgeStartTime

colEdgeEndTime

int colEdgeEndTime

colEdgeWeight

int colEdgeWeight

colEdgeTrust

int colEdgeTrust

gGraph

org.gephi.graph.api.DirectedGraph gGraph
the actual graph


gModel

org.gephi.graph.api.GraphModel gModel
the model for the graph


gAttributeModel

org.gephi.data.attributes.api.AttributeModel gAttributeModel
the attribute model for the graph

Constructor Detail

GephiGraph

public GephiGraph()
Basic constructor for an empty graph.

Method Detail

actorGraph

public Graph actorGraph()
Returns the subgraph containing only actors and actor-actor edges.

Specified by:
actorGraph in interface Graph

actorMemeGraph

public Graph actorMemeGraph()
Returns the subgraph containing only actor-meme and meme-actor edges.

Specified by:
actorMemeGraph in interface Graph

add

public void add(Edge e)
Adds the given edge to the graph.

Specified by:
add in interface Graph

component

public Graph component(int n)
Specified by:
component in interface Graph

componentCount

public int componentCount()
Returns the number of components in the graph.

Specified by:
componentCount in interface Graph

componentSize

public int[] componentSize()
Returns an array containing the size of each component in the graph.

Specified by:
componentSize in interface Graph

dstCount

public int dstCount()
Returns the number of destination nodes in the graph.

Specified by:
dstCount in interface Graph

dstK

public java.lang.Iterable<java.lang.Integer> dstK()
Returns an iterable over the in-degrees of the nodes in the graph.

Specified by:
dstK in interface Graph

dstK

public int dstK(Node n)
Returns the in-degree of the given node.

Specified by:
dstK in interface Graph

dstS

public java.lang.Iterable<java.lang.Double> dstS()
Returns an iterable over the in-strengths of the nodes in the graph.

Specified by:
dstS in interface Graph

dstS

public double dstS(Node n)
Returns the in-strength of the given node.

Specified by:
dstS in interface Graph

edgeCount

public int edgeCount()
Returns the total number of edges.

Specified by:
edgeCount in interface Graph

edges

public java.lang.Iterable<Edge> edges()
Returns an iterable over the edges.

Specified by:
edges in interface Graph

edgesIn

public java.lang.Iterable<Edge> edgesIn(Node n)
Returns an iterable over the edges with this node as a destination.

Specified by:
edgesIn in interface Graph

edgesOut

public java.lang.Iterable<Edge> edgesOut(Node n)
Returns an iterable over the edges with this node as a source.

Specified by:
edgesOut in interface Graph

export

public boolean export(java.lang.String path,
                      java.lang.String format)
Exports the graph in the given format.

Specified by:
export in interface Graph

getEdge

public Edge getEdge(Edge e)
Returns the given edge.

Specified by:
getEdge in interface Graph

getNode

public Node getNode(Node n)
Returns the given node.

Specified by:
getNode in interface Graph

hasEdge

public boolean hasEdge(Edge e)
Returns true if the given edge is part of the graph.

Specified by:
hasEdge in interface Graph

hasNode

public boolean hasNode(Node n)
Returns true if the given node is part of the graph.

Specified by:
hasNode in interface Graph

layout

public void layout(VDictionary config)
Uses the given configuration dictionary to perform layout on the graph. This is based on highly l33t Gephi code written by Snehal Patil (srpatil@umail.iu.edu). If it works well, it's to her credit. If it doesn't, it's because Mark messed it up.

Specified by:
layout in interface Graph

memeGraph

public Graph memeGraph()
Returns the subgraph containing only meme-meme edges.

Specified by:
memeGraph in interface Graph

nodeCount

public int nodeCount()
Returns the number of nodes in the graph.

Specified by:
nodeCount in interface Graph

nodes

public java.lang.Iterable<Node> nodes()
Returns an iterable over the nodes.

Specified by:
nodes in interface Graph

srcCount

public int srcCount()
Returns the number of source nodes in the graph.

Specified by:
srcCount in interface Graph

srcK

public java.lang.Iterable<java.lang.Integer> srcK()
Returns an iterable over the out-degrees of the nodes in the graph.

Specified by:
srcK in interface Graph

srcK

public int srcK(Node n)
Returns the out-degree of the given node.

Specified by:
srcK in interface Graph

srcS

public java.lang.Iterable<java.lang.Double> srcS()
Returns an iterable over the out-strengths of the nodes in the graph.

Specified by:
srcS in interface Graph

srcS

public double srcS(Node n)
Returns the out-strength of the given node.

Specified by:
srcS in interface Graph

statClustering

public double statClustering()
Returns the mean clustering coefficient of the graph.

Specified by:
statClustering in interface Graph

statDiameter

public double statDiameter()
Returns the largest finite diameter within the graph. (?)

Specified by:
statDiameter in interface Graph

statDstKPower

public double statDstKPower()
Returns an estimated power-law fit for in-degree.

Specified by:
statDstKPower in interface Graph

statModularity

public double statModularity()
Returns a modularity measure for the graph. (?)

Specified by:
statModularity in interface Graph

statPathLength

public double statPathLength()
Returns the mean path length within the components of the graph. (?)

Specified by:
statPathLength in interface Graph

statSrcKPower

public double statSrcKPower()
Returns an estimated power-law fit for out-degree.

Specified by:
statSrcKPower in interface Graph

trustedGraph

public Graph trustedGraph()
Returns the trusted subset of the graph.

Specified by:
trustedGraph in interface Graph

weight

public double weight(Edge e)
Returns the total weight of the given edge. Returns zero if there is no such edge.

Specified by:
weight in interface Graph