Example #1
0
        void AddEdgesFromStronglyConnectedComponent( IVertexCollection component )
        {
            int sourceVertexCount = (int) System.Math.Ceiling( System.Math.Sqrt( component.Count ) );

            IEnumerator componentEnumerator = component.GetEnumerator();

            for ( int currentVertexIndex = 0; currentVertexIndex < sourceVertexCount; currentVertexIndex++ )
            {
                componentEnumerator.MoveNext();

                foreach( Vertex sinkVertex in component )
                {
                    _graph.AddEdge(
                        (Vertex) componentEnumerator.Current,
                        sinkVertex);
                }
            }
        }