public static class SemiClustering.SemiCluster extends Object implements Comparable<SemiClustering.SemiCluster>
Constructor and Description |
---|
SemiCluster()
Constructor: Create a new empty Cluster.
|
SemiCluster(SemiClustering.SemiCluster cluster)
Constructor: Initialize a new Cluster.
|
Modifier and Type | Method and Description |
---|---|
void |
addVertex(VertexWithValue<Long,Set<SemiClustering.SemiCluster>> vertex,
Iterable<EdgeWithValue<Long,Double>> edges,
double scoreFactor)
Adds a vertex to the cluster.
|
int |
compareTo(SemiClustering.SemiCluster other)
Two semi clusters are the same when:
(i) they have the same number of vertices,
(ii) all their vertices are the same
|
boolean |
equals(Object o) |
int |
hashCode() |
int |
size()
Returns size of semi cluster list.
|
String |
toString() |
public SemiCluster()
public SemiCluster(SemiClustering.SemiCluster cluster)
cluster
- cluster object to initialize the new objectpublic final void addVertex(VertexWithValue<Long,Set<SemiClustering.SemiCluster>> vertex, Iterable<EdgeWithValue<Long,Double>> edges, double scoreFactor)
Every time a vertex is added we also update the inner and boundary score. Because vertices are only added to a semi-cluster, we can save the inner and boundary scores and update them incrementally.
Otherwise, in order to re-compute it from scratch we would need every vertex to send a friends-of-friends list, which is very expensive.
vertex
- The new vertex to be added into the clusteredges
- The edges of the vertexscoreFactor
- Boundary Edge Score Factorpublic final int size()
public final int compareTo(SemiClustering.SemiCluster other)
compareTo
in interface Comparable<SemiClustering.SemiCluster>
other
- Cluster to be compared with current clusterCopyright © 2020. All rights reserved.