public IList <Subgraph> GetConnectedSubgraphs()
        {
            var subgraphs = new List <Subgraph>();

            GraphComponent.SetVisited(graph.GetNodeEnumerator(), false);
            var ienum = graph.GetEdgeEnumerator();

            while (ienum.MoveNext())
            {
                var e    = ienum.Current;
                var node = e.GetDirEdge(0).FromNode;
                if (!node.IsVisited)
                {
                    subgraphs.Add(FindSubgraph(node));
                }
            }
            return(subgraphs);
        }
Exemplo n.º 2
0
        /// <summary>
        ///
        /// </summary>
        /// <returns></returns>
        public IList GetConnectedSubgraphs()
        {
            IList subgraphs = new ArrayList();

            GraphComponent.SetVisited(graph.GetNodeEnumerator(), false);
            IEnumerator ienum = graph.GetEdgeEnumerator();

            while (ienum.MoveNext())
            {
                Edge e    = ienum.Current as Edge;
                Node node = e.GetDirEdge(0).FromNode;
                if (!node.IsVisited)
                {
                    subgraphs.Add(FindSubgraph(node));
                }
            }
            return(subgraphs);
        }
Exemplo n.º 3
0
        /// <summary>
        ///
        /// </summary>
        /// <returns></returns>
        public virtual IList GetConnectedSubgraphs()
        {
            IList subgraphs = new ArrayList();

            GraphComponent.SetVisited(_graph.GetNodeEnumerator(), false);
            IEnumerator ienum = _graph.GetEdgeEnumerator();

            while (ienum.MoveNext())
            {
                Edge e = ienum.Current as Edge;
                if (e == null)
                {
                    throw new NullEdgeException();
                }
                Node node = e.GetDirEdge(0).FromNode;
                if (!node.IsVisited)
                {
                    subgraphs.Add(FindSubgraph(node));
                }
            }
            return(subgraphs);
        }