示例#1
0
        protected override void SolveInstance(IGH_DataAccess DA)
        {
            Graph graph            = null;
            int   startVertexIndex = 0;
            int   endVertexIndex   = 0;

            DA.GetData(0, ref graph);
            DA.GetData(1, ref startVertexIndex);
            DA.GetData(2, ref endVertexIndex);

            Bfs  bfs  = new Bfs(graph);
            Path path = bfs.GetShortestPath(startVertexIndex, endVertexIndex);

            DA.SetDataList(0, path.Edges);
            DA.SetDataList(1, path.Vertices);
            DA.SetDataList(2, path.EdgesIndexes);
            DA.SetDataList(3, path.VerticesIndexes);
            DA.SetDataList(4, bfs.VisitedVertices);
        }