We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent c082385 commit d760bc7Copy full SHA for d760bc7
graphx/src/main/scala/org/apache/spark/graphx/util/GraphGenerators.scala
@@ -133,6 +133,12 @@ object GraphGenerators {
133
// This ensures that the 4 quadrants are the same size at all recursion levels
134
val numVertices = math.round(
135
math.pow(2.0, math.ceil(math.log(requestedNumVertices) / math.log(2.0)))).toInt
136
+ val numEdgesUpperBound =
137
+ math.pow(2.0, 2 * ((math.log(numVertices) / math.log(2.0)) - 1)).toInt
138
+ if (numEdgesUpperBound < numEdges) {
139
+ throw new IllegalArgumentException("R-MAT accepts " + numEdgesUpperBound
140
+ + " or less numEdges when numVertices is " + numVertices)
141
+ }
142
var edges: Set[Edge[Int]] = Set()
143
while (edges.size < numEdges) {
144
if (edges.size % 100 == 0) {
0 commit comments