The public functions for the graph UpEdges and DownEdges is returning
the internal Set from the graph, meaning that callers could
inadvertently corrupt the graph structure by editing the returned Sets.
Make UpEdges and DownEdges return a copy of the set, while retaining the
efficient no-copy behavior for internal callers.