optimized directed graph with local functions

pull/5/head
Evan Hemsley 2019-06-16 20:12:29 -07:00
parent 810ca03112
commit 8b036bb990
1 changed files with 2 additions and 4 deletions

View File

@ -129,8 +129,7 @@ namespace Encompass
output.Add(vertex, new Dictionary<SearchSymbol, uint>()); output.Add(vertex, new Dictionary<SearchSymbol, uint>());
} }
Action<T> dfsHelper = null; void dfsHelper(T v)
dfsHelper = (T v) =>
{ {
discovered.Add(v); discovered.Add(v);
time += 1; time += 1;
@ -259,8 +258,7 @@ namespace Encompass
public IEnumerable<IEnumerable<T>> SimpleCycles() public IEnumerable<IEnumerable<T>> SimpleCycles()
{ {
Action<T, HashSet<T>, Dictionary<T, HashSet<T>>> unblock = null; void unblock(T thisnode, HashSet<T> blocked, Dictionary<T, HashSet<T>> B)
unblock = (T thisnode, HashSet<T> blocked, Dictionary<T, HashSet<T>> B) =>
{ {
var stack = new Stack<T>(); var stack = new Stack<T>();
stack.Push(thisnode); stack.Push(thisnode);