Beispiel #1
0
        /// <summary>
        /// Returns all Edges that connect the two nodes (which are assumed to be different).
        /// </summary>
        /// <param name="node0"></param>
        /// <param name="node1"></param>
        /// <returns></returns>
        public static IList <DirectedEdge> GetEdgesBetween(Node node0, Node node1)
        {
            var edges0      = DirectedEdge.ToEdges(node0.OutEdges.Edges);
            var commonEdges = new HashSet <DirectedEdge>(edges0.Cast <DirectedEdge>());
            var edges1      = DirectedEdge.ToEdges(node1.OutEdges.Edges);

            commonEdges.ExceptWith(edges1.Cast <DirectedEdge>());
            return(new List <DirectedEdge>(commonEdges));
        }
Beispiel #2
0
        /// <summary>
        /// Returns all Edges that connect the two nodes (which are assumed to be different).
        /// </summary>
        /// <param name="node0"></param>
        /// <param name="node1"></param>
        /// <returns></returns>
        public static IList <DirectedEdge> GetEdgesBetween(Node node0, Node node1)
        {
            IList <Edge> edges0      = DirectedEdge.ToEdges(node0.OutEdges.Edges);
            var          commonEdges = new Set <DirectedEdge>(Utilities.Caster.Cast <DirectedEdge>(edges0));
            IList <Edge> edges1      = DirectedEdge.ToEdges(node1.OutEdges.Edges);

            commonEdges.RemoveMany(Utilities.Caster.Cast <DirectedEdge>(edges1));
            return(new List <DirectedEdge>(commonEdges));
        }