summaryrefslogtreecommitdiff
path: root/glpk-5.0/examples/sql/transp.sql
diff options
context:
space:
mode:
authorPasha <pasha@member.fsf.org>2023-01-27 00:54:07 +0000
committerPasha <pasha@member.fsf.org>2023-01-27 00:54:07 +0000
commitef800d4ffafdbde7d7a172ad73bd984b1695c138 (patch)
tree920cc189130f1e98f252283fce94851443641a6d /glpk-5.0/examples/sql/transp.sql
parentec4ae3c2b5cb0e83fb667f14f832ea94f68ef075 (diff)
downloadoneapi-ef800d4ffafdbde7d7a172ad73bd984b1695c138.tar.gz
oneapi-ef800d4ffafdbde7d7a172ad73bd984b1695c138.tar.bz2
simplex-glpk with modified glpk for fpgaHEADmaster
Diffstat (limited to 'glpk-5.0/examples/sql/transp.sql')
-rw-r--r--glpk-5.0/examples/sql/transp.sql45
1 files changed, 45 insertions, 0 deletions
diff --git a/glpk-5.0/examples/sql/transp.sql b/glpk-5.0/examples/sql/transp.sql
new file mode 100644
index 0000000..8737333
--- /dev/null
+++ b/glpk-5.0/examples/sql/transp.sql
@@ -0,0 +1,45 @@
+CREATE DATABASE glpk;
+CREATE USER glpk@localhost IDENTIFIED BY 'gnu';
+GRANT ALL PRIVILEGES ON glpk.* TO glpk@localhost;
+USE glpk;
+# production capacity
+DROP TABLE transp_capa;
+CREATE TABLE transp_capa (
+ PLANT TEXT(127),
+ CAPA REAL,
+ PRIMARY KEY ( PLANT(127) )
+ );
+INSERT INTO transp_capa ( PLANT, CAPA ) VALUES ( 'Seattle', 350 );
+INSERT INTO transp_capa ( PLANT, CAPA ) VALUES ( 'San Diego', 600 );
+# demand
+DROP TABLE transp_demand;
+CREATE TABLE transp_demand (
+ MARKET TEXT(127),
+ DEMAND REAL,
+ PRIMARY KEY ( MARKET(127) )
+ );
+INSERT INTO transp_demand ( MARKET, DEMAND ) VALUES ( 'New York', 325 );
+INSERT INTO transp_demand ( MARKET, DEMAND ) VALUES ( 'Chicago', 300 );
+INSERT INTO transp_demand ( MARKET, DEMAND ) VALUES ( 'Topeka', 275 );
+# distance
+DROP TABLE transp_dist;
+CREATE TABLE transp_dist (
+ LOC1 TEXT(127),
+ LOC2 TEXT(127),
+ DIST REAL,
+ PRIMARY KEY ( LOC1(127), LOC2(127) )
+ );
+INSERT INTO transp_dist ( LOC1, LOC2, DIST ) VALUES ( 'Seattle', 'New York', 2.5 );
+INSERT INTO transp_dist ( LOC1, LOC2, DIST ) VALUES ( 'Seattle', 'Chicago', 1.7 );
+INSERT INTO transp_dist ( LOC1, LOC2, DIST ) VALUES ( 'Seattle', 'Topeka', 1.8 );
+INSERT INTO transp_dist ( LOC1, LOC2, DIST ) VALUES ( 'San Diego', 'New York', 2.5 );
+INSERT INTO transp_dist ( LOC1, LOC2, DIST ) VALUES ( 'San Diego', 'Chicago', 1.8 );
+INSERT INTO transp_dist ( LOC1, LOC2, DIST ) VALUES ( 'San Diego', 'Topeka', 1.4 );
+# result
+DROP TABLE transp_result;
+CREATE TABLE transp_result (
+ LOC1 TEXT(127),
+ LOC2 TEXT(127),
+ QUANTITY REAL,
+ PRIMARY KEY ( LOC1(127), LOC2(127) )
+ );