graph algorithms: reachability from adjacency map -
I have a dependency graph, which I used to call map & lt; Node, collection & lt; Node & gt; & Gt; (in Java-Speech, or f (node n) - & gt; Collection [node] as a function; it is a given node n Mapping from is a collection of nodes which depends on n ) graph is potentially cyclic *. Looking at the list of nodes list , I would like to solve it: i.e. map & lt; Node, set & lt; Node & gt; & Gt; ; Example: Example For, (x -> y stands for node y depends on node x) n1 - & gt; N 2 N 2 - & gt; N3 N3 - & gt; N1N3 - & gt; N5N4 - & gt; N2N4 - & gt; N5 N6 - & gt; N1N7 - & gt; N1 presented as adjacent map {n1: [n2], n2: [n3], n3: [n1, n5], n4: [n2, n5] Can be done], N6: [N1], N7: [N1]} . If the badlist = [n4, n5, n1] then badmap = {n4: [n4, n2, n3, n1, n5], n5: [n5] ], N1: [n1, n2, n3, n5]} . Graph Algorithms rush as well as references to the online search, so if I can point to an efficient...