-
Notifications
You must be signed in to change notification settings - Fork 0
/
choices-of-linear-programming-solver.html
185 lines (174 loc) · 10.1 KB
/
choices-of-linear-programming-solver.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
<!DOCTYPE html>
<html lang="en">
<head>
<title>Choices of Linear Programming Solver - You don't need to prove this</title>
<link href="https://newptcai.github.io/feeds/all.atom.xml" type="application/atom+xml" rel="alternate" title="You don't need to prove this Full Atom Feed" />
<!-- CSS -->
<link rel="stylesheet" type="text/css" href="https://newptcai.github.io/theme/css/w3.css">
<link rel="stylesheet" type="text/css" href="https://newptcai.github.io/theme/css/style.css">
<link rel="stylesheet" type="text/css" href="https://newptcai.github.io/theme/css/jqcloud.css">
<link rel="stylesheet" type="text/css" href="https://newptcai.github.io/theme/css/all.min.css">
<link rel="stylesheet" type="text/css" href="https://newptcai.github.io/theme/css/shariff.min.css">
<link rel="stylesheet" type="text/css" href="https://newptcai.github.io/theme/css/pygments-highlight-github.css">
<!-- JavaScript -->
<script src="https://newptcai.github.io/theme/js/jquery-3.5.1.min.js"></script>
<script src="https://newptcai.github.io/theme/js/jqcloud.min.js"></script>
<!-- Meta -->
<meta charset="utf-8" />
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<meta name="HandheldFriendly" content="True" />
<meta name="author" content="Xing Shi Cai" />
<meta name="description" content="At the time of written, I was TA for COMP 362, Honors Algorithm Design at McGill University. This post was written for the students." />
<meta name="keywords" content="teaching, optimization, programming">
<!-- Facebook OpenGraph -->
<meta property="og:site_name" content="You don't need to prove this">
<meta property="og:title" content="Choices of Linear Programming Solver - You don't need to prove this" />
<meta property="og:description" content="At the time of written, I was TA for COMP 362, Honors Algorithm Design at McGill University. This post was written for the students." />
<meta property="og:image" content="https://newptcai.github.io">
<meta property="og:type" content="article" />
<meta property="og:url" content="https://newptcai.github.io/choices-of-linear-programming-solver.html" />
<meta property="og:locale" content="de_DE" />
<meta property="og:locale:alternate" content="en_US" />
<!-- Twitter -->
<meta name="twitter:card" content="summary_large_image">
<meta name="twitter:title" content="Choices of Linear Programming Solver - You don't need to prove this">
<meta name="twitter:description" content="At the time of written, I was TA for COMP 362, Honors Algorithm Design at McGill University. This post was written for the students.">
<meta name="twitter:image" content="https://newptcai.github.io">
</head>
<body>
<div class="w3-row w3-card w3-white">
<header id=banner>
<!-- AUTHOR INITIALS-->
<a href="https://newptcai.github.io" id=logo title="Home">XS</a>
<nav id="menu">
<ul>
<li><a href="https://newptcai.github.io/pages/research.html">Research</a></li>
<li><a href="https://newptcai.github.io/pages/teaching.html">Teaching</a></li>
<li class="active"><a href="https://newptcai.github.io/category/math.html">math</a></li>
<li ><a href="https://newptcai.github.io/category/mumble.html">mumble</a></li>
<li ><a href="https://newptcai.github.io/category/photo.html">photo</a></li>
</ul>
</nav>
</header>
</div>
<br>
<article>
<header class="w3-container col-main">
<h1>Choices of Linear Programming Solver</h1>
<div class="post-info">
<div class="w3-opacity w3-margin-right w3-margin-bottom" style="flex-grow: 1;">
<span> Posted on Fri 25 January 2013 in <a href="https://newptcai.github.io/category/math.html" style="font-style: italic">math</a>
</span>
</div>
<div id="article-tags">
<span class="w3-tag w3-light-grey w3-text-red w3-hover-red">
<a href="https://newptcai.github.io/tag/teaching.html" title=" All posts about Teaching
">#teaching</a>
</span>
<span class="w3-tag w3-light-grey w3-text-red w3-hover-red">
<a href="https://newptcai.github.io/tag/optimization.html" title=" All posts about Optimization
">#optimization</a>
</span>
<span class="w3-tag w3-light-grey w3-text-red w3-hover-red">
<a href="https://newptcai.github.io/tag/programming.html" title=" All posts about Programming
">#programming</a>
</span>
</div>
</div>
</header>
<br>
<div class="col-main w3-container">
<main id="article-content">
<p><em>At the time of written, I was TA for COMP 362, Honors Algorithm Design at McGill University. This
post was written for the students.</em></p>
<p><img src="https://newptcai.github.io/images/lp.jpg" class="thumbnail"/></p>
<h2>lp_solve</h2>
<p>This program can be used to solve linear or integer programs.
The command for running lp_solve is: </p>
<div class="highlight"><pre><span></span><code><span class="err">lp_solve input-file</span>
</code></pre></div>
<ul>
<li>A small lp_solve session is
shown <a href="http://cgm.cs.mcgill.ca/~avis/courses/software/lp_solve/lp_solve.html">here</a>.</li>
<li>Some example input and output files are
available <a href="http://cgm.cs.mcgill.ca/~avis/courses/software/lp_solve/lp_examples/">here</a>.</li>
<li>The man page
is <a href="http://cgm.cs.mcgill.ca/~avis/courses/software/lp_solve/lp_solve.man.html">here</a>.</li>
<li>You can download the entire package from the
lp_solve <a href="http://elib.zib.de/pub/Packages/mathprog/linprog/lp-solve/">homepage</a>.</li>
<li>Another help page for reference can be
found <a href="http://www.statslab.cam.ac.uk/~rrw1/opt/lp_solve/">here</a>.</li>
</ul>
<h2>LINGO</h2>
<p><a href="http://www.lindo.com/index.php?option=com_content&view=article&id=2&Itemid=10">LINGO</a> supports
Windows and Linux. It provides a trial version that you
can <a href="http://www.lindo.com/index.php?option=com_content&view=article&id=35&Itemid=20">download</a>.
You need to provide an email address to receive the download link. The
first chapter of the
<a href="http://www.lindo.com/downloads/PDF/LINGO13.pdf">manual</a> covers pretty
much everything you need for the assignment. You may also find
this <a href="http://www.lindo.com/index.php?option=com_content&view=article&id=138&Itemid=59">tutorial</a> useful.</p>
<h2>EXCEL</h2>
<p>There are two ways to use EXCEL to solve LP problems.</p>
<p>For very simple LP problems, you can just use EXCEL's internal solver.
These videos
(<a href="http://www.youtube.com/watch?v=TNLqtmkK4EA&feature=share&list=UUfPM_sW7vo40IGsrDhrWBdQ">1</a>, <a href="http://www.youtube.com/watch?v=wQhNEMvh3MM&feature=share&list=UUfPM_sW7vo40IGsrDhrWBdQ">2</a>, <a href="http://www.youtube.com/watch?v=9tHqa8EV3rc&feature=share&list=UUfPM_sW7vo40IGsrDhrWBdQ">3</a>)
give an example of how to do it. You do not need anything other than
EXCEL, but this method might not suitable for problem with many
variables. If you are using EXCEL 2010, you need to load solver
add-in <a href="http://www.youtube.com/watch?v=9tHqa8EV3rc&feature=share&list=UUfPM_sW7vo40IGsrDhrWBdQ">like
this</a>.</p>
<p>Another choice is to use an <a href="http://www.lindo.com/index.php?option=com_content&view=article&id=3&Itemid=11">EXCEL
add-in</a> provided
by the same company which builds LINGO. Read the first chapter of its
<a href="http://www.lindo.com/downloads/PDF/WB11.pdf">manual</a> if you choose this
option. Here is a video
<a href="http://www.lindo.com/index.php?option=com_content&view=article&id=141&Itemid=62">demo</a>.</p>
<h2>MATLAB</h2>
<p>Here is the <a href="http://www.mathworks.com/help/optim/ug/linprog.html">official
document</a> of how to
solve LP in MATLAB. This <a href="http://web.mit.edu/lpsolve/doc/MATLAB.htm">step-by-step
tutorial</a> might also be
helpful.
This <a href="http://www.phy.ohiou.edu/computer/matlab/techdoc/pdfdocs/getstart.pdf">book</a> does
not cover LP, but can be useful if you are completely new to MATLAB.</p>
<p>You don't need to install MATLAB on your own computer. Instead you can
ssh to ubuntu.cs.mcgill.ca to use a command line version of MATLAB.</p>
<h2>Other Choices</h2>
<p>There are plenty of other choices. The one which this TA is most
familiar with
is <a href="http://www-01.ibm.com/software/integration/optimization/cplex-optimizer/">CPLEX</a> provided
by IBM. Here is
a <a href="http://www.me.utexas.edu/~bard/LP/LP%20Handouts/CPLEX%20Tutorial%20Handout.pdf">tutorial</a>. Again,
you can SSH to ubuntu.cs.mcgill.ca to use CPLEX. But if you do want to
install it, you can get a trial version by
registering <a href="http://www14.software.ibm.com/download/data/web/en_US/trialprograms/P525292C13392Y07.html?S_TACT=109HE1MV">here</a>.
Once registered, follow the
<a href="http://download.boulder.ibm.com/ibmdl/pub/software/dw/university/support/ILOGQuickStart.pdf">tutorial</a> to
install it.</p>
</main>
<br>
<footer>
<div class="adjust-width">
<div id="author-block" class="w3-light-grey w3-border">
<img style="width: 35px; height: 56px; margin-left:50px;" src="https://newptcai.github.io/theme/images/bookmark-red.png" alt="bookmark"></img>
<div id="author-info">
<a href="https://newptcai.github.io/authors.html#xing-shi-cai"><img
style="width: 60px; height: 60px;" src="https://newptcai.github.io/authors/xing-shi-cai.png" onerror="this.src='https://newptcai.github.io/theme/images/avatar.png'"></img>
</a>
<div style="margin-left: 20px; margin-top: 15px;">
<a href="https://newptcai.github.io/authors.html#xing-shi-cai"><span id="author-name" class="w3-hover-text-dark-grey">Xing Shi Cai</span></a>
<p id="author-story" style="max-width: 500px;"></p>
</div>
</div>
</div>
</div>
<br>
</footer>
</div>
</article>
<br>
<script src="https://newptcai.github.io/theme/js/shariff.min.js"></script>
</body>
</html>