示例#1
0
 public static void AddEdge(this IGraphBuilder graph, int from, int to, int edge, EdgeDirectionType directionType = EdgeDirectionType.Undirected)
 {
     graph.AddEdge(new Vertex {
         Id = from
     }, new Vertex {
         Id = to
     }, new Edge {
         Id = edge, DirectionType = directionType
     });
 }
示例#2
0
 public Graph(EdgeDirectionType directionType = EdgeDirectionType.Undirected)
 {
     DirectionType = directionType;
     _vertices     = new Dictionary <int, AdjacencyVertex>();
     _edges        = new Dictionary <int, AdjacencyEdge>();
 }