public void Output(ArchitectureGraph architecture, List<OutputEntry> warnings)
        {
            architecture.Vertices.ForEach((proj, i) => ids.Add(proj, i + 1));

            var result = new DotStringBuilder("Architecture");

            architecture.Vertices.ForEach(v => result.AppendNode(v, v, "shape", "box"));

            result.AppendSpace();

            var deps = new HashSet<GroupDependency>(architecture.Edges);
            var inversible = new HashSet<GroupDependency>(deps.Where(d => deps.Contains(new GroupDependency(d.Target, d.Source))));

            architecture.Edges.ForEach(d => result.AppendEdge(d.Source, d.Target, "style", GetStyle(d), "color", GetColor(d, inversible)));

            File.WriteAllText(file, result.ToString());
        }
        private void AddDependenciesBetweenGroups(DotStringBuilder result)
        {
            var usedGroups = new HashSet<string>(graph.Vertices.Where(v => v.GroupElement != null)
                .Select(g => g.GroupElement.Name));

            if (usedGroups.Count < 2)
                return;

            var usedDeps = architecture.Edges.Where(e => usedGroups.Contains(e.Source) && usedGroups.Contains(e.Target))
                .ToList();

            if (!usedDeps.Any())
                return;

            IDictionary<string, int> components;
            int numConnectedComponents = architecture.StronglyConnectedComponents(out components);
            if (numConnectedComponents < 2)
                return;

            //var circularDeps = components.Select(c => new { Group = c.Key, Index = c.Value })
            //	.Where(e => usedGroups.Contains(e.Group))
            //	.GroupBy(c => c.Index)
            //	.Where(g => g.Count() > 1);

            //foreach (var circ in circularDeps)
            //{
            //	var nodes = circ.ToList();
            //	nodes.Add(nodes.First());

            //	result.Append(prefix)
            //		.Append("{ ")
            //		.Append(string.Join(" -> ", nodes.Select(e => groupInfos[e.Group].TopNode)))
            //		.Append(" [weight=1000];")
            //		.Append("}\n");

            //	result.Append(prefix)
            //		.Append("{ ")
            //		.Append(string.Join(" -> ", nodes.Select(e => groupInfos[e.Group].BottomNode)))
            //		.Append(" [weight=1000];")
            //		.Append("}\n");
            //}

            foreach (var dep in usedDeps)
            {
                if (components[dep.Source] == components[dep.Target])
                    continue;

                result.AppendEdge(groupInfos[dep.Source].BottomNode, groupInfos[dep.Target].TopNode, "style", "invis", "weight", "1000");
            }
        }
        private void AppendDependency(DotStringBuilder result, Dependency dep)
        {
            var invert = wrongDependencies.Contains(dep);

            result.AppendEdge(invert ? dep.Target : dep.Source, invert ? dep.Source : dep.Target, //
                "style", dep.Type == Dependency.Types.LibraryReference ? "dashed" : null, //
                "color", GetColor(warnings.Where(w => w.Dependencies.Contains(dep))), //
                "dir", invert ? "back" : null);
        }