Пример #1
0
        public AdjacencyListGraph(IEnumerable <Vertex> vertices, IEnumerable <Edge> edges, GraphType typ)
        {
            m_Vertices = new List <Vertex>();
            m_Edges    = new Dictionary <Vertex, List <Edge> >();
            Type       = typ;
            EdgeCount  = 0;

            // add given vertices and edges in order
            foreach (var v in vertices)
            {
                AddVertex(v);
            }
            foreach (var e in edges)
            {
                AddEdge(e);
            }
        }
Пример #2
0
 public AdjacencyListGraph(IEnumerable <Vertex> vertices, GraphType typ) : this(vertices, new List <Edge>(), typ)
 {
 }
Пример #3
0
 public AdjacencyListGraph(GraphType typ) : this(new List <Vertex>(), typ)
 {
 }