Exemplo n.º 1
0
        public void BFS()
        {
            //reset all nodes to not visited
            foreach (var n in AllNodes)
            {
                n.Value.isVisited = false;
                n.Value.ChangeNodeColor(Visuals.Colors.Black);
                n.Value.HideNode();
            }
            foreach (var e in AllEdges)
            {
                e.Value.HideEdge();
                e.Value.HideEdge();
                e.Value.ChangeEdgeColor(Visuals.Colors.Black);
            }



            var node = AllNodes.First().Value;

            StartCoroutine(BreadthFirstSearchNodeVisit(node));

            /*foreach (var n in AllNodes)
             * {
             *  if (!n.Value.isVisited)
             *      StartCoroutine(DepthFirstSearchNodeVisit(n.Value));
             *      //DFSVisit(n.Value);
             * }*/
        }
Exemplo n.º 2
0
        private void MarkSelected(ProcessNode aNode)
        {
            var t = AllNodes.First(adv => aNode.Equals(adv.Tag));

            t.IsSelected = true;
        }