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.
-
Constructor Details
-
GraphAnalyzer
public GraphAnalyzer()
-
-
Method Details
-
main
public static void main(java.lang.String[] args) throws java.io.IOExceptionProgram which analyzes the different properties of a graph.- Parameters:
args
- Execution arguments- Graph file: File containing the graph to analyze
- Metric grid: Grid file containing all the metrics we want to compute
- Multigraph: true if the graph is a multigraph, false if not
- Directed: true if the graph is directed, false if not
- Weighted: true if the graph is directed, false if not
- Comm. Route The path which contains the community files
- Comm. files: A comma separated list of community files for the graph
- Output folder: Folder for storing the different outcomes
- 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.
-