Class SampleDistanceCumulativeDistributionFunction
- java.lang.Object
-
- it.unimi.dsi.webgraph.algo.SampleDistanceCumulativeDistributionFunction
-
public class SampleDistanceCumulativeDistributionFunction extends java.lang.Object
Samples a graph via breadth-first visits.Performance issues
This class uses an instance of
ParallelBreadthFirstVisit
to ensure a high degree of parallelism (see its documentation for memory requirements).
-
-
Constructor Summary
Constructors Constructor Description SampleDistanceCumulativeDistributionFunction()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static void
main(java.lang.String[] arg)
protected static int[][]
sample(ImmutableGraph graph, int k, boolean naive, int threads)
Samples a graph via breadth-first visits.protected static int[][]
sample(ImmutableGraph graph, int k, int threads)
Samples a graph via breadth-first visits.
-
-
-
Method Detail
-
sample
protected static int[][] sample(ImmutableGraph graph, int k, int threads)
Samples a graph via breadth-first visits.This method will estimate the cumulative distribution function of distances of a strongly connected graph. to which a randomly extracted node belongs. If there is more than one connected component, a warning will be given, specifying the size of the component. An
IllegalStateException
will be thrown if the algorithm detects that the graph is not strongly connected, but this is not guaranteed to happen.- Parameters:
graph
- a graph.k
- a number of samples.threads
- the requested number of threads (0 forRuntime.availableProcessors()
).- Returns:
- an array of samples.
-
sample
protected static int[][] sample(ImmutableGraph graph, int k, boolean naive, int threads)
Samples a graph via breadth-first visits.This method will estimate the cumulative distribution function of distances of a strongly connected graph. If there is more than one connected component, a warning will be given, specifying the size of the component. An
IllegalStateException
will be thrown if the algorithm detects that the graph is not strongly connected, but this is not guaranteed to happen.- Parameters:
graph
- a graph.k
- a number of samples.naive
- sample naively: do not stop sampling even when detecting the lack of strong connection.threads
- the requested number of threads (0 forRuntime.availableProcessors()
).- Returns:
- an array of samples.
-
main
public static void main(java.lang.String[] arg) throws java.io.IOException, com.martiansoftware.jsap.JSAPException
- Throws:
java.io.IOException
com.martiansoftware.jsap.JSAPException
-
-