private void VisitOne(VertexFamily family) { if (!family.Visited) { MarkFamilyAsVisited(family); foreach (var child in family.Childrens) { VisitOne(ToFamily(child)); } } }
private List <Edge> ToEdges(List <VertexFamily> S, VertexFamily familyStart) { var a = _edges .Where(x => { var heh = familyStart.Childrens.Except(S.Select(w => w.Parent)); var ss = x.Source == familyStart.Parent && heh.Contains(x.Target) || x.Target == familyStart.Parent && heh.Contains(x.Source); return(ss); }).ToList().OrderBy(x => x.Weight).ToList(); return(a); }
private void MarkFamilyAsVisited(VertexFamily family) { family.Visit(); _result.Add(family.Parent); }