simplex 1.0.0 → 1.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (3) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +38 -0
  3. metadata +3 -2
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 607708dc2b1019f3de26f43a8f714d7ba18a1d27
4
- data.tar.gz: e05193d59e5237b419560bdb8aa65add6894697e
3
+ metadata.gz: 8d586cdecfc5ebff9463168a641095b14c66f3eb
4
+ data.tar.gz: 1b99632bec24b3ea8ecf2191e3991f359c45a39a
5
5
  SHA512:
6
- metadata.gz: 57ee4659de8ec4e8660bcc38b412fdd636f300903def27a9b13b1b5baed75a84ead979fb8f7bb84d297dbd17b0c2f8fd0ccfe664463460435a3039ed2b06fc95
7
- data.tar.gz: 4915382d169cd3e9743ef3bba31f94ef2c3d89c6862d0849f361689435d1984b3ffeb9b118f8a983ee5d4af24668098452af29cd78a1dcfbbdcf957019963320
6
+ metadata.gz: 30a1509d8f7a9555ed74f3e8ee2148f077d99762e35db770ec5234a4e001ca508fde8e22c9c169f47ebd4bbdcf7a4d4b88d48b2c765f0f5877fd4432ce42198d
7
+ data.tar.gz: cdda93f918effea817079e509e17790c864fb681f5427b9d27061649873d7d91035fd60269be7f402521edcdc95a47f35bccb990c4af14cab6261e21aeae4123
@@ -0,0 +1,38 @@
1
+
2
+ simplex
3
+ =======
4
+
5
+ A naive pure-Ruby implementation of the Simplex algorithm for solving linear programming problems. Solves maximizations in standard form.
6
+
7
+ ## Why?
8
+
9
+ I wrote this because I needed to solve some small allocation problems for a web game I'm writing,
10
+ and there didn't seem to be any Ruby 2.0 bindings for the "pro" solver libraries,
11
+ and anyway they are hard to install on Heroku.
12
+
13
+ * *Use it for*: small LP problems, when you have trouble loading native or Java solvers,
14
+ and when you can accept not that great performance.
15
+ * *Don't use it for*: large LP problems, when you have access to native solvers, when you need very fast solving time.
16
+
17
+ ## Usage
18
+
19
+ To solve the linear programming problem:
20
+
21
+ max x + y
22
+
23
+ 2x + y <= 4
24
+ x + 2y <= 3
25
+
26
+ x, y >= 0
27
+
28
+ Like this:
29
+
30
+ result = Simplex.new(
31
+ [1, 1], # coefficients of objective function
32
+ [ # matrix of inequality coefficients on the lhs ...
33
+ [ 2, 1],
34
+ [ 1, 2],
35
+ ],
36
+ [4, 3] # .. and the rhs of the inequalities
37
+ ).solution
38
+
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: simplex
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.0
4
+ version: 1.0.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Daniel Lucraft
@@ -18,7 +18,8 @@ extensions: []
18
18
  extra_rdoc_files: []
19
19
  files:
20
20
  - lib/simplex.rb
21
- homepage:
21
+ - README.md
22
+ homepage: https://github.com/danlucraft/simplex
22
23
  licenses: []
23
24
  metadata: {}
24
25
  post_install_message: