Traverse from the frontier node in the specified direction and add all encountered nodes and edges.
| 140 | |
| 141 | // Traverse from the frontier node in the specified direction and add all encountered nodes and edges. |
| 142 | void addNeighbors |
| 143 | ( |
| 144 | AllPathsCtx *ctx, |
| 145 | LevelConnection *frontier, |
| 146 | uint32_t depth, |
| 147 | GRAPH_EDGE_DIR dir |
| 148 | ) { |
| 149 | switch(dir) { |
| 150 | case GRAPH_EDGE_DIR_OUTGOING: |
| 151 | addOutgoingNeighbors(ctx, frontier, depth); |
| 152 | break; |
| 153 | case GRAPH_EDGE_DIR_INCOMING: |
| 154 | addIncomingNeighbors(ctx, frontier, depth); |
| 155 | break; |
| 156 | case GRAPH_EDGE_DIR_BOTH: |
| 157 | addIncomingNeighbors(ctx, frontier, depth); |
| 158 | addOutgoingNeighbors(ctx, frontier, depth); |
| 159 | break; |
| 160 | default: |
| 161 | ASSERT(false && "encountered unexpected traversal direction in AllPaths"); |
| 162 | break; |
| 163 | } |
| 164 | } |
| 165 | |
| 166 | AllPathsCtx *AllPathsCtx_New |
| 167 | ( |