title: Passing a function foreach key of an Array
body: <p>I have an array like that : </p>
  
  <pre><code>val pairs: Array[(Int, ((VertexId, Seq[Int]), Int))] 
  </code></pre>
  
  <p>which generates this output : </p>
  
  <pre><code>(11,((11,ArraySeq(2, 5, 4, 5)),1))
  (11,((12,ArraySeq(7, 7, 8, 2)),1))
  (11,((13,ArraySeq(5, 9, 8, 7)),1))
  (1,((1,ArraySeq(1, 2, 3, 4)),1))
  (1,((4,ArraySeq(1, 5, 1, 1)),1))
  </code></pre>
  
  <p>I want to build a Graph for each <code>pairs._1</code>. That means for example those who have the same id ( pairs._1 ) will construct a Graph together. 
  I am thinking about passing a function of Graph Construction to every id.
  How can I do that ?</p>