comparison org/lpsolve.org @ 10:eedd6897197d

fixed spelling errors for pokemon.types
author Robert McIntyre <rlm@mit.edu>
date Wed, 02 Nov 2011 08:02:11 -0700
parents a227fe337e83
children 4ea23241ff5b
comparison
equal deleted inserted replaced
9:fd38763de457 10:eedd6897197d
1 #+title: Discovering Effective Pokemon Types Using Linear Optimization 1 #+title: Discovering Effective Pok\eacute{}mon Types Using Linear Optimization
2 #+author: Robert McIntyre & Dylan Holmes 2 #+author: Robert McIntyre & Dylan Holmes
3 #+EMAIL: rlm@mit.edu 3 #+EMAIL: rlm@mit.edu
4 #+SETUPFILE: ../../aurellem/org/setup.org 4 #+SETUPFILE: ../../aurellem/org/setup.org
5 #+INCLUDE: ../../aurellem/org/level-0.org 5 #+INCLUDE: ../../aurellem/org/level-0.org
6 6
9 * Introduction 9 * Introduction
10 In the [[./types.org][previous post]], we used the best-first search algorithm to 10 In the [[./types.org][previous post]], we used the best-first search algorithm to
11 locate the most effective Pok\eacute{}mon type 11 locate the most effective Pok\eacute{}mon type
12 combinations. Afterwards, we realized that we could transform this 12 combinations. Afterwards, we realized that we could transform this
13 search problem into a /linear optimization problem/. This conversion 13 search problem into a /linear optimization problem/. This conversion
14 offered several advantages: first, search algorithms are comparatively 14 offeres several advantages: first, search algorithms are comparatively
15 slow, whereas linear optimization algorithms are extremely fast; 15 slow, whereas linear optimization algorithms are extremely fast;
16 second, it is difficult to determine whether a search problem has any 16 second, it is difficult to determine whether a search problem has any
17 solution, whereas it is straightforward to determine whether a linear 17 solution, whereas it is straightforward to determine whether a linear
18 optimization problem has any solution; finally, because systems of 18 optimization problem has any solution; finally, because systems of
19 linear equations are so common, many programming languages have linear 19 linear equations are so common, many programming languages have linear
26 optimization problem. 26 optimization problem.
27 - Incorporate a C library into Clojure :: We will show how we gave 27 - Incorporate a C library into Clojure :: We will show how we gave
28 Clojure access to the linear programming C library, =lp_solve=. 28 Clojure access to the linear programming C library, =lp_solve=.
29 - Find effective Pokemon types using linear programming :: Building 29 - Find effective Pokemon types using linear programming :: Building
30 on our earlier code, (...) 30 on our earlier code, (...)
31 - Present our results :: (!) 31 - Present our results ::
32 32
33 #which can be represented and solved as a system of linear equations. 33 #which can be represented and solved as a system of linear equations.
34 34
35 * COMMENT 35 * COMMENT
36 This post continues the [[./types.org][previous one]] about pok\eacute{}mon types. 36 This post continues the [[./types.org][previous one]] about pok\eacute{}mon types.
82 we'll show how finding immortal pok\eacute{}mon types can be converted 82 we'll show how finding immortal pok\eacute{}mon types can be converted
83 into a linear problem suitable for solving in the same way. 83 into a linear problem suitable for solving in the same way.
84 84
85 ** The Farmer's Problem 85 ** The Farmer's Problem
86 86
87 Let's solve the Farmer's Problem, a typical linear programming problem 87 Let's solve the Farmer's Problem, an example linear programming problem
88 borrowed from http://lpsolve.sourceforge.net/5.5/formulate.htm. 88 borrowed from http://lpsolve.sourceforge.net/5.5/formulate.htm.
89 89
90 90
91 #+BEGIN_QUOTE 91 #+BEGIN_QUOTE
92 *The Farmer's Problem:* Suppose a farmer has 75 acres on which to 92 *The Farmer's Problem:* Suppose a farmer has 75 acres on which to
136 \) 136 \)
137 137
138 #\(\begin{bmatrix}120&210\\110&30\\1 & 138 #\(\begin{bmatrix}120&210\\110&30\\1 &
139 #1\end{bmatrix}\;\begin{bmatrix}w\\b\end{bmatrix} 139 #1\end{bmatrix}\;\begin{bmatrix}w\\b\end{bmatrix}
140 #\leq \begin{bmatrix}\$15000\\4000\text{ bushels}\\75\text{ acres}\end{bmatrix}\) 140 #\leq \begin{bmatrix}\$15000\\4000\text{ bushels}\\75\text{ acres}\end{bmatrix}\)
141
142 141
143 ** Solution using LP Solve 142 ** Solution using LP Solve
144 #(LP solve is available at http://www.example.com.) 143 #(LP solve is available at http://www.example.com.)
145 In a new file, =farmer.lp=, we list the variables and constraints 144 In a new file, =farmer.lp=, we list the variables and constraints
146 of our problem using LP Solve syntax. 145 of our problem using LP Solve syntax.