private <V, E, G extends Digraph<? extends V, ? extends E>> void writeNodesAndEdges(
			Writer writer,
			int level,
			DotProvider<V, E, G> provider,
			G digraph,
			Map<V, Cluster<V,E,G>> clusters,
			DigraphProvider<? super V, G> subgraphs) throws IOException {
		for (V vertex : digraph.vertices()) {
			if (clusters.containsKey(vertex)) {
				writeCluster(writer, level, provider, vertex, clusters.get(vertex), subgraphs);
			} else {
				writeNode(writer, level, vertex, provider);
			}
		}
		for (V source : digraph.vertices()) {
			for (V target : digraph.targets(source)) {
				writeEdge(writer, level, source, target, digraph.get(source, target), provider,
						clusters.get(source), clusters.get(target));
			}
		}
	}