コード例 #1
0
 public Graph(params Vertex <T>[] vertices)
 {
     this.vertices = new VerticesSetList <T>();
     foreach (Vertex <T> vertex in vertices)
     {
         this.vertices.Add(vertex);
     }
     edges = new List <Edge <T> >();
 }
コード例 #2
0
 public Graph(List <Vertex <T> > vertices, List <Edge <T> > edges)
 {
     this.vertices = new VerticesSetList <T>();
     foreach (Vertex <T> vertex in vertices)
     {
         this.vertices.Add(vertex);
     }
     this.edges = new List <Edge <T> >();
     foreach (var edge in edges)
     {
         this.AddEdge(edge);
     }
 }
コード例 #3
0
 public Graph()
 {
     vertices = new VerticesSetList <T>();
     edges    = new List <Edge <T> >();
 }