Package org.apache.spark.graphx.util
Class GraphGenerators
Object
org.apache.spark.graphx.util.GraphGenerators
A collection of graph generating functions.
- 
Constructor SummaryConstructors
- 
Method SummaryModifier and TypeMethodDescriptiongenerateRandomEdges(int src, int numEdges, int maxVertexId, long seed) gridGraph(SparkContext sc, int rows, int cols) Createrowsbycolsgrid graph with each vertex connected to its row+1 and col+1 neighbors.logNormalGraph(SparkContext sc, int numVertices, int numEParts, double mu, double sigma, long seed) Generate a graph whose vertex out degree distribution is log normal.static org.apache.spark.internal.Logging.LogStringContextLogStringContext(scala.StringContext sc) static org.slf4j.Loggerstatic voidorg$apache$spark$internal$Logging$$log__$eq(org.slf4j.Logger x$1) static doubleRMATa()static doubleRMATb()static doubleRMATc()static doubleRMATd()rmatGraph(SparkContext sc, int requestedNumVertices, int numEdges) A random graph generator using the R-MAT model, proposed in "R-MAT: A Recursive Model for Graph Mining" by Chakrabarti et al.starGraph(SparkContext sc, int nverts) Create a star graph with vertex 0 being the center.
- 
Constructor Details- 
GraphGeneratorspublic GraphGenerators()
 
- 
- 
Method Details- 
RMATapublic static double RMATa()
- 
RMATbpublic static double RMATb()
- 
RMATdpublic static double RMATd()
- 
logNormalGraphpublic static Graph<Object,Object> logNormalGraph(SparkContext sc, int numVertices, int numEParts, double mu, double sigma, long seed) Generate a graph whose vertex out degree distribution is log normal.The default values for mu and sigma are taken from the Pregel paper: Grzegorz Malewicz, Matthew H. Austern, Aart J.C Bik, James C. Dehnert, Ilan Horn, Naty Leiser, and Grzegorz Czajkowski. 2010. Pregel: a system for large-scale graph processing. SIGMOD '10. If the seed is -1 (default), a random seed is chosen. Otherwise, use the user-specified seed. - Parameters:
- sc- Spark Context
- numVertices- number of vertices in generated graph
- numEParts- (optional) number of partitions
- mu- (optional, default: 4.0) mean of out-degree distribution
- sigma- (optional, default: 1.3) standard deviation of out-degree distribution
- seed- (optional, default: -1) seed for RNGs, -1 causes a random seed to be chosen
- Returns:
- Graph object
 
- 
RMATcpublic static double RMATc()
- 
generateRandomEdges
- 
rmatGraphpublic static Graph<Object,Object> rmatGraph(SparkContext sc, int requestedNumVertices, int numEdges) A random graph generator using the R-MAT model, proposed in "R-MAT: A Recursive Model for Graph Mining" by Chakrabarti et al.See http://www.cs.cmu.edu/~christos/PUBLICATIONS/siam04.pdf. - Parameters:
- sc- (undocumented)
- requestedNumVertices- (undocumented)
- numEdges- (undocumented)
- Returns:
- (undocumented)
 
- 
gridGraphpublic static Graph<scala.Tuple2<Object,Object>, gridGraphObject> (SparkContext sc, int rows, int cols) Createrowsbycolsgrid graph with each vertex connected to its row+1 and col+1 neighbors. Vertex ids are assigned in row major order.- Parameters:
- sc- the spark context in which to construct the graph
- rows- the number of rows
- cols- the number of columns
- Returns:
- A graph containing vertices with the row and column ids as their attributes and edge values as 1.0.
 
- 
starGraphCreate a star graph with vertex 0 being the center.- Parameters:
- sc- the spark context in which to construct the graph
- nverts- the number of vertices in the star
- Returns:
- A star graph containing nvertsvertices with vertex 0 being the center vertex.
 
- 
org$apache$spark$internal$Logging$$log_public static org.slf4j.Logger org$apache$spark$internal$Logging$$log_()
- 
org$apache$spark$internal$Logging$$log__$eqpublic static void org$apache$spark$internal$Logging$$log__$eq(org.slf4j.Logger x$1) 
- 
LogStringContextpublic static org.apache.spark.internal.Logging.LogStringContext LogStringContext(scala.StringContext sc) 
 
-