August 28, 2024

P88 - Connected components.

Write a function that splits a graph into its connected components.

scala

scala> Graph.fromString("[a-b, c]").splitGraph
res0: List[Graph[String,Unit]] = List([a-b], [c])
Be first to comment
Leave a reply