26 using System.Collections.Generic;
48 private Func<Arc, Direction> getDirection;
56 this.getDirection = getDirection;
61 return getDirection(arc) ==
Direction.Backward ? graph.
V(arc) : graph.
U(arc);
66 return getDirection(arc) ==
Direction.Backward ? graph.
U(arc) : graph.
V(arc);
71 return getDirection(arc) ==
Direction.Edge;
74 public IEnumerable<Node>
Nodes()
85 private IEnumerable<Arc> FilterArcs(
Node u, IEnumerable<Arc> arcs,
ArcFilter filter)
91 case ArcFilter.Forward:
return arcs.Where(x =>
93 var dir = getDirection(x);
101 default:
return arcs.Where(x =>
103 var dir = getDirection(x);
108 default:
return true;
116 return FilterArcs(u, graph.
Arcs(u), filter);
121 return FilterArcs(u, graph.
Arcs(u, v), filter);
136 return Arcs(u, filter).Count();
141 return Arcs(u, v, filter).Count();