object Graph extends Serializable
The Graph object contains a collection of routines used to construct graphs from RDDs.
- Source
- Graph.scala
- Alphabetic
- By Inheritance
- Graph
- Serializable
- Serializable
- AnyRef
- Any
- Hide All
- Show All
- Public
- All
Value Members
-
def
apply[VD, ED](vertices: RDD[(VertexId, VD)], edges: RDD[Edge[ED]], defaultVertexAttr: VD = null.asInstanceOf[VD], edgeStorageLevel: StorageLevel = StorageLevel.MEMORY_ONLY, vertexStorageLevel: StorageLevel = StorageLevel.MEMORY_ONLY)(implicit arg0: ClassTag[VD], arg1: ClassTag[ED]): Graph[VD, ED]
Construct a graph from a collection of vertices and edges with attributes.
Construct a graph from a collection of vertices and edges with attributes. Duplicate vertices are picked arbitrarily and vertices found in the edge collection but not in the input vertices are assigned the default attribute.
- VD
the vertex attribute type
- ED
the edge attribute type
- vertices
the "set" of vertices and their attributes
- edges
the collection of edges in the graph
- defaultVertexAttr
the default vertex attribute to use for vertices that are mentioned in edges but not in vertices
- edgeStorageLevel
the desired storage level at which to cache the edges if necessary
- vertexStorageLevel
the desired storage level at which to cache the vertices if necessary
-
def
fromEdgeTuples[VD](rawEdges: RDD[(VertexId, VertexId)], defaultValue: VD, uniqueEdges: Option[PartitionStrategy] = None, edgeStorageLevel: StorageLevel = StorageLevel.MEMORY_ONLY, vertexStorageLevel: StorageLevel = StorageLevel.MEMORY_ONLY)(implicit arg0: ClassTag[VD]): Graph[VD, Int]
Construct a graph from a collection of edges encoded as vertex id pairs.
Construct a graph from a collection of edges encoded as vertex id pairs.
- rawEdges
a collection of edges in (src, dst) form
- defaultValue
the vertex attributes with which to create vertices referenced by the edges
- uniqueEdges
if multiple identical edges are found they are combined and the edge attribute is set to the sum. Otherwise duplicate edges are treated as separate. To enable
uniqueEdges
, a PartitionStrategy must be provided.- edgeStorageLevel
the desired storage level at which to cache the edges if necessary
- vertexStorageLevel
the desired storage level at which to cache the vertices if necessary
- returns
a graph with edge attributes containing either the count of duplicate edges or 1 (if
uniqueEdges
isNone
) and vertex attributes containing the total degree of each vertex.
-
def
fromEdges[VD, ED](edges: RDD[Edge[ED]], defaultValue: VD, edgeStorageLevel: StorageLevel = StorageLevel.MEMORY_ONLY, vertexStorageLevel: StorageLevel = StorageLevel.MEMORY_ONLY)(implicit arg0: ClassTag[VD], arg1: ClassTag[ED]): Graph[VD, ED]
Construct a graph from a collection of edges.
Construct a graph from a collection of edges.
- edges
the RDD containing the set of edges in the graph
- defaultValue
the default vertex attribute to use for each vertex
- edgeStorageLevel
the desired storage level at which to cache the edges if necessary
- vertexStorageLevel
the desired storage level at which to cache the vertices if necessary
- returns
a graph with edge attributes described by
edges
and vertices given by all vertices inedges
with valuedefaultValue
-
implicit
def
graphToGraphOps[VD, ED](g: Graph[VD, ED])(implicit arg0: ClassTag[VD], arg1: ClassTag[ED]): GraphOps[VD, ED]
Implicitly extracts the GraphOps member from a graph.