void buildDAG(ElementSet incoming) { child.buildDAG(ElementSets.union(incoming,child.lastSet())); }
void buildDAG(ElementSet incoming) { child.buildDAG(ElementSets.union(incoming,child.lastSet())); }
void buildDAG(ElementSet incoming) { child.buildDAG(ElementSets.union(incoming,child.lastSet())); }
void buildDAG(ElementSet incoming) { child.buildDAG(ElementSets.union(incoming,child.lastSet())); }
void buildDAG(ElementSet incoming) { child.buildDAG(ElementSets.union(incoming,child.lastSet())); }
/** * Builds a {@link Graph} from an {@link Expression} tree. * * {@link Expression} given to the graph will be modified forever, * and it will not be able to create another {@link Graph}. */ public Graph(Expression body) { // attach source and sink Expression whole = new Sequence(new Sequence(source,body),sink); // build up a graph whole.buildDAG(ElementSet.EMPTY_SET); // decompose into strongly connected components. // the algorithm is standard DFS-based algorithm, // one illustration of this algorithm is available at // http://www.personal.kent.edu/~rmuhamma/Algorithms/MyAlgorithms/GraphAlgor/strongComponent.htm source.assignDfsPostOrder(sink); source.buildStronglyConnectedComponents(ccs); // cut-set check Set<Element> visited = new HashSet<Element>(); for (ConnectedComponent cc : ccs) { visited.clear(); if(source.checkCutSet(cc,visited)) { cc.isRequired = true; } } }
/** * Builds a {@link Graph} from an {@link Expression} tree. * * {@link Expression} given to the graph will be modified forever, * and it will not be able to create another {@link Graph}. */ public Graph(Expression body) { // attach source and sink Expression whole = new Sequence(new Sequence(source,body),sink); // build up a graph whole.buildDAG(ElementSet.EMPTY_SET); // decompose into strongly connected components. // the algorithm is standard DFS-based algorithm, // one illustration of this algorithm is available at // http://www.personal.kent.edu/~rmuhamma/Algorithms/MyAlgorithms/GraphAlgor/strongComponent.htm source.assignDfsPostOrder(sink); source.buildStronglyConnectedComponents(ccs); // cut-set check Set<Element> visited = new HashSet<Element>(); for (ConnectedComponent cc : ccs) { visited.clear(); if(source.checkCutSet(cc,visited)) { cc.isRequired = true; } } }
/** * Builds a {@link Graph} from an {@link Expression} tree. * * {@link Expression} given to the graph will be modified forever, * and it will not be able to create another {@link Graph}. */ public Graph(Expression body) { // attach source and sink Expression whole = new Sequence(new Sequence(source,body),sink); // build up a graph whole.buildDAG(ElementSet.EMPTY_SET); // decompose into strongly connected components. // the algorithm is standard DFS-based algorithm, // one illustration of this algorithm is available at // http://www.personal.kent.edu/~rmuhamma/Algorithms/MyAlgorithms/GraphAlgor/strongComponent.htm source.assignDfsPostOrder(sink); source.buildStronglyConnectedComponents(ccs); // cut-set check Set<Element> visited = new HashSet<Element>(); for (ConnectedComponent cc : ccs) { visited.clear(); if(source.checkCutSet(cc,visited)) { cc.isRequired = true; } } }
/** * Builds a {@link Graph} from an {@link Expression} tree. * * {@link Expression} given to the graph will be modified forever, * and it will not be able to create another {@link Graph}. */ public Graph(Expression body) { // attach source and sink Expression whole = new Sequence(new Sequence(source,body),sink); // build up a graph whole.buildDAG(ElementSet.EMPTY_SET); // decompose into strongly connected components. // the algorithm is standard DFS-based algorithm, // one illustration of this algorithm is available at // http://www.personal.kent.edu/~rmuhamma/Algorithms/MyAlgorithms/GraphAlgor/strongComponent.htm source.assignDfsPostOrder(sink); source.buildStronglyConnectedComponents(ccs); // cut-set check Set<Element> visited = new HashSet<Element>(); for (ConnectedComponent cc : ccs) { visited.clear(); if(source.checkCutSet(cc,visited)) { cc.isRequired = true; } } }
/** * Builds a {@link Graph} from an {@link Expression} tree. * * {@link Expression} given to the graph will be modified forever, * and it will not be able to create another {@link Graph}. */ public Graph(Expression body) { // attach source and sink Expression whole = new Sequence(new Sequence(source,body),sink); // build up a graph whole.buildDAG(ElementSet.EMPTY_SET); // decompose into strongly connected components. // the algorithm is standard DFS-based algorithm, // one illustration of this algorithm is available at // http://www.personal.kent.edu/~rmuhamma/Algorithms/MyAlgorithms/GraphAlgor/strongComponent.htm source.assignDfsPostOrder(sink); source.buildStronglyConnectedComponents(ccs); // cut-set check Set<Element> visited = new HashSet<Element>(); for (ConnectedComponent cc : ccs) { visited.clear(); if(source.checkCutSet(cc,visited)) { cc.isRequired = true; } } }