public class ClusteringCoefficient extends Object implements Statistics, LongTask
Modifier and Type | Field and Description |
---|---|
private double |
avgClusteringCoeff
The avergage Clustering Coefficient.
|
static String |
CLUSTERING_COEFF |
private boolean |
isCanceled
Indicates statistics should stop processing/
|
private boolean |
isDirected
Indicates should treat graph as undirected.
|
private int |
K |
private int |
N |
private ArrayWrapper[] |
network |
private double[] |
nodeClustering |
private ProgressTicket |
progress
Keeps track of Progress made.
|
private int |
totalTriangles |
private int[] |
triangles |
Constructor and Description |
---|
ClusteringCoefficient() |
Modifier and Type | Method and Description |
---|---|
private double |
bruteForce(org.gephi.graph.api.Graph hgraph) |
boolean |
cancel()
Cancel the task.
|
private int |
closest_in_array(ArrayWrapper[] currentNetwork,
int v) |
HashMap<String,Double> |
computeClusteringCoefficient(org.gephi.graph.api.Graph hgraph,
ArrayWrapper[] currentNetwork,
int[] currentTriangles,
double[] currentNodeClustering,
boolean directed) |
private float |
computeNodeClusteringCoefficient(org.gephi.graph.api.Graph hgraph,
org.gephi.graph.api.Node node,
boolean directed) |
private int |
computeRemainingTrianles(org.gephi.graph.api.Graph hgraph,
ArrayWrapper[] currentNetwork,
int[] currentTriangles,
int currentProgress) |
private HashMap<String,Double> |
computeResultValues(org.gephi.graph.api.Graph hgraph,
ArrayWrapper[] currentNetwork,
int[] currentTriangles,
double[] currentNodeClusterig,
boolean directed,
int currentProgress) |
private HashMap<String,Double> |
computeTriangles(org.gephi.graph.api.Graph hgraph,
ArrayWrapper[] currentNetwork,
int[] currentTriangles,
double[] nodeClustering,
boolean directed) |
int |
createIndiciesMapAndInitNetwork(org.gephi.graph.api.Graph hgraph,
HashMap<org.gephi.graph.api.Node,Integer> indicies,
ArrayWrapper[] networks,
int currentProgress) |
private HashMap<org.gephi.graph.api.Node,EdgeWrapper> |
createNeighbourTable(org.gephi.graph.api.Graph hgraph,
org.gephi.graph.api.Node node,
HashMap<org.gephi.graph.api.Node,Integer> indicies,
ArrayWrapper[] networks,
boolean directed) |
void |
execute(org.gephi.graph.api.Graph hgraph) |
void |
execute(org.gephi.graph.api.GraphModel graphModel)
Executes the statistics algorithm.
|
double |
getAverageClusteringCoefficient() |
double[] |
getCoefficientReuslts() |
private EdgeWrapper[] |
getEdges(HashMap<org.gephi.graph.api.Node,EdgeWrapper> neighborTable) |
String |
getReport()
Returns an HTML string that displays the statistics result.
|
double[] |
getTriangesReuslts() |
private float |
increaseCCifNesessary(org.gephi.graph.api.Graph hgraph,
org.gephi.graph.api.Node neighbor1,
org.gephi.graph.api.Node neighbor2,
boolean directed,
float nodeCC) |
private org.gephi.graph.api.Column |
initializeAttributeColunms(org.gephi.graph.api.GraphModel graphModel) |
void |
initStartValues(org.gephi.graph.api.Graph hgraph) |
boolean |
isDirected() |
private void |
newVertex(ArrayWrapper[] currentNetwork,
int[] currentTrianlgles,
int v,
int n) |
private int |
processNetwork(ArrayWrapper[] currentNetwork,
int currentProgress) |
private void |
saveCalculatedValue(org.gephi.graph.api.Node node,
org.gephi.graph.api.Column clusteringColumn,
double nodeClusteringCoefficient) |
void |
setDirected(boolean isDirected) |
void |
setProgressTicket(ProgressTicket ProgressTicket)
Set the progress ticket for the long task.
|
private void |
tr_link_nohigh(ArrayWrapper[] currentNetwork,
int[] currentTriangles,
int u,
int v,
int count,
int k) |
void |
triangles(org.gephi.graph.api.Graph hgraph) |
public static final String CLUSTERING_COEFF
private double avgClusteringCoeff
private boolean isDirected
private boolean isCanceled
private ProgressTicket progress
private int[] triangles
private ArrayWrapper[] network
private int K
private int N
private double[] nodeClustering
private int totalTriangles
public double getAverageClusteringCoefficient()
public void execute(org.gephi.graph.api.GraphModel graphModel)
Statistics
It is preferable to work on visible graphs, to be synchronized with the visualization.
execute
in interface Statistics
graphModel
- The graph modelpublic void execute(org.gephi.graph.api.Graph hgraph)
public void triangles(org.gephi.graph.api.Graph hgraph)
public HashMap<String,Double> computeClusteringCoefficient(org.gephi.graph.api.Graph hgraph, ArrayWrapper[] currentNetwork, int[] currentTriangles, double[] currentNodeClustering, boolean directed)
public void initStartValues(org.gephi.graph.api.Graph hgraph)
public int createIndiciesMapAndInitNetwork(org.gephi.graph.api.Graph hgraph, HashMap<org.gephi.graph.api.Node,Integer> indicies, ArrayWrapper[] networks, int currentProgress)
private int closest_in_array(ArrayWrapper[] currentNetwork, int v)
private void newVertex(ArrayWrapper[] currentNetwork, int[] currentTrianlgles, int v, int n)
v
- - The specific node to count the triangles on.private void tr_link_nohigh(ArrayWrapper[] currentNetwork, int[] currentTriangles, int u, int v, int count, int k)
private HashMap<org.gephi.graph.api.Node,EdgeWrapper> createNeighbourTable(org.gephi.graph.api.Graph hgraph, org.gephi.graph.api.Node node, HashMap<org.gephi.graph.api.Node,Integer> indicies, ArrayWrapper[] networks, boolean directed)
private EdgeWrapper[] getEdges(HashMap<org.gephi.graph.api.Node,EdgeWrapper> neighborTable)
private int processNetwork(ArrayWrapper[] currentNetwork, int currentProgress)
private int computeRemainingTrianles(org.gephi.graph.api.Graph hgraph, ArrayWrapper[] currentNetwork, int[] currentTriangles, int currentProgress)
private HashMap<String,Double> computeResultValues(org.gephi.graph.api.Graph hgraph, ArrayWrapper[] currentNetwork, int[] currentTriangles, double[] currentNodeClusterig, boolean directed, int currentProgress)
private HashMap<String,Double> computeTriangles(org.gephi.graph.api.Graph hgraph, ArrayWrapper[] currentNetwork, int[] currentTriangles, double[] nodeClustering, boolean directed)
private double bruteForce(org.gephi.graph.api.Graph hgraph)
private float increaseCCifNesessary(org.gephi.graph.api.Graph hgraph, org.gephi.graph.api.Node neighbor1, org.gephi.graph.api.Node neighbor2, boolean directed, float nodeCC)
private float computeNodeClusteringCoefficient(org.gephi.graph.api.Graph hgraph, org.gephi.graph.api.Node node, boolean directed)
private org.gephi.graph.api.Column initializeAttributeColunms(org.gephi.graph.api.GraphModel graphModel)
private void saveCalculatedValue(org.gephi.graph.api.Node node, org.gephi.graph.api.Column clusteringColumn, double nodeClusteringCoefficient)
public String getReport()
Statistics
getReport
in interface Statistics
public void setDirected(boolean isDirected)
public boolean isDirected()
public boolean cancel()
LongTask
true
if the task has been sucessfully cancelled, false
otherwise.public void setProgressTicket(ProgressTicket ProgressTicket)
LongTask
setProgressTicket
in interface LongTask
ProgressTicket
- the progress ticket for this taskpublic double[] getCoefficientReuslts()
public double[] getTriangesReuslts()
Copyright © 2007–2016 Gephi Consortium. All rights reserved.