Пример #1
0
        public static string ToGraphviz <TVertex, TEdge>([NotNull] this IEdgeListGraph <TVertex, TEdge> graph)
            where TEdge : IEdge <TVertex>
        {
            var algorithm = new GraphvizAlgorithm <TVertex, TEdge>(graph);

            return(algorithm.Generate());
        }
Пример #2
0
        public static string ToGraphviz <TVertex, TEdge>(
            [NotNull] this IEdgeListGraph <TVertex, TEdge> graph,
            [NotNull, InstantHandle] Action <GraphvizAlgorithm <TVertex, TEdge> > initAlgorithm)
            where TEdge : IEdge <TVertex>
        {
            if (initAlgorithm is null)
            {
                throw new ArgumentNullException(nameof(initAlgorithm));
            }

            var algorithm = new GraphvizAlgorithm <TVertex, TEdge>(graph);

            initAlgorithm(algorithm);
            return(algorithm.Generate());
        }