Class GraphAnalyzer

java.lang.Object
es.uam.eps.ir.relison.examples.sna.GraphAnalyzer

public class GraphAnalyzer
extends java.lang.Object
Program that given a network (and, if available, some community partitions), computes several properties of the network.
  • Constructor Summary

    Constructors 
    Constructor Description
    GraphAnalyzer()  
  • Method Summary

    Modifier and Type Method Description
    static void main​(java.lang.String[] args)
    Program which analyzes the different properties of a graph.
    (package private) static void printGlobalMetrics​(java.lang.String file, java.util.Map<java.lang.String,​java.lang.Double> values)
    Prints the global metric values into a file.
    (package private) static void printIndividualCommMetric​(java.lang.String file, java.util.Map<java.lang.Integer,​java.lang.Double> values)
    Prints the different values for an individual community metric in a file.
    (package private) static void printIndividualMetric​(java.lang.String file, java.util.Map<java.lang.Long,​java.lang.Double> values)
    Prints the different values for an individual metric in a file.
    (package private) static void printPairMetric​(java.lang.String file, java.util.Map<Pair<java.lang.Long>,​java.lang.Double> values)
    Prints the different values for a pair/edge metric in a file.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

  • Method Details

    • main

      public static void main​(java.lang.String[] args) throws java.io.IOException
      Program which analyzes the different properties of a graph.
      Parameters:
      args - Execution arguments
      1. Graph file: File containing the graph to analyze
      2. Metric grid: Grid file containing all the metrics we want to compute
      3. Multigraph: true if the graph is a multigraph, false if not
      4. Directed: true if the graph is directed, false if not
      5. Weighted: true if the graph is directed, false if not
      6. Comm. Route The path which contains the community files
      7. Comm. files: A comma separated list of community files for the graph
      8. Output folder: Folder for storing the different outcomes
      9. Optional:
        • -communities commFile1,commFile2... : a comma separated list of the files containing communities.
        • --distances: include if we want to precompute distance metrics (recommended if any is used)
      Throws:
      java.io.IOException - if something fails while reading / writing.
    • printIndividualMetric

      static void printIndividualMetric​(java.lang.String file, java.util.Map<java.lang.Long,​java.lang.Double> values)
      Prints the different values for an individual metric in a file. Values are ordered by node identifier.
      Parameters:
      file - the route of the file.
      values - the values of the vertex metric.
    • printIndividualCommMetric

      static void printIndividualCommMetric​(java.lang.String file, java.util.Map<java.lang.Integer,​java.lang.Double> values)
      Prints the different values for an individual community metric in a file. Values are ordered by node identifier.
      Parameters:
      file - the route of the file.
      values - the values of the individual community metric.
    • printPairMetric

      static void printPairMetric​(java.lang.String file, java.util.Map<Pair<java.lang.Long>,​java.lang.Double> values)
      Prints the different values for a pair/edge metric in a file. Values are ordered by node identifier.
      Parameters:
      file - the route of the file.
      values - the values of the vertex metric.
    • printGlobalMetrics

      static void printGlobalMetrics​(java.lang.String file, java.util.Map<java.lang.String,​java.lang.Double> values)
      Prints the global metric values into a file.
      Parameters:
      file - the route to the file.
      values - the metric values.