Graph edges filter returning a Set[Graph] instead of Set[Edge] ?

37 views
Skip to first unread message

Jose Tharail

unread,
Oct 6, 2020, 4:01:32 PM10/6/20
to scala-graph
Hi,

Thanks for the scala graph library !

I am using version 1.12.5 for compatibility with Spark.

 I created a graph (weighted undirected) and am iterating through the subgraphs using componentTraverser. 

 Then for each subgraph I am finding the minimum weight and then finding  the edges with minimum weight and removing those edges  to create more subgraphs ( will be recursive )

When I am trying to get the minimum edges using this code 

val minEdges = g1.edges.filter(edge => edge.weight == minWeight )

As per documentation it should return Set[g.EdgeT] 
but its giving Set[Graph] am I missing something here ?


Thanks,

Jose

Peter Empen

unread,
Oct 9, 2020, 11:50:34 AM10/9/20
to scala-graph
Hi Jose,

I've just tried a simple example and the documentation seems to be correct:).

What is the type of g1? How do you know that minEdges has a type of Set[Graph]?

Otherwise please get back with a small working https://scastie.scala-lang.org demo or something similar.
Reply all
Reply to author
Forward
0 new messages