 
 	public var edges: Set<Edge> {
 		didSet {
-			sanitize(edges - oldValue)
+			sanitize(edges.subtract(oldValue))
 		}
 	}
 


	public var nodes: Dictionary<Identifier, T> {
		willSet {
			let removed = Set(nodes.keys) - Set(newValue.keys)
			if removed.count == 0 { return }
			edges = edges.filter {
				!removed.contains($0.source.identifier) && !removed.contains($0.destination.identifier)

	private mutating func sanitize(added: Set<Edge>) {
		if added.count == 0 { return }
		let keys = nodes.keys
		edges.subtractInPlace(lazy(added).filter {
			!contains(keys, $0.source.identifier) && !contains(keys, $0.destination.identifier)
		})
	}
}

