emory-courses / dsa-java

Data Structures and Algorithms in Java
https://emory.gitbook.io/dsa-java/
42 stars 55 forks source link

[QZ#8] Path Clarification #187

Closed LukHan99 closed 3 years ago

LukHan99 commented 3 years ago

When we are returning the augmented paths, are we required to start the subgraph from the source index? For instance, if we have found a path: 3->4->5 where 3 is the source and 5 is the target, do we need to return the path as: [4 <- 3, 5 <- 4] or [5 <- 4, 4 <- 3], or either way is fine?

marvinquiet commented 3 years ago

Hi,

Please check it here: https://github.com/emory-courses/dsa-java/blob/e704f481c0da7c4fe180ebb3a2d5488db8fcf5bc/src/main/java/edu/emory/cs/graph/flow/FordFulkerson.java#L102