protected BaseAlgorithm(IGraph graph, IEndPoints endPoints) { visitedVertices = new VisitedVertices(); parentVertices = new ParentVertices(); this.graph = graph; this.endPoints = new EndPoints(endPoints); }
public GraphPath(ParentVertices parentVertices, IEndPoints endPoints, IGraph graph, IStepRule stepRule) { this.parentVertices = parentVertices; this.graph = graph; this.endPoints = endPoints; this.stepRule = stepRule; }
private void FormParentVertices(ParentVertices parentVertices) { for (int i = 0; i < expectedPraphPathCoordinates.Length - 1; i++) { var childCoordinate = graph[expectedPraphPathCoordinates[i + 1]]; var parentCoordinate = graph[expectedPraphPathCoordinates[i]]; parentVertices.Add(childCoordinate, parentCoordinate); } }
public GraphPath(ParentVertices parentVertices, IEndPoints endPoints, IGraph graph, IStepRule stepRule) { path = new Lazy <IVertex[]>(GetPath); pathCost = new Lazy <double>(ExtractPathCost); pathLength = new Lazy <int>(GetPathLength); this.parentVertices = parentVertices; this.graph = graph; this.endPoints = endPoints; this.stepRule = stepRule; }
public GraphPathTests() { graphAssemble = new TestGraph2DAssemble(); expectedPraphPathCoordinates = new ICoordinate[] { new TestCoordinate(0, 0), //1 new TestCoordinate(0, 1), //5 new TestCoordinate(1, 2), //8 new TestCoordinate(1, 3), //1 new TestCoordinate(2, 4), //3 new TestCoordinate(3, 5), //2 new TestCoordinate(3, 6), //1 new TestCoordinate(4, 7) //5 }; graph = graphAssemble.AssembleGraph(0); var source = graph[expectedPraphPathCoordinates.First()]; var target = graph[expectedPraphPathCoordinates.Last()]; endPoints = new EndPoints(source, target); parentVertices = new ParentVertices(); FormParentVertices(parentVertices); }
public GraphPath(ParentVertices parentVertices, IEndPoints endPoints, IGraph graph) : this(parentVertices, endPoints, graph, new DefaultStepRule()) { }