Пример #1
0
        public static void RemoveFullNodeSymetric(DirectedEdgedGraph <T, E> original, DirectedEdgedGraph <T, E> inverse, T node)
        {
            var from = inverse.RelatedTo(node).Keys;
            var to   = original.RelatedTo(node).Keys;

            original.RemoveFullNode(node, from);
            inverse.RemoveFullNode(node, to);
        }
Пример #2
0
        public IEnumerable <HashSet <T> > CompilationOrderGroups()
        {
            DirectedEdgedGraph <T, E> clone = this.Clone();
            DirectedEdgedGraph <T, E> inv   = this.Inverse();

            while (clone.Count > 0)
            {
                var leaves = clone.Sinks();
                foreach (var node in leaves)
                {
                    clone.RemoveFullNode(node, inv.RelatedTo(node).Keys);
                }
                yield return(leaves);
            }
        }