Interface Specification
UndirectedGraph
Function | Description | Parallel |
isDirected : False | | No |
numNodes: Int | Returns number of nodes. | No |
numEdges: Int | Returns number of edges. | No |
totalWeight : Double | Total weight of graph. | Yes |
weightedDegree(Node) : Double | Total degree of nodes edges. | Yes |
numSelfLoops(Node) : Double | Number of self loops. | No |
degree(Node) : MInt | Number of edges to/from node. | No |
nodes: NodeIdView | Gives view of integers from 0:numNodes. | No |
neighbors(Node): NeighborView | Returns neighborhood of a node. | No |
foreachNode(Node => Unit) : Unit | | Yes |
mapNodes(Node => R) : NodeData(R) | | Yes |
getExternalID(Node) : Int | Returns the external ID of node. | No |
commonNeighbors(Node,Node) : Long | Counts the number of common neighbors between two nodes. | No |
getNeighborsAndWeights(Node) : Tup2(NeighborView(MInt),NeighborView(Double)) | Returns views of neighbors and respective weights. | No |
DirectedGraph
Function | Description | Parallel |
isDirected : True | | No |
numNodes: Int | Returns number of nodes. | No |
numEdges: Int | Returns number of edges. | No |
outDegree(Node) : MInt | Number of outgoing edges | No |
inDegree(Node) : MInt | Number of incoming edges | No |
outNeighbors(Node): NeighborView | Returns neighborhood of a outgoing edges. | No |
inNeighbors(Node): NeighborView | Returns neighborhood of a incoming edges. | No |
foreachNode(Node => Unit) : Unit | | Yes |
mapNodes(Node => R) : NodeData(R) | | Yes |
getExternalID(Node) : Int | Returns the external ID of node. | No |
Provided Functions
Function | Description | Parallel |
sumOverNodes(NodeIdView)(Node => R) : R | Sums over the neighbors of a node. | Yes |
sumOverNeighbors(NeighborView)(Node => R) : R | Sums over the neighbors of a node. | Yes |
NodeData(T)
Function | Description | Parallel |
apply(Int) : T | Return element at index. | No |
apply(Node) : T | Return element at node id. | No |
update(Int,T) : Unit | Write element at index. | |
append(T) : Unit | Append Element. | No. |
getRawArray : Array(T) | Access raw data. | No |
getRawArrayBuffer : ArrayBuffer(T) | Access raw data. | No |
resize(MInt) : Unit | Resize array to specified length. | No |
concat(NodeData(T)) : Unit | Append NodeData to self. | No |
-(NodeData(T)) : NodeData(T) | NodeData subtract. | Yes |
+(NodeData(T)) : NodeData(T) | NodeData addition. | Yes |
pack(NodeData(T)) : NodeData(T) | Zip elems to tuples. | Yes |
map((T => R) : NodeData(R)) | Map elems. | Yes |
flatMap(T => NodeData(R) : NodeData(R)) | Flatmap elems. | Yes |
foreach(T => Unit) : Unit | Foreach elem. | Yes |
reduce(((T,T) => T) : T) | Reduce elems. | Yes. |
groupBy((T => K, T => V) : HashMap(K, ArrayBuffer(V))) | Group By | Yes |
groupByReduce((T => K, T => V, (V,V) => V)) : HashMap(K,V) | GroupByReduce | Yes |
mapreduce(T => R, (R,R) => R, T => Boolean) | map reduce | Yes |
distinct : NodeData(T) | Return collection with distinc elements. | No |
sort : NodeData(R) | Return sorted collection. | No |
sortBy(Int => R) : NodeData(T) | Sort collection by function. | No |
sortIndiciesBy(Int => R) : NodeData(T) | Sort indices by. | No |
print : Unit | Prints elems in collection. | No |
forloop(Int => Unit) : Unit | Serial for loop. | Yes |
Specification page still under construction!