optimized directed graph with local functions
parent
810ca03112
commit
8b036bb990
|
@ -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);
|
||||||
|
|
Loading…
Reference in New Issue