Generator of Stochastic Network Design Problems (SNDP) in .mps and .mps formats.
In every location L\{m} a company produces some of the intermediate products P\{e}. For the production of an end product e in P locations F subset of L are possible. The construction of a production line for end product e with a capacity of u units costs f. In addition, for every possible route (i,j) in A, arise the delivery cost c_ij per product unit. An estimated d units of product e can be delivered to the market location m and sold for the price a per unit. Where should the production lines for the end product e be set up to maximize the profit?
Deman d is assumed to be stochastic.
Package can be used to generate the instances with the different amount of locations, products, and stochastic scenarios.
Above is the visualization of the instance with 10 locations and 5 products. Products manufactured in every location are mentioned in the node captions. Red node is the market, grey nodes are the locations with the end product (5). Numbers near the arcs are the delivery costs.
To get a local copy up and running follow these simple steps.
- Python 3.6
- pyyaml
- graphviz (optional, for visualization)
- OptiMax Component Library (optional, for price a adjustment)
-
Clone the repo
git clone https://github.com/pashtetgp/sndpgen.git
-
cd to project folder and install the package
cd C:\CodingProjects\sndpgen pip install ..\sndpgen
- install the package with
pip install graphviz
- download binaries 32 bit here
- install them, e.g., here: C:\Program Files (x86)\Graphviz2.38. Bins will be in folder C:\Program Files (x86)\Graphviz2.38\bin
- edit system env vars: to System path append bins folder
- restart pc
Run in command line pip uninstall sndpgen
- Create a 'param.yaml' file and specify the number locations, number products and number scenarios in new instances. Instances with all possible combinations of parameters will be generated.
In addition, multiple instance variations for each parameter combination can be generated. Variations for the same parameters in parameter combination differ by delivery costs between locations and other values. Technically different random seed is used for each parameter combination. E.g.,
num_locations: - 10 - 20 - 40 num_products: - 5 - 10 - 20 num_scen: - 1 - 25 - 125 - 500 - 1000 - 10000 num_variations: 3 #create 3 variations for each combination
-
cd to project folder, e.g.,
cd C:\CodingProjects\sndp
-
run
sndp_gen
. This command accepts one argument--yaml
- .yaml file with the parameters of SNDP problems to generate. Default: param.yaml
See the open issues for a list of proposed features (and known issues).
Any contributions you make are greatly appreciated.
- Fork the Project
- Create your Feature Branch (
git checkout -b feature/AmazingFeature
) - Commit your Changes (
git commit -m 'Add some AmazingFeature'
) - Push to the Branch (
git push origin feature/AmazingFeature
) - Open a Pull Request
Distributed under the MIT License. See LICENSE
for more information.
Pavlo Glushko
Project Link: https://github.com/pashtetgp/sndpgen