/// <summary> /// Find all paths in road graph from start node to finish node /// </summary> /// <returns>Found paths</returns> public List <RoadPath> FindAllPaths() { CheckMapErrors(roadMap); startNode = roadMap.Nodes.Where(n => n.Role == RoadNodeRole.Start).Single(); finishNode = roadMap.Nodes.Where(n => n.Role == RoadNodeRole.Finish).Single(); visitedNodes.Add(startNode); currentPath.Push(startNode); FindPaths(startNode); return(pathsFound); }
public object Clone() { RoadPath clone = new RoadPath(); foreach (RoadNode node in this.ToList()) { clone.Push(node); } return(clone); }