Hi folks,
I want to partition a graph into several partitions using groupBy based on a certain node (outer type) attribute.
I am assuming I can use groupBy for that task.
Still and for some reason, I am not able to perform a groupBy on a graph, as I run into a type mismatch:
Minimal reproducing example
import scalax.collection.GraphPredef._
import scalax.collection.GraphEdge._
import scalax.collection.Graphval h = Graph("2"~>"3", "3"~>"1", "5")
val r1: Map[Boolean, Graph[String, DiEdge]] = h.groupBy((i:String) => true )
// both r2 and r3 yields type mismatch, similar:
// [error] found : String => String
// [error] required: scalax.collection.GraphPredef.Param[String,scalax.collection.GraphEdge.UnDiEdge] => ?
val r2 = h.groupBy( (i:String) => i.toInt )
val r3: Map[Int, Graph[String, DiEdge]] = h.groupBy[Int]( (i:String) => i.toInt )
Any ideas, why r1 compiles, but r2 and r3 do not?
I suspect the implicit resolution from Param type into OuterNode type to be responsible?
Many thanks and cheers,
Martin