Exemplo n.º 1
0
        /// <summary>
        /// Create and return a subgraph containing the given edges and their endpoints.
        /// </summary>
        public SubGraph AddSubgraphFromEdgeSet(string name, HashSet <Edge> edges)
        {
            var result = SubGraph.GetOrCreate(this, name);

            result.AddExisting(edges);
            // Since subgraphs can contain edges independently of their endpoints,
            // we need to add the endpoints explicitly.
            result.AddExisting(edges.SelectMany(e => new[] { e.Tail(), e.Head() }));
            return(result);
        }
Exemplo n.º 2
0
 public SubGraph GetOrAddSubgraph(string name)
 {
     return(SubGraph.GetOrCreate(this, name));
 }