public void AddElement(DotElement element)
        {
            if (element == null)
            {
                throw new ArgumentNullException();
            }

            if (element is DotEdge)
            {
                var edge = element as DotEdge;
                AddElement(edge.From);
                AddElement(edge.To);
            }

            if (!elements.ContainsKey(element))
            {
                elements[element] = elements.Count;
            }
        }
        private static void WriteAttributes(StringBuilder builder, DotElement element)
        {
            if (!element.HasAttributes())
            {
                return;
            }

            char separator = '[';

            foreach (var attrib in element.attributes)
            {
                builder.Append(separator);
                builder.Append(attrib.Key);
                builder.Append("=\"");
                builder.Append(attrib.Value);
                builder.Append('\"');
                separator = ' ';
            }
            builder.Append(']');
        }
        /*public OutputToImageFile(string path)
         * {
         *
         * }*/

        private KeyValuePair <DotElement, int> Kvp(DotElement element)
        {
            return(new KeyValuePair <DotElement, int>(element, elements[element]));
        }