Ejemplo n.º 1
0
        //
        // A copy constructor for a graph (so that we can perform multiple searches)
        // since the graph may be modified from one iteration to the next.
        //
        public PathGraph(PathGraph another)
        {
            numVerts = another.numVerts;

                //
                // Create and copy all vertex-edge information
                //
                this.vertexList = new List<Edge>[numVerts];

                for (int i = 0; i < vertexList.Length; i++)
                {
                    if (another.vertexList[i] != null)
                    {
                        this.vertexList[i] = new List<Edge>();
                        foreach (Edge e in another.vertexList[i])
                        {
                            this.vertexList[i].Add(new Edge(e));
                        }
                    }
                }
        }
Ejemplo n.º 2
0
        //
        // A copy constructor for a graph (so that we can perform multiple searches)
        // since the graph may be modified from one iteration to the next.
        //
        public PathGraph(PathGraph another)
        {
            numVerts = another.numVerts;

            //
            // Create and copy all vertex-edge information
            //
            this.vertexList = new List <Edge> [numVerts];

            for (int i = 0; i < vertexList.Length; i++)
            {
                if (another.vertexList[i] != null)
                {
                    this.vertexList[i] = new List <Edge>();
                    foreach (Edge e in another.vertexList[i])
                    {
                        this.vertexList[i].Add(new Edge(e));
                    }
                }
            }
        }
Ejemplo n.º 3
0
 //
 // Basic Path constructor
 //
 public Suurballe(PathGraph g)
 {
     graph     = g;
     startNode = 0;                   // Default path starts at the first vertex: 0
     goalNode  = g.NumVertices() - 1; // Default goal is the last vertex
 }
Ejemplo n.º 4
0
 //
 // Basic Path constructor
 //
 public Suurballe(PathGraph g)
 {
     graph = g;
     startNode = 0;                  // Default path starts at the first vertex: 0
     goalNode = g.NumVertices() - 1; // Default goal is the last vertex
 }