/// <summary> /// Construct a new bidirectional dijkstra algorithm. </summary> /// <param name="expander"> The <seealso cref="PathExpander"/> to be used to decide which relationships /// to expand for each node </param> /// <param name="costEvaluator"> The <seealso cref="CostEvaluator"/> to be used for calculating cost of a /// relationship </param> /// <param name="epsilon"> The tolerance level to be used when comparing floating point numbers. </param> public DijkstraBidirectional(PathExpander expander, CostEvaluator <double> costEvaluator, double epsilon) { this._expander = expander; this._costEvaluator = costEvaluator; this._epsilon = epsilon; this._stateFactory = InitialBranchState.DOUBLE_ZERO; }
internal AsOneStartBranch(TraversalContext context, IEnumerable <Node> nodes, InitialBranchState initialState, UniquenessFactory uniqueness) { this._context = context; this._initialState = initialState; this._uniqueness = uniqueness; this._branches = ToBranches(nodes); }
public Dijkstra(PathExpander expander, InitialBranchState stateFactory, CostEvaluator <double> costEvaluator, bool stopAfterLowestCost) { this._expander = expander; this._costEvaluator = costEvaluator; this._stateFactory = stateFactory; _interest = stopAfterLowestCost ? PathInterestFactory.allShortest(NoneStrictMath.EPSILON) : PathInterestFactory.all(NoneStrictMath.EPSILON); _epsilon = NoneStrictMath.EPSILON; this._stateInUse = true; }
/// <summary> /// Construct new dijkstra algorithm. </summary> /// <param name="expander"> <seealso cref="PathExpander"/> to be used to decide which relationships /// to expand. </param> /// <param name="costEvaluator"> <seealso cref="CostEvaluator"/> to be used to calculate cost of relationship </param> /// <param name="epsilon"> The tolerance level to be used when comparing floating point numbers. </param> /// <param name="interest"> <seealso cref="PathInterest"/> to be used when deciding if a path is interesting. /// Recommend to use <seealso cref="PathInterestFactory"/> to get reliable behaviour. </param> public Dijkstra(PathExpander expander, CostEvaluator <double> costEvaluator, double epsilon, PathInterest <double> interest) { this._expander = expander; this._costEvaluator = costEvaluator; this._epsilon = epsilon; this._interest = interest; this._stateFactory = InitialBranchState.DOUBLE_ZERO; this._stateInUse = false; }
internal MonoDirectionalTraverserIterator(Resource resource, UniquenessFilter uniqueness, PathExpander expander, BranchOrderingPolicy order, PathEvaluator evaluator, IEnumerable <Node> startNodes, InitialBranchState initialState, UniquenessFactory uniquenessFactory) : base(resource) { this._uniqueness = uniqueness; this._evaluator = evaluator; this._selector = order.Create(new AsOneStartBranch(this, startNodes, initialState, uniquenessFactory), expander); }
public PathExpanderAnonymousInnerClass(DijkstraIncreasingWeightTest outerInstance, InitialBranchState <int> state, IDictionary <Node, int> encounteredState) { this.outerInstance = outerInstance; this._state = state; this._encounteredState = encounteredState; }
internal StartNodeTraversalBranch(TraversalContext context, TraversalBranch parent, Node source, InitialBranchState initialState) : base(parent, source, initialState) { this._initialState = initialState; Evaluate(context); context.IsUniqueFirst(this); }
public Dijkstra(PathExpander expander, InitialBranchState stateFactory, CostEvaluator <double> costEvaluator) : this(expander, stateFactory, costEvaluator, true) { }
public static PathFinder <WeightedPath> Dijkstra(PathExpander expander, InitialBranchState stateFactory, string relationshipPropertyRepresentingCost) { return(dijkstra(expander, stateFactory, new DoubleEvaluator(relationshipPropertyRepresentingCost))); }
public static PathFinder <WeightedPath> Dijkstra(PathExpander expander, InitialBranchState stateFactory, CostEvaluator <double> costEvaluator) { return(new Dijkstra(expander, stateFactory, costEvaluator)); }
public TraversalBranchWithState(TraversalBranch parent, Node source, InitialBranchState initialState) : base(parent, source) { this.StateForMe = this.StateForChildren = initialState.initialState(this); }