You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
A powerful yet easy to use dependency graph written in Java 8
3
+
4
+
This class implements a dependency graph using a strongly connected Directed Acyclic Graph (DAG) and allows sorting of its nodes in topological order.
5
+
6
+
## Some important characteristics of this class are:
7
+
8
+
1. The graph fully implements Java 8's Collection interface
9
+
2. It provides a standard Iterator and can be easily traversed in a simple for-each loop
10
+
3. Calling method getTopology will not destroy the graph so the same graph instance can be safely reused after a topological sort operation
11
+
4. It can optionally be instantiated to be thread-safe adding some overhead due to use of ReentrantReadWriteLock
12
+
5. It is capable of detecting cycles (or circular dependencies) and for each cycle list all participant nodes (see method findCycles)
13
+
6. Method findShortestPathBetween(a, b) will do extactly what it says using simple unweighted BFS (breadth-first search)
14
+
15
+
## To-do:
16
+
17
+
1. Implement new method iteratePathsBetween(a, b) returning a standard Iterator where each next entry will be a Collection of graph nodes representing one valid path between nodes a and b
0 commit comments