weiminhu commited on
Commit
3aeb2d3
·
verified ·
1 Parent(s): 2a0ad80

Update README.md

Browse files
Files changed (1) hide show
  1. README.md +18 -0
README.md CHANGED
@@ -271,3 +271,21 @@ configs:
271
  🌐 [website](https://sites.google.com/usc.edu/distributional-miplib)
272
 
273
  Introducing Distributional MIPLIB (D-MIPLIB), the first comprehensive standardized dataset for evaluating ML-guided Mixed Integer Linear Programming (MILP) solving. Details of D-MIPLIB can be found on our [website](https://sites.google.com/usc.edu/distributional-miplib).
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
271
  🌐 [website](https://sites.google.com/usc.edu/distributional-miplib)
272
 
273
  Introducing Distributional MIPLIB (D-MIPLIB), the first comprehensive standardized dataset for evaluating ML-guided Mixed Integer Linear Programming (MILP) solving. Details of D-MIPLIB can be found on our [website](https://sites.google.com/usc.edu/distributional-miplib).
274
+
275
+ ### Loading MILP instances
276
+
277
+ MILP instances in this library are stored as text strings. You can download the MILP as *.lp files and solve the MILP by
278
+ ```python
279
+ from datasets import load_dataset
280
+ import gurobipy as gp
281
+
282
+ dataset = load_dataset("weiminhu/D-MIPLIB","CA-easy", split='test')
283
+ test_instance = dataset[0]['MILP']
284
+ ins_save_path = "./test_instance.lp"
285
+ with open(ins_save_path, "w") as file:
286
+ tmp=test_instance[2:-1]
287
+ tmp=tmp.replace("\\n","\n")
288
+ file.write(tmp)
289
+ model=gp.read(ins_save_path)
290
+ model.optimize()
291
+ ```