Skip to content

DemoSimpleDirectedGraph

Riaan Hanekom edited this page Jan 31, 2013 · 1 revision

Simple Directed Graph

Description

An illustration of a simple directed graph.

Graph

Code

            return Fluently.CreateDirectedGraph()
                .Edges.Add(x =>
                               {
                                   x.FromNodeWithName("A").ToNodeWithName("B");
                                   x.FromNodeWithName("A").ToNodeWithName("C");
                                   x.FromNodeWithName("B").ToNodeWithName("C");
                                   x.FromNodeWithName("B").ToNodeWithName("D");
                               }
                );

Dot Produced

digraph "DirectedGraph" {
"A";
"B";
"C";
"D";
"A" -> "B";
"A" -> "C";
"B" -> "C";
"B" -> "D";
}