{"id":22229777,"url":"https://github.com/graph-com/dig_milp","last_synced_at":"2025-07-27T19:31:52.579Z","repository":{"id":203130371,"uuid":"705266543","full_name":"Graph-COM/DIG_MILP","owner":"Graph-COM","description":"The official implementation of DIG-MILP","archived":false,"fork":false,"pushed_at":"2023-10-27T01:58:24.000Z","size":2431,"stargazers_count":10,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2024-06-09T01:28:21.890Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Graph-COM.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null}},"created_at":"2023-10-15T14:36:00.000Z","updated_at":"2024-04-18T21:27:52.000Z","dependencies_parsed_at":null,"dependency_job_id":"ec0207df-b550-4e20-8a9b-5c2765b58b8f","html_url":"https://github.com/Graph-COM/DIG_MILP","commit_stats":null,"previous_names":["graph-com/dig_milp"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Graph-COM%2FDIG_MILP","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Graph-COM%2FDIG_MILP/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Graph-COM%2FDIG_MILP/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Graph-COM%2FDIG_MILP/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Graph-COM","download_url":"https://codeload.github.com/Graph-COM/DIG_MILP/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":227831007,"owners_count":17826154,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-12-03T01:12:22.396Z","updated_at":"2024-12-03T01:12:23.071Z","avatar_url":"https://github.com/Graph-COM.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# DIG_MILP\nThe official implementation of DIG-MILP: A Deep Instance Generator for Mixed-Integer Linear Programming with Feasibility Guarantee\n\n## Environment Requirement\n\nTo implement the code, the environment below is required:\n```\nSCIP version 7.0.3\necole       0.7.3\nmatplotlib          3.7.2\nnetworkx            3.0\nnumpy               1.24.4\nPySCIPOpt           3.5.0\nPyYAML              6.0.1\nscikit-learn        1.3.0\nscipy               1.10.1\ntorch               2.0.0+cu117\ntorch-geometric     2.3.1\ntorchaudio          2.0.1+cu117\ntorchvision         0.15.1+cu117\ntqdm                4.65.0\nwandb               0.15.5\n```\nThe corresponding CUDA version is 11.7 and CUDNN version is 8500.\nTo install [PYSCIPOpt](https://github.com/scipopt/PySCIPOpt), please first install [SCIP](https://scipopt.org/doc).\n\n## Code implementation\n\nWe include the code implementation for all the four tasks (set covering, combinatorial auctions, CVS and IIS).\n\n### Combinatorial auctions (CA) (synthetic)\n\n#### Data pre-process\n\n1. run ```_1_generate_lp_data_mixed.py``` to generate graphs for combinatorial auctions. Here the generation follows that in [Exact Combinatorial Optimization with Graph Convolutional Neural Networks](https://github.com/ds4dm/learn2branch). \n\n2. run ```_2_infer_scip_primal.py``` to get a set of primal solution/slack to the original problems.\n\n3. run ```_3_generate_dual.py``` to get the dual format of linear relaxation to the original problems.\n\n4. run   ```_4_1_infer_scip_dual_solution.py``` and ```_4_2_infer_scip_dual_slack.py``` to infer a set of solutions / slack variables for the dual format of linear relaxation.\n5. run ```_5_normalize_nodes.py``` to normalize the node inputs of the dataset.\n6. run ```_6_normalize_weight.py``` to normalize the edge weight in the dataset.\n7. run ```_7_generate_vcgraph.py``` to generate the VC-bipartite graph in torch-geometric in-memory dataset.\n8. run```_8_normalize_degree.py``` to normalize the node degrees.\n\n#### DIG-MILP training and inference\n9. run ```sh 9_train.sh``` to train the model. The pre-trained DIG-MILP model is in the train_files.\n10. run ```sh 10_generate.sh``` to generate new instances.\n\n#### downstream task - parameter tuning without sharing data\nenter /downstream_parameter/,\n\n11. run ```sh 17_infer_log.sh``` and ```sh 17_infer_log2.sh``` to infer the 45 different hyper-parameter seeds for SCIP.\n    run the script for three times and change the target output path to 'time_log0', 'time_log1', and 'time_log2'.\n    \n12. run ``paint_similarity.py``` to paint the Pearson correlation figure and get the score.\n\n* We include the SCIP solution time for all the four problems in the time_log folder and the corresponding figure in the paint folder.\n\n#### downstream task - train machine learning models\nenter / downstream_train_ml/,\n13. run ```_1_infer_generate_primal.py``` to get the optimal solution for the generated MILP instances.\n14. run ```_2_generate_train_data.py``` to generate the training data for downstream task.\n15. run ```_7_generate_val_lp.py``` and ```_8_generate_val_data.py``` to generate the validation data, run ```_4_generate_test_lp.py``` amd ```_5_generate_test_graph.py``` to generate the testing data.\n16. run ```sh 3_train.sh``` to train the downstream machine learning model.\n17. run ```_6_test.py``` to test the model.\n\n* The implementation of Set covering (SC), CVS and IIS is similar to CA. But there could be some difference in data pre-processing:\n\n### CVS and IIS\n#### Data pre-process\nTo pre-process the data downloaded from [MIPLIB2017](https://miplib.zib.de/tag_benchmark.html), we provide the script to pre-process and we also directly include the pre-processed version (in primal_format folder). \n\n\n\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgraph-com%2Fdig_milp","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fgraph-com%2Fdig_milp","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgraph-com%2Fdig_milp/lists"}