creating edges and finding outgoing edges based on filtering by a predicate