GraphView.TranslateMatchClauseVisitor.GetNodeUnits C# (CSharp) Method

GetNodeUnits() private method

Get a full one height tree with joint edges and unmaterlized edges, returns a tuple whose first item is the one height tree and the second item indicates whether the one height tree only joins with the component's materialized node on its root.
private GetNodeUnits ( ConnectedComponent graph, MatchComponent component ) : IEnumerable
graph ConnectedComponent
component MatchComponent
return IEnumerable
        private IEnumerable<OneHeightTree> GetNodeUnits(ConnectedComponent graph, MatchComponent component)
        {
            //var nodes = graph.Nodes;
            //foreach (var node in graph.Nodes.Values)
            foreach (var node in graph.Nodes.Values.Where(n => !component.Nodes.Contains(n)))
            {
                var remainingEdges = node.Neighbors.Where(e => !component.EdgeMaterilizedDict.ContainsKey(e)).ToList();
                if (component.UnmaterializedNodeMapping.ContainsKey(node) ||
                    remainingEdges.Any(e => component.Nodes.Contains(e.SinkNode)))
                {
                    yield return new OneHeightTree
                    {
                        TreeRoot = node,
                        Edges = remainingEdges
                    };
                }
            }
        }