Package ons.util
Class WeightedGraphMultiWeight
java.lang.Object
ons.util.WeightedGraphMultiWeight
public class WeightedGraphMultiWeight
extends java.lang.Object
This graphs shows the reach of each node in each modulation level to all nodes in topology.
If the node is unreachable in modulation level then the edge's weight is 0.
-
Constructor Summary
Constructors Constructor Description WeightedGraphMultiWeight(int n, int levels)
WeightedGraphMultiWeight(WeightedGraphMultiWeight g)
-
Method Summary
Modifier and Type Method Description void
addEdge(int source, int target, double w, int level)
double
getClusteringCoefficient(int node, int level)
Retrieves the clustering coefficient of this node.WeightedGraphMultiWeightEdge
getEdge(int src, int dst)
double
getGraphDiameter(int level)
Retrieves the diameter of this graph.int
getLevels()
double
getWeight(int source, int target, int level)
boolean
isEdge(int source, int target, int level)
int[]
neighbors(int vertex, int level)
void
removeEdge(int source, int target, int level)
void
removeNode(int node)
void
removeNodeEdge(int node)
void
removeNodeEdge(int node, int level)
int
size()
java.lang.String
toString()
-
Constructor Details
-
WeightedGraphMultiWeight
public WeightedGraphMultiWeight(int n, int levels) -
WeightedGraphMultiWeight
-
-
Method Details
-
size
public int size() -
getLevels
public int getLevels() -
addEdge
public void addEdge(int source, int target, double w, int level) -
isEdge
public boolean isEdge(int source, int target, int level) -
removeEdge
public void removeEdge(int source, int target, int level) -
getWeight
public double getWeight(int source, int target, int level) -
getEdge
-
neighbors
public int[] neighbors(int vertex, int level) -
toString
public java.lang.String toString()- Overrides:
toString
in classjava.lang.Object
-
removeNodeEdge
public void removeNodeEdge(int node, int level) -
removeNodeEdge
public void removeNodeEdge(int node) -
removeNode
public void removeNode(int node) -
getGraphDiameter
public double getGraphDiameter(int level)Retrieves the diameter of this graph.- Parameters:
level
- the edge level- Returns:
- the longest of all the calculated shortest paths in a network
-
getClusteringCoefficient
public double getClusteringCoefficient(int node, int level)Retrieves the clustering coefficient of this node. The clustering coefficient of a node is the ratio of existing links connecting a node's neighbors to each other to the maximum possible number of such links.- Parameters:
node
- the nodelevel
- the modulation level- Returns:
- the clustering coefficient
-