/// <summary> /// Constructs a backtrack solver using the given strategies. /// </summary> /// /// <param name="variableSelectionStrategy">the strategy for selecting the next unassigned variable, or null to use the default strategy</param> /// /// <param name="domainSortStrategy">the strategy for ordering the domain before assignment values, or null to use the default strategy</param> public NaiveConstraintOptimization(IVariableSelectionStrategy <TVar, TVal> variableSelectionStrategy = null, IDomainSortStrategy <TVar, TVal> domainSortStrategy = null) { this.variableSelectionStrategy = variableSelectionStrategy ?? new DefaultVariableSelectionStrategy <TVar, TVal>(); this.domainSortStrategy = domainSortStrategy ?? new DefaultDomainSortStrategy <TVar, TVal>(); this.best = double.MaxValue; }
/// <summary> /// Constructs a backtrack solver using the given strategies. /// </summary> /// /// <param name="variableSelectionStrategy">the strategy for selecting the next unassigned variable, or null to use the default strategy</param> /// /// <param name="domainSortStrategy">the strategy for ordering the domain before assignment values, or null to use the default strategy</param> public RecursiveBacktrackSolver(IVariableSelectionStrategy <TVar, TVal> variableSelectionStrategy = null, IDomainSortStrategy <TVar, TVal> domainSortStrategy = null) { this.variableSelectionStrategy = variableSelectionStrategy ?? new DefaultVariableSelectionStrategy <TVar, TVal>(); this.domainSortStrategy = domainSortStrategy ?? new DefaultDomainSortStrategy <TVar, TVal>(); }