layout: global type: “page singular” title: GraphX description: GraphX is Apache Spark's API for graphs and graph-parallel computation, with a built-in library of common algorithms. subproject: GraphX

<div style="margin-top: 15px; text-align: left; display: inline-block;">
  <div class="code">
    graph = <span class="sparkop">Graph</span>(vertices, edges)<br/>
    messages = spark.textFile(<span class="string">"hdfs://..."</span>)<br/>
    graph2 = graph.<span class="sparkop">joinVertices</span>(messages) {<br/>
    &nbsp;&nbsp;<span class="closure">(id, vertex, msg) => ...</span><br/>
    }
  </div>
  <div class="caption">Using GraphX in Scala</div>
</div>