bcds.phison.gm
Class SymmetryRatio<V,E>

java.lang.Object
  extended by bcds.phison.gm.GraphMetricBase<V,E>
      extended by bcds.phison.gm.Diameter<V,E>
          extended by bcds.phison.gm.SymmetryRatio<V,E>
All Implemented Interfaces:
GraphMetric<V,E>, WithEnvParams

public class SymmetryRatio<V,E>
extends Diameter<V,E>
implements GraphMetric<V,E>

Computes the symmetry ratio of a topology as a GraphMetric. Symmetry ratio is calculated as: \frac{Number of distinct eigenvalues}{Diameter+1}

Reference: A. H. Dekker and B. Colbert, "The symmetry ratio of a network," in Proceedings of the 2005 Australasian symposium on Theory of computing - Volume 41, ser. CATS ’05. Darlinghurst, Australia, Australia: Australian Computer Society, Inc., 2005, pp. 13–20.

Author:
mmanzano

Constructor Summary
SymmetryRatio()
          Default constructor.
SymmetryRatio(SimGraph<V,E> g, Environ env)
          Creates a new instance and calls setup to complete the initialization.
 
Method Summary
 org.jblas.FloatMatrix createAdjacencyMatrix()
          Creates the adjacency matrix of the graph
 java.lang.String getDescription()
          Returns a string describing the metric, for example, article where it has been published, URL where to find reference implementation, etc.
 double getGraphMetric()
          Returns the symmetry ratio of the topology.
 java.lang.String getLabel()
          Returns "Symmetry ratio".
 boolean isApplicableTo(MetricTarget m)
          Returns true if m is MetricTarget.GRAPH.
 
Methods inherited from class bcds.phison.gm.Diameter
getAvgShortestPath, getAvgShortestPathStdev, getEnvParams, getLongestPath, run, setup
 
Methods inherited from class bcds.phison.gm.GraphMetricBase
dump, getEdgeMetric, getEnviron, getGraph, getGraphMetricStdev, getName, getNodeMetric
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface bcds.phison.gm.GraphMetric
dump, getEdgeMetric, getGraphMetricStdev, getNodeMetric, run, setup
 
Methods inherited from interface bcds.phison.WithEnvParams
getEnviron, getEnvParams, getName
 

Constructor Detail

SymmetryRatio

public SymmetryRatio()
Default constructor.


SymmetryRatio

public SymmetryRatio(SimGraph<V,E> g,
                     Environ env)
Creates a new instance and calls setup to complete the initialization.

Method Detail

isApplicableTo

public boolean isApplicableTo(MetricTarget m)
Returns true if m is MetricTarget.GRAPH.

Specified by:
isApplicableTo in interface GraphMetric<V,E>
Overrides:
isApplicableTo in class Diameter<V,E>

getGraphMetric

public double getGraphMetric()
Returns the symmetry ratio of the topology.

Specified by:
getGraphMetric in interface GraphMetric<V,E>
Overrides:
getGraphMetric in class Diameter<V,E>

createAdjacencyMatrix

public org.jblas.FloatMatrix createAdjacencyMatrix()
Creates the adjacency matrix of the graph


getLabel

public java.lang.String getLabel()
Returns "Symmetry ratio".

Specified by:
getLabel in interface GraphMetric<V,E>
Overrides:
getLabel in class Diameter<V,E>

getDescription

public java.lang.String getDescription()
Description copied from interface: GraphMetric
Returns a string describing the metric, for example, article where it has been published, URL where to find reference implementation, etc.

Specified by:
getDescription in interface GraphMetric<V,E>
Overrides:
getDescription in class Diameter<V,E>