From e37d411bf48da2bffab4af4c6523e295347de2a0 Mon Sep 17 00:00:00 2001 From: Alinson S Xavier Date: Tue, 5 May 2020 19:14:38 -0500 Subject: [PATCH] Move instances; add solution; update README; --- .gitignore | 4 + README.md | 4 +- instances/{samples => }/s1.json | 0 instances/samples/s2.json | 148 -------- instances/samples/s2_solution.json | 344 ------------------- instances/solutions/s1.json | 528 +++++++++++++++++++++++++++++ instances/solutions/s1.log | 36 ++ 7 files changed, 570 insertions(+), 494 deletions(-) rename instances/{samples => }/s1.json (100%) delete mode 100644 instances/samples/s2.json delete mode 100644 instances/samples/s2_solution.json create mode 100644 instances/solutions/s1.json create mode 100644 instances/solutions/s1.log diff --git a/.gitignore b/.gitignore index 3692e3b..1b84cb7 100644 --- a/.gitignore +++ b/.gitignore @@ -1,2 +1,6 @@ .ipynb* *.ipynb +instances/Makefile +instances/run.jl +notebooks +.idea diff --git a/README.md b/README.md index 7133fe0..d1014d1 100644 --- a/README.md +++ b/README.md @@ -10,7 +10,7 @@ Table of Contents * [Typical Usage](#typical-usage) * [Describing an instance](#describing-an-instance) * [Optimizing](#optimizing) - * [Current Limitations](#current-limitations) + * [Model Assumptions](#model-assumptions) * [Authors](#authors) Installation @@ -32,7 +32,7 @@ Typical Usage ### Describing an instance -The first step when using ReverseManufacturing.jl is describing the reverse manufacturing pipeline and the relevant data. Each input file is a JSON file with three sections: `parameters`, `products` and `plants`. Below, we describe each section in more detail. For a concrete example, see the file `instances/samples/s2.json`. +The first step when using ReverseManufacturing.jl is describing the reverse manufacturing pipeline and the relevant data. Each input file is a JSON file with three sections: `parameters`, `products` and `plants`. Below, we describe each section in more detail. For a concrete example, see the file `instances/samples/s1.json`. ### Parameters diff --git a/instances/samples/s1.json b/instances/s1.json similarity index 100% rename from instances/samples/s1.json rename to instances/s1.json diff --git a/instances/samples/s2.json b/instances/samples/s2.json deleted file mode 100644 index 16947e5..0000000 --- a/instances/samples/s2.json +++ /dev/null @@ -1,148 +0,0 @@ -{ - "products": { - "lead-acid batteries": { - "transportation cost": 0.0015, - "initial amounts": { - "Chicago": { - "latitude": 41.881944, - "longitude": -87.627778, - "amount": 175000.0 - }, - "Darien": { - "latitude": 41.745556, - "longitude": -87.981111, - "amount": 30000.0 - }, - "Westmont": { - "latitude": 41.794444, - "longitude": -87.976389, - "amount": 25000.0 - }, - "Milwaukee": { - "latitude": 43.05, - "longitude": -87.95, - "amount": 120000.0 - } - } - }, - "lead": { - "transportation cost": 0.0015 - }, - "lead ingots": { - "transportation cost": 0.0017 - }, - "plastic casings": { - "transportation cost": 0.0023 - }, - "plastic pellets": { - "transportation cost": 0.0020 - } - }, - "plants": { - "Disassembly Plant": { - "input": "lead-acid batteries", - "outputs": { - "lead": 0.60, - "plastic casings": 0.05 - }, - "locations": { - "Darien": { - "latitude": 41.745556, - "longitude": -87.981111, - "variable operating cost": 0.12, - "fixed operating cost": 1000, - "opening cost": 10000.0 - }, - "Lemont": { - "latitude": 41.668784, - "longitude": -87.988845, - "variable operating cost": 0.15, - "fixed operating cost": 1000, - "opening cost": 10000.0 - }, - "Greendale": { - "latitude": 42.9375, - "longitude": -87.996944, - "variable operating cost": 0.18, - "fixed operating cost": 1000, - "opening cost": 10000.0 - } - } - }, - "Plastic Recycling Plant": { - "input": "plastic casings", - "outputs": { - "plastic pellets": 0.9 - }, - "locations": { - "Milwaukee": { - "latitude": 43.05, - "longitude": -87.95, - "variable operating cost": 0.08, - "fixed operating cost": 1000, - "opening cost": 10000.0 - }, - "Chicago": { - "latitude": 41.881944, - "longitude": -87.627778, - "variable operating cost": 0.10, - "fixed operating cost": 1000, - "opening cost": 10000.0 - } - } - }, - "Lead Recycling Plant": { - "input": "lead", - "outputs": { - "lead ingots": 0.9 - }, - "locations": { - "Milwaukee": { - "latitude": 43.05, - "longitude": -87.95, - "variable operating cost": 0.20, - "fixed operating cost": 1000, - "opening cost": 10000.0 - } - } - }, - "Lead Sales Point": { - "input": "lead ingots", - "locations": { - "Chicago": { - "latitude": 41.881944, - "longitude": -87.627778, - "variable operating cost": -1.50, - "fixed operating cost": 1000, - "opening cost": 10000.0 - }, - "Milwaukee": { - "latitude": 43.05, - "longitude": -87.95, - "variable operating cost": -2.75, - "fixed operating cost": 0.0, - "opening cost": 0.0 - } - } - }, - "Plastic Sales Point": { - "input": "plastic pellets", - "locations": { - "Chicago": { - "latitude": 41.881944, - "longitude": -87.627778, - "variable operating cost": -0.50, - "fixed operating cost": 0.0, - "opening cost": 0.0 - }, - "Milwaukee": { - "latitude": 43.05, - "longitude": -87.95, - "variable operating cost": -0.62, - "fixed operating cost": 0.0, - "opening cost": 0.0 - } - } - } - } -} \ No newline at end of file diff --git a/instances/samples/s2_solution.json b/instances/samples/s2_solution.json deleted file mode 100644 index 033f351..0000000 --- a/instances/samples/s2_solution.json +++ /dev/null @@ -1,344 +0,0 @@ -{ - "plants": { - "Lead Recycling Plant": { - "Milwaukee": { - "total output": { - "lead ingots": 189000.0 - }, - "latitude": 43.05, - "fixed cost": 11000.0, - "output": { - "lead ingots": { - "Lead Sales Point": { - "Milwaukee": 189000.0 - } - } - }, - "longitude": -87.95, - "total input": 210000.0, - "transportation costs": { - "Disassembly Plant": { - "Greendale": { - "latitude": 42.9375, - "cost": 1411.56, - "distance": 13.07, - "longitude": -87.996944 - }, - "Darien": { - "latitude": 41.745556, - "cost": 29998.44, - "distance": 144.92, - "longitude": -87.981111 - } - } - }, - "variable costs": { - "Disassembly Plant": { - "Greendale": { - "latitude": 42.9375, - "cost": 14400.0, - "longitude": -87.996944 - }, - "Darien": { - "latitude": 41.745556, - "cost": 27600.0, - "longitude": -87.981111 - } - } - }, - "input": { - "Disassembly Plant": { - "Greendale": { - "amount": 72000.0, - "latitude": 42.9375, - "longitude": -87.996944 - }, - "Darien": { - "amount": 138000.0, - "latitude": 41.745556, - "longitude": -87.981111 - } - } - } - } - }, - "Disassembly Plant": { - "Greendale": { - "total output": { - "lead": 72000.0, - "plastic casings": 6000.0 - }, - "latitude": 42.9375, - "fixed cost": 11000.0, - "output": { - "lead": { - "Lead Recycling Plant": { - "Milwaukee": 72000.0 - } - }, - "plastic casings": { - "Plastic Recycling Plant": { - "Milwaukee": 6000.0 - } - } - }, - "longitude": -87.996944, - "total input": 120000.0, - "transportation costs": { - "Origin": { - "Milwaukee": { - "latitude": 43.05, - "cost": 2352.6, - "distance": 13.07, - "longitude": -87.95 - } - } - }, - "variable costs": { - "Origin": { - "Milwaukee": { - "latitude": 43.05, - "cost": 21600.0, - "longitude": -87.95 - } - } - }, - "input": { - "Origin": { - "Milwaukee": { - "amount": 120000.0, - "latitude": 43.05, - "longitude": -87.95 - } - } - } - }, - "Darien": { - "total output": { - "lead": 138000.0, - "plastic casings": 11500.0 - }, - "latitude": 41.745556, - "fixed cost": 11000.0, - "output": { - "lead": { - "Lead Recycling Plant": { - "Milwaukee": 138000.0 - } - }, - "plastic casings": { - "Plastic Recycling Plant": { - "Milwaukee": 11500.0 - } - } - }, - "longitude": -87.981111, - "total input": 230000.0, - "transportation costs": { - "Origin": { - "Chicago": { - "latitude": 41.881944, - "cost": 8673.0, - "distance": 33.04, - "longitude": -87.627778 - }, - "Westmont": { - "latitude": 41.794444, - "cost": 204.0, - "distance": 5.44, - "longitude": -87.976389 - }, - "Darien": { - "latitude": 41.745556, - "cost": 0.0, - "distance": 0.0, - "longitude": -87.981111 - } - } - }, - "variable costs": { - "Origin": { - "Chicago": { - "latitude": 41.881944, - "cost": 21000.0, - "longitude": -87.627778 - }, - "Westmont": { - "latitude": 41.794444, - "cost": 3000.0, - "longitude": -87.976389 - }, - "Darien": { - "latitude": 41.745556, - "cost": 3600.0, - "longitude": -87.981111 - } - } - }, - "input": { - "Origin": { - "Chicago": { - "amount": 175000.0, - "latitude": 41.881944, - "longitude": -87.627778 - }, - "Westmont": { - "amount": 25000.0, - "latitude": 41.794444, - "longitude": -87.976389 - }, - "Darien": { - "amount": 30000.0, - "latitude": 41.745556, - "longitude": -87.981111 - } - } - } - } - }, - "Plastic Recycling Plant": { - "Milwaukee": { - "total output": { - "plastic pellets": 15750.0 - }, - "latitude": 43.05, - "fixed cost": 11000.0, - "output": { - "plastic pellets": { - "Plastic Sales Point": { - "Milwaukee": 15750.0 - } - } - }, - "longitude": -87.95, - "total input": 17500.0, - "transportation costs": { - "Disassembly Plant": { - "Greendale": { - "latitude": 42.9375, - "cost": 180.366, - "distance": 13.07, - "longitude": -87.996944 - }, - "Darien": { - "latitude": 41.745556, - "cost": 3833.134, - "distance": 144.92, - "longitude": -87.981111 - } - } - }, - "variable costs": { - "Disassembly Plant": { - "Greendale": { - "latitude": 42.9375, - "cost": 480.0, - "longitude": -87.996944 - }, - "Darien": { - "latitude": 41.745556, - "cost": 920.0, - "longitude": -87.981111 - } - } - }, - "input": { - "Disassembly Plant": { - "Greendale": { - "amount": 6000.0, - "latitude": 42.9375, - "longitude": -87.996944 - }, - "Darien": { - "amount": 11500.0, - "latitude": 41.745556, - "longitude": -87.981111 - } - } - } - } - }, - "Lead Sales Point": { - "Milwaukee": { - "total output": {}, - "latitude": 43.05, - "fixed cost": 0.0, - "output": {}, - "longitude": -87.95, - "total input": 189000.0, - "transportation costs": { - "Lead Recycling Plant": { - "Milwaukee": { - "latitude": 43.05, - "cost": 0.0, - "distance": 0.0, - "longitude": -87.95 - } - } - }, - "variable costs": { - "Lead Recycling Plant": { - "Milwaukee": { - "latitude": 43.05, - "cost": -519750.0, - "longitude": -87.95 - } - } - }, - "input": { - "Lead Recycling Plant": { - "Milwaukee": { - "amount": 189000.0, - "latitude": 43.05, - "longitude": -87.95 - } - } - } - } - }, - "Plastic Sales Point": { - "Milwaukee": { - "total output": {}, - "latitude": 43.05, - "fixed cost": 0.0, - "output": {}, - "longitude": -87.95, - "total input": 15750.0, - "transportation costs": { - "Plastic Recycling Plant": { - "Milwaukee": { - "latitude": 43.05, - "cost": 0.0, - "distance": 0.0, - "longitude": -87.95 - } - } - }, - "variable costs": { - "Plastic Recycling Plant": { - "Milwaukee": { - "latitude": 43.05, - "cost": -9765.0, - "longitude": -87.95 - } - } - }, - "input": { - "Plastic Recycling Plant": { - "Milwaukee": { - "amount": 15750.0, - "latitude": 43.05, - "longitude": -87.95 - } - } - } - } - } - }, - "costs": { - "fixed": 44000.0, - "total": -346261.9, - "transportation": 46653.1, - "variable": -436915.0 - } -} diff --git a/instances/solutions/s1.json b/instances/solutions/s1.json new file mode 100644 index 0000000..90989d8 --- /dev/null +++ b/instances/solutions/s1.json @@ -0,0 +1,528 @@ +{ + "plants": { + "F3": { + "L5": { + "total output": {}, + "latitude": 100.0, + "expansion cost": [ + 0.0, + 0.0 + ], + "output": { + "dispose": {}, + "send": {} + }, + "longitude": 100.0, + "total input": [ + 757.3824000000001, + 757.3824000000001 + ], + "fixed operating cost": [ + 0.0, + 0.0 + ], + "input": { + "F2": { + "L4": { + "amount": [ + 757.3824000000001, + 757.3824000000001 + ], + "latitude": 0.75, + "distance": 8811.73, + "longitude": 0.2, + "variable operating cost": [ + -11360.736, + -11360.736 + ], + "transportation cost": [ + 13.254192000000003, + 13.254192000000003 + ] + } + } + }, + "opening cost": [ + 0.0, + 0.0 + ], + "capacity": [ + 1.0e8, + 1.0e8 + ] + } + }, + "F1": { + "L1": { + "total output": {}, + "latitude": 0.0, + "expansion cost": [ + 750.0, + 0.0 + ], + "output": { + "dispose": {}, + "send": {} + }, + "longitude": 0.0, + "total input": [ + 1000.0, + 1000.0 + ], + "fixed operating cost": [ + 30.0, + 30.0 + ], + "input": { + "Origin": { + "C3": { + "amount": [ + 212.97, + 212.97 + ], + "latitude": 84.0, + "distance": 8889.75, + "longitude": 76.0, + "variable operating cost": [ + 6389.1, + 6389.1 + ], + "transportation cost": [ + 3.19455, + 3.19455 + ] + }, + "C7": { + "amount": [ + 246.62, + 246.62 + ], + "latitude": 30.0, + "distance": 8526.39, + "longitude": 83.0, + "variable operating cost": [ + 7398.6, + 7398.6 + ], + "transportation cost": [ + 3.6993, + 3.6993 + ] + }, + "C5": { + "amount": [ + 510.33, + 510.33 + ], + "latitude": 32.0, + "distance": 9148.52, + "longitude": 92.0, + "variable operating cost": [ + 15309.9, + 15309.9 + ], + "transportation cost": [ + 7.6549499999999995, + 7.6549499999999995 + ] + }, + "C9": { + "amount": [ + 30.08, + 30.08 + ], + "latitude": 74.0, + "distance": 8201.21, + "longitude": 52.0, + "variable operating cost": [ + 902.4, + 902.4 + ], + "transportation cost": [ + 0.45119999999999993, + 0.45119999999999993 + ] + } + } + }, + "opening cost": [ + 500.0, + 0.0 + ], + "capacity": [ + 1000.0, + 1000.0 + ] + }, + "L2": { + "total output": {}, + "latitude": 0.5, + "expansion cost": [ + 3738.6399999999967, + 0.0 + ], + "output": { + "dispose": {}, + "send": {} + }, + "longitude": 0.5, + "total input": [ + 3738.64, + 3738.64 + ], + "fixed operating cost": [ + 50.0, + 50.0 + ], + "input": { + "Origin": { + "C1": { + "amount": [ + 934.56, + 934.56 + ], + "latitude": 7.0, + "distance": 1017.44, + "longitude": 7.0, + "variable operating cost": [ + 46728.0, + 46728.0 + ], + "transportation cost": [ + 14.018399999999998, + 14.018399999999998 + ] + }, + "C2": { + "amount": [ + 198.95, + 198.95 + ], + "latitude": 7.0, + "distance": 2165.47, + "longitude": 19.0, + "variable operating cost": [ + 9947.5, + 9947.5 + ], + "transportation cost": [ + 2.98425, + 2.98425 + ] + }, + "C8": { + "amount": [ + 706.17, + 706.17 + ], + "latitude": 35.0, + "distance": 5421.1, + "longitude": 40.0, + "variable operating cost": [ + 35308.5, + 35308.5 + ], + "transportation cost": [ + 10.59255, + 10.59255 + ] + }, + "C6": { + "amount": [ + 471.66, + 471.66 + ], + "latitude": 14.0, + "distance": 6595.52, + "longitude": 62.0, + "variable operating cost": [ + 23583.0, + 23583.0 + ], + "transportation cost": [ + 7.0749, + 7.0749 + ] + }, + "C10": { + "amount": [ + 536.52, + 536.52 + ], + "latitude": 22.0, + "distance": 6014.13, + "longitude": 54.0, + "variable operating cost": [ + 26826.0, + 26826.0 + ], + "transportation cost": [ + 8.047799999999999, + 8.047799999999999 + ] + }, + "C4": { + "amount": [ + 352.19, + 352.19 + ], + "latitude": 21.0, + "distance": 2802.12, + "longitude": 16.0, + "variable operating cost": [ + 17609.5, + 17609.5 + ], + "transportation cost": [ + 5.28285, + 5.28285 + ] + }, + "C7": { + "amount": [ + 538.59, + 538.59 + ], + "latitude": 30.0, + "distance": 8469.86, + "longitude": 83.0, + "variable operating cost": [ + 26929.5, + 26929.5 + ], + "transportation cost": [ + 8.078850000000001, + 8.078850000000001 + ] + } + } + }, + "opening cost": [ + 1000.0, + 0.0 + ], + "capacity": [ + 3738.6399999999994, + 3738.6399999999967 + ] + } + }, + "F2": { + "L3": { + "total output": {}, + "latitude": 25.0, + "expansion cost": [ + 0.0, + 0.0 + ], + "output": { + "dispose": {}, + "send": {} + }, + "longitude": 65.0, + "total input": [ + 0.0, + 0.0 + ], + "fixed operating cost": [ + -0.0, + -0.0 + ], + "input": {}, + "opening cost": [ + -0.0, + 0.0 + ], + "capacity": [ + 0.0, + 0.0 + ] + }, + "L4": { + "total output": {}, + "latitude": 0.75, + "expansion cost": [ + 0.0, + 0.0 + ], + "output": { + "dispose": {}, + "send": {} + }, + "longitude": 0.2, + "total input": [ + 946.728, + 946.728 + ], + "fixed operating cost": [ + 50.0, + 50.0 + ], + "input": { + "F1": { + "L1": { + "amount": [ + 199.0, + 199.0 + ], + "latitude": 0.0, + "distance": 85.87, + "longitude": 0.0, + "variable operating cost": [ + 9950.0, + 9950.0 + ], + "transportation cost": [ + 3.98, + 3.98 + ] + }, + "L2": { + "amount": [ + 747.728, + 747.728 + ], + "latitude": 0.5, + "distance": 43.35, + "longitude": 0.5, + "variable operating cost": [ + 37386.399999999994, + 37386.399999999994 + ], + "transportation cost": [ + 14.954559999999999, + 14.954559999999999 + ] + } + } + }, + "opening cost": [ + 3000.0, + 0.0 + ], + "capacity": [ + 946.728, + 1.0e8 + ] + } + }, + "F4": { + "L6": { + "total output": {}, + "latitude": 50.0, + "expansion cost": [ + 0.0, + 0.0 + ], + "output": { + "dispose": {}, + "send": {} + }, + "longitude": 50.0, + "total input": [ + 2415.6564, + 2415.6564 + ], + "fixed operating cost": [ + 0.0, + 0.0 + ], + "input": { + "F1": { + "L1": { + "amount": [ + 499.0, + 499.0 + ], + "latitude": 0.0, + "distance": 6893.41, + "longitude": 0.0, + "variable operating cost": [ + -7485.0, + -7485.0 + ], + "transportation cost": [ + 6.237500000000001, + 6.237500000000001 + ] + }, + "L2": { + "amount": [ + 1869.3199999999997, + 1869.3199999999997 + ], + "latitude": 0.5, + "distance": 6828.89, + "longitude": 0.5, + "variable operating cost": [ + -28039.799999999996, + -28039.799999999996 + ], + "transportation cost": [ + 23.3665, + 23.3665 + ] + } + }, + "F2": { + "L4": { + "amount": [ + 47.336400000000005, + 47.336400000000005 + ], + "latitude": 0.75, + "distance": 6824.63, + "longitude": 0.2, + "variable operating cost": [ + -710.046, + -710.046 + ], + "transportation cost": [ + 0.591705, + 0.591705 + ] + } + } + }, + "opening cost": [ + 0.0, + 0.0 + ], + "capacity": [ + 1.0e8, + 1.0e8 + ] + } + } + }, + "costs": { + "opening": [ + 4500.0, + 0.0 + ], + "expansion": [ + 4488.639999999997, + 0.0 + ], + "variable operating": [ + 216672.818, + 216672.818 + ], + "fixed operating": [ + 130.0, + 130.0 + ], + "total": [ + 225924.922057, + 216936.282057 + ], + "transportation": [ + 133.464057, + 133.464057 + ], + "disposal": [ + 0.0, + 0.0 + ] + } +} diff --git a/instances/solutions/s1.log b/instances/solutions/s1.log new file mode 100644 index 0000000..3e24158 --- /dev/null +++ b/instances/solutions/s1.log @@ -0,0 +1,36 @@ +Gurobi Optimizer version 9.0.0 build v9.0.0rc2 (linux64) +Optimize a model with 112 rows, 141 columns and 378 nonzeros +Model fingerprint: 0xf1c6e6cc +Variable types: 117 continuous, 24 integer (24 binary) +Coefficient statistics: + Matrix range [5e-02, 1e+08] + Objective range [1e+00, 3e+03] + Bounds range [1e+00, 1e+08] + RHS range [3e+01, 1e+08] +Found heuristic solution: objective 2000175.3046 +Presolve removed 89 rows and 110 columns +Presolve time: 0.00s +Presolved: 23 rows, 31 columns, 68 nonzeros +Found heuristic solution: objective 1999822.1568 +Variable types: 25 continuous, 6 integer (6 binary) + +Root relaxation: objective 1.871010e+06, 9 iterations, 0.00 seconds + + Nodes | Current Node | Objective Bounds | Work + Expl Unexpl | Obj Depth IntInf | Incumbent BestBd Gap | It/Node Time + + 0 0 1871009.93 0 2 1999822.16 1871009.93 6.44% - 0s +H 0 0 1871552.8257 1871009.93 0.03% - 0s + +Explored 1 nodes (9 simplex iterations) in 0.00 seconds +Thread count was 4 (of 16 available processors) + +Solution count 3: 1.87155e+06 1.99982e+06 2.00018e+06 + +Optimal solution found (tolerance 1.00e-02) +Best objective 1.871552825663e+06, best bound 1.871009926997e+06, gap 0.0290% +Reading s1.json... +Building graph... +Building optimization model... +Optimizing... +Extracting solution...