Graph.outEdges

Returns a range of all edges incident to node n.

  1. auto outEdges(Node n)
  2. auto outEdges(Node n)
  3. alias outEdges = incidentEdges
    struct Graph(Node, Weight = void, Flag!"isDirected" isDirected = No.isDirected, EdgePayload = void)
    alias outEdges = incidentEdges
  4. auto incidentEdges(Node n)
  5. auto incidentEdges(Node n)
  6. alias inEdges = incidentEdges

Examples

1 import std.algorithm : equal;
2 
3 auto g1 = Graph!int([1, 2, 3]);
4 
5 g1 ~= g1.edge(1, 1);
6 g1 ~= g1.edge(1, 2);
7 g1 ~= g1.edge(2, 2);
8 g1 ~= g1.edge(2, 3);
9 
10 assert(g1.incidentEdges(1).equal([
11     g1.edge(1, 1),
12     g1.edge(1, 2),
13 ]));
14 assert(g1.incidentEdges(2).equal([
15     g1.edge(1, 2),
16     g1.edge(2, 2),
17     g1.edge(2, 3),
18 ]));
19 assert(g1.incidentEdges(3).equal([
20     g1.edge(2, 3),
21 ]));

Meta