Setup

Add the dependency to your build:

libraryDependencies += "com.flowtick" %% "graphs-core" % "0.8.0"

Using the ammonite REPL you can quickly play around with graphs:

import $ivy.`com.flowtick:graphs-core_2.13:0.8.0`
sourceimport com.flowtick.graphs._
import com.flowtick.graphs.defaults._

val graph: Graph[Unit, String] =
  Graph.fromEdges(Set("A" --> "B", "B" --> "C", "D" --> "A"))

println(graph.edges)
The source code for this page can be found here.