Skip to content

Instantly share code, notes, and snippets.

@pfcoperez
Created August 11, 2017 08:54
Show Gist options
  • Save pfcoperez/fcabd84ad7501299e415c9351eed4de6 to your computer and use it in GitHub Desktop.
Save pfcoperez/fcabd84ad7501299e415c9351eed4de6 to your computer and use it in GitHub Desktop.
import org.pfcoperez.dailyalgorithm.datastructures.graphs.undirected._
val ug = UndirectedGraph(Set(1,2,3,4), Edge(1,2)::Edge(2,3)::Edge(3,4)::Edge(4,1)::Nil)
ug.adjacentTo(1)
ug.adjacentTo(2)
ug.adjacentTo(3)
ug.adjacentTo(4)
(ug - Edge(1,4)).adjacentTo(1)
(ug - Edge(1,4)).adjacentTo(4)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment