Preview

Backtracking: Set and Solution Space

Good Essays
Open Document
Open Document
1196 Words
Grammar
Grammar
Plagiarism
Plagiarism
Writing
Writing
Score
Score
Backtracking: Set and Solution Space
Backtracking
General method • Useful technique for optimizing search under some constraints • Express the desired solution as an n-tuple (x1 , . . . , xn ) where each xi ∈ Si , Si being a finite set • The solution is based on finding one or more vectors that maximize, minimize, or satisfy a criterion function P (x1 , . . . , xn ) • Sorting an array a[n] – Find an n-tuple where the element xi is the index of ith smallest element in a – Criterion function is given by a[xi ] ≤ a[xi+1 ] for 1 ≤ i < n – Set Si is a finite set of integers in the range [1,n] • Brute force approach – Let the size of set Si be mi – There are m = m1 m2 · · · mn n-tuples that satisfy the criterion function P – In brute force algorithm, you have to form all the m n-tuples to determine the optimal solutions • Backtrack approach – Requires less than m trials to determine the solution – Form a solution (partial vector) and check at every step if this has any chance of success – If the solution at any point seems not-promising, ignore it – If the partial vector (x1 , x2 , . . . , xi ) does not yield an optimal solution, ignore mi+1 · · · mn possible test vectors even without looking at them • All the solutions require a set of constraints divided into two categories: explicit and implicit constraints Definition 1 Explicit constraints are rules that restrict each xi to take on values only from a given set. – Explicit constraints depend on the particular instance I of problem being solved – All tuples that satisfy the explicit constraints define a possible solution space for I – Examples of explicit constraints ∗ xi ≥ 0, or all nonnegative real numbers ∗ xi = {0, 1} ∗ li ≤ xi ≤ ui Definition 2 Implicit constraints are rules that determine which of the tuples in the solution space of I satisfy the criterion function. – Implicit constraints describe the way in which the xi s must relate to each other. • Determine problem solution by systematically searching the solution space for the given problem instance

You May Also Find These Documents Helpful

  • Satisfactory Essays

    LYT2 Task2

    • 4061 Words
    • 12 Pages

    Stein, S. S., Gerding, E. H., Rogers, A. C., Larson, K. K., & Jennings, N. R. (2011). Algorithms…

    • 4061 Words
    • 12 Pages
    Satisfactory Essays
  • Powerful Essays

    Kimmel, P. D., Weygandt, J. J., & Kieso, D. E. (2011). Financial accounting: Tools for business decision making (6th ed.). Hoboken, NJ: John Wiley & Sons.…

    • 2127 Words
    • 9 Pages
    Powerful Essays
  • Satisfactory Essays

    Problem Set

    • 676 Words
    • 3 Pages

    A theorem proposed by Professors Alchian and Allen in their text, University Economics (1964) has had several rebirths of interest in the literature. The so-called “third law of demand,” or “relative price theorem,” holds that a fixed cost added to a good of varying quality causes the consumer to prefer the category considered of higher quality to the lower.…

    • 676 Words
    • 3 Pages
    Satisfactory Essays
  • Satisfactory Essays

    Problem Set

    • 525 Words
    • 3 Pages

    2. A buffer contains 0.01mol of lactic acid (pKa=3.86) and 0.05mol of sodium lactate per liter.…

    • 525 Words
    • 3 Pages
    Satisfactory Essays
  • Good Essays

    be considered, where x1 , x2 , ... , xn are the unknowns, elements aik (i = 1, 2, ..., m;…

    • 3080 Words
    • 13 Pages
    Good Essays
  • Satisfactory Essays

    linear programming

    • 354 Words
    • 2 Pages

    Spreadsheet Modeling and Excel Solver A mathematical model implemented in a spreadsheet is called a spreadsheet model. Major spreadsheet packages come with a built-in optimization tool called Solver. Now we demonstrate how to use Excel spreadsheet modeling and Solver to find the optimal solution of optimization problems. If the model has two variables, the graphical method can be used to solve the model. Very few real world problems involve only two variables. For problems with more than two variables, we need to use complex techniques and tedious calculations to find the optimal solution. The spreadsheet and solver approach makes solving optimization problems a fairly simple task and it is more useful for students who do not have strong mathematics background. The first step is to organize the spreadsheet to represent the model. We use separate cells to represent decision variables, create a formula in a cell to represent the objective function and create a formula in a cell for each constraint left hand side. Once the model is implemented in a spreadsheet, next step is to use the Solver to find the solution. In the Solver, we need to identify the locations (cells) of objective function, decision variables, nature of the objective function (maximize/minimize) and constraints. Example One (Linear model): Investment Problem Our first example illustrates how to allocate money to different bonds to maximize the total return (Ragsdale 2011, p. 121). A trust office at the Blacksburg National Bank needs to determine how to invest $100,000 in following collection of bonds to maximize the annual return. Bond Annual Return Maturity Risk Tax-Free A B C D E 9.5% 8.0% 9.0% 9.0% 9.0% Long Short Long Long Short High Low Low High High Yes Yes No Yes No The officer wants to invest at least 50% of the money in short term issues and no more than 50% in high-risk issues. At least 30% of the funds should go in tax-free investments, and at least 40% of the total return should be…

    • 354 Words
    • 2 Pages
    Satisfactory Essays
  • Good Essays

    Short Info On Excel Solver Excel Solver is a tool to model and solve linear and nonlinear programming problems. To access it, open Excel, choose the tab “Data” and select “Solver” from the “Analysis” group. If it is not there, you have to install it, by clicking the “File” tab (or the Office button), then “Options”, then “Add-Ins”, and then “Manage Add-Ins”. Check “Solver” there. To solve the model, you have to first program in on a spreadsheet. In the attached “excel-example.xls” we solve the linear programming problem max 3x1 + 2x2 s.t. 2x1 + x2 ≤ 3 x1 + 2x2 ≤ 4 x1 ≥ 0, x2 ≥ 0. The decision variables x1 , x2 are in cells B2:C2. They are called “Changing Variable Cells” in the Solver. You do not have to put any numbers there, but it is convenient to put something to see whether other calculations work well. The coefficients of the constraint matrix A are in B5:C6. The vector b is in E5:E6, and the vector c is in B9:C9. You have to put these data to the spreadsheet. The cells D3:D4 and D9 are calculated cells. They contain formulas to calculate the values of the constraint left hand side Ax and of the objective function cT x. See how they are coded. If you input different values to “changing cells” you get different values in the calculated cells. Now you can go to “Solver”. Specify “Objective” (or “Target Cell”) as D9 (by just clicking on D9). Check “Max”, because you want to maximize. Specify “Changing Cells” as B2:C2 (by selecting with the mouse). Go to the “Constraints” window. Click “Add”. On the left hand side put the cell(s) on the left hand side of the relation. On the right hand side put the cell(s) on the other side of the relation. Select the relation in the middle. This is your constraint. Add other constraints in the same way. Select “Assume Nonnegative”, because both x1 , x2 are greater than or equal to 0. Select “Simplex LP” because you solve a linear model. In the older version of Excel, these selections (“Nonnegative Variables” and “Assume Linear Model”)…

    • 405 Words
    • 2 Pages
    Good Essays
  • Powerful Essays

    Maths Bigm Method

    • 2291 Words
    • 10 Pages

    slack variable si; and if constraint i is a > constraint, we subtract an excess variable ei). 3. Add an artificial variable ai to the constraints identified as > or = constraints at the end of Step 1. Also add the sign restriction ai > 0. 4. If the LP is a max problem, add (for each artificial variable) -Mai to the objective function where M denote a very large positive number. 5. If the LP is a min problem, add (for each artificial variable) Mai to the objective function. 6. Solve the transformed problem by the simplex . Since each artificial variable will be in the starting basis, all artificial variables must be eliminated from row 0 before beginning the simplex. Now…

    • 2291 Words
    • 10 Pages
    Powerful Essays
  • Good Essays

    Each feasible solution is associated with a value Objective: Find a feasible solution with the best value…

    • 1889 Words
    • 8 Pages
    Good Essays
  • Good Essays

    Problem Set 8 Solutions

    • 1329 Words
    • 6 Pages

    Problem 1. Exchange Rates and International Transmission a. Suppose that the US engages in a monetary expansion. Since exchange rate is pegged to the US dollar, country X’s monetary authorities are forced to expand their money supply as well (recall that i = i* under FixER). Interest rates fall in country X, output expands, and of course the exchange rate remains unchanged. On the AA-DD diagram, both the AA and the DD schedules shift to the right. The shift in DD can be explained by the increase in US output which causes an increase in net exports of country X. In addition, smaller interest rates are known to increase investment, which can also explain the shift in DD. The case of monetary contraction is similar. Thus with fixed exchange rates, monetary shocks transmit positively from the US to country X.…

    • 1329 Words
    • 6 Pages
    Good Essays
  • Powerful Essays

    Linear Programming

    • 10813 Words
    • 44 Pages

    Abstract We describe Linear Programming, an important generalization of Linear Algebra. Linear Programming is used to successfully model numerous real world situations, ranging from scheduling airline routes to shipping oil from refineries to cities to finding inexpensive diets capable of meeting the minimum daily requirements. In many of these problems, the number of variables and constraints are so large that it is not enough to merely to know there is solution; we need some way of finding it (or at least a close approximation to it) in a reasonable amount of time. We describe the types of problems Linear Programming can handle and show how we can solve them using the simplex method. We discuss generalizations to Binary Integer Linear Programming (with an example of a manager of an activity hall), and conclude with an analysis of versatility of Linear Programming and the types of problems and constraints which can be handled linearly, as well as some brief comments about its generalizations (to handle situations with quadratic constraints).…

    • 10813 Words
    • 44 Pages
    Powerful Essays
  • Satisfactory Essays

    Problem set

    • 390 Words
    • 2 Pages

    4.86, 4.87 Let X = U n where n is a positive integer and U is a uniform random variable in the unit interval.…

    • 390 Words
    • 2 Pages
    Satisfactory Essays
  • Good Essays

    Problem Set Chapter 3

    • 899 Words
    • 4 Pages

    Actually outside of the subway system, a token satisfies none of the functions of money because even though your $2 dollar subway token will remain $2 for the next time you use it – it cannot be used for any sort of ‘store of value’ outside the system…making each function of money not applicable to the token.…

    • 899 Words
    • 4 Pages
    Good Essays
  • Satisfactory Essays

    Ch 4 Test Bank Simplex

    • 1908 Words
    • 25 Pages

    The objective function is Z = 1 x1 + 2 x2 + 2 x3. The current BF solution is not optimal since we can improve Z by increasing x1 or x2 or x3.…

    • 1908 Words
    • 25 Pages
    Satisfactory Essays
  • Good Essays

    Linear Programming

    • 372 Words
    • 2 Pages

    All types of problems can be solved that contain a linear function which is to be maximized or minimized and given the constraints.…

    • 372 Words
    • 2 Pages
    Good Essays

Related Topics