Package it.unimi.dsi.big.webgraph
Class Stats
- java.lang.Object
-
- it.unimi.dsi.big.webgraph.Stats
-
public class Stats extends java.lang.ObjectComputes basic statistical data about a given graph.This class loads a graph of given basename, and computes the following data:
- an ASCII file containing the outdegree distribution; line n contains the number of nodes with outdegree n (starting from 0);
- an ASCII file containing the indegree distribution; line n contains the number of nodes with indegree n (starting from 0);
- a property file containing several self-descriptive data, such as the average indegree/outdegree (which should be identical), sample nodes with minimum
or maximum indegree/outdegree, and so on; additional data will be computed if files produced by
StronglyConnectedComponentsare present with the same basename (in particular, buckets and component sizes); - if files produced by
StronglyConnectedComponentsare present with the same basename, an ASCII file containing the distribution of strongly connected components, specified as a sequence of lines each containing a pair of integer <size, count>.
The graph is loaded offline: the only memory allocated is for indegree count (one integer per node) and for storing the actual counts (one integer per indegree/outdegree value).
-
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static voidmain(java.lang.String[] arg)static voidrun(ImmutableGraph graph, it.unimi.dsi.bits.LongArrayBitVector buckets, long[][] sccsize, java.lang.CharSequence resultsBasename, boolean saveDegrees, it.unimi.dsi.logging.ProgressLogger pl)Computes stats for the given graph using a single traversal, storing the results in files with given basename.static voidrun(ImmutableGraph graph, it.unimi.dsi.bits.LongArrayBitVector buckets, long[][] sccsize, java.lang.CharSequence resultsBasename, it.unimi.dsi.logging.ProgressLogger pl)Computes stats for the given graph using a single traversal, storing the results in files with given basename.
-
-
-
Method Detail
-
run
public static void run(ImmutableGraph graph, it.unimi.dsi.bits.LongArrayBitVector buckets, long[][] sccsize, java.lang.CharSequence resultsBasename, it.unimi.dsi.logging.ProgressLogger pl) throws java.io.IOException
Computes stats for the given graph using a single traversal, storing the results in files with given basename.- Parameters:
graph- the graph to be examined.buckets- the set of buckets of this graph, ornullif this information is not available.sccsize- the sizes of strongly connected components as a big array, ornullif this information is not available.resultsBasename- the basename for result files (see the class description).pl- a progress logger.- Throws:
java.io.IOException
-
run
public static void run(ImmutableGraph graph, it.unimi.dsi.bits.LongArrayBitVector buckets, long[][] sccsize, java.lang.CharSequence resultsBasename, boolean saveDegrees, it.unimi.dsi.logging.ProgressLogger pl) throws java.io.IOException
Computes stats for the given graph using a single traversal, storing the results in files with given basename.- Parameters:
graph- the graph to be examined.buckets- the set of buckets of this graph, ornullif this information is not available.sccsize- the sizes of strongly connected components as a big array, ornullif this information is not available.resultsBasename- the basename for result files (see the class description).saveDegrees- if true, indegrees and outdegrees will be saved.pl- a progress logger.- Throws:
java.io.IOException
-
main
public static void main(java.lang.String[] arg) throws java.lang.IllegalArgumentException, java.lang.SecurityException, java.lang.IllegalAccessException, java.lang.reflect.InvocationTargetException, java.lang.NoSuchMethodException, com.martiansoftware.jsap.JSAPException, java.io.IOException, java.lang.ClassNotFoundException- Throws:
java.lang.IllegalArgumentExceptionjava.lang.SecurityExceptionjava.lang.IllegalAccessExceptionjava.lang.reflect.InvocationTargetExceptionjava.lang.NoSuchMethodExceptioncom.martiansoftware.jsap.JSAPExceptionjava.io.IOExceptionjava.lang.ClassNotFoundException
-
-