data4co provides convenient dataset generators for the combinatorial optimization problem
Project description
Data4CO
A data generator tool for Combinatorial Optimization (CO) problems, enabling customizable, diverse, and scalable datasets for benchmarking optimization algorithms.
Current support
version: 0.0.1-alpha
Problem | Solver1 | Impl. | Solver2 | Impl. | Solver3 | Impl. |
---|---|---|---|---|---|---|
TSP | LKH | ✔ | Concorde | ✔ | Gurobi | 📆 |
MIS | KaMIS | ✔ | Gurobi | 📆 | -- | -- |
Problem | Type1 | Impl. | Type2 | Impl. | Type3 | Impl. | Type4 | Impl. |
---|---|---|---|---|---|---|---|---|
TSP | uniform | ✔ | gaussian | ✔ | cluster | 📆 | -- | -- |
MIS | ER | ✔ | BA | ✔ | HK | ✔ | WS | ✔ |
✔: Supported; 📆: Planned for future versions (contributions welcomed!).
How to Install
Github
Clone with the url https://github.com/heatingma/Data4CO.git , and the following packages are required, and shall be automatically installed by pip
:
Python >= 3.8
numpy>=1.24.4
networkx==2.8.8
lkh>=1.1.1
tsplib95==0.7.1
tqdm>=4.66.1
PyPI
It is very convenient to directly use the following commands
pip install data4co
How to Use
TSP
from data4co import TSPDataGenerator
tsp_data_lkh = TSPDataGenerator(
batch_size=16,
nodes_num=50,
data_type="uniform",
solver_type="lkh",
train_samples_num=128000,
val_samples_num=1280,
test_samples_num=1280,
save_path="your/path/to/save"
)
tsp_data_lkh.generate()
MIS
from data4co import MISDataGenerator
mis_data_kamis = MISDataGenerator(
nodes_num_min=700,
nodes_num_max=800,
data_type="er",
solver_type="kamis",
train_samples_num=128000,
val_samples_num=1280,
test_samples_num=1280,
save_path="your/path/to/save",
solve_limit_time=10.0
)
mis_data_kamis.generate()
mis_data_kamis.solve()
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
data4co-0.0.1a3.tar.gz
(3.2 MB
view hashes)
Built Distributions
Close
Hashes for data4co-0.0.1a3-cp310-cp310-manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 759b0b05e430bfecaa6ff155f9e421a2f3b265d2de471f1b0d435bc32dfa78d7 |
|
MD5 | 4e7873acd5e0b8b7367934d590f928f8 |
|
BLAKE2b-256 | 555254e978c1f8fc3150075d667b9f1daf1708414d3286d4c50ee03d750c58f6 |
Close
Hashes for data4co-0.0.1a3-cp39-cp39-manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 65fb2b6c25cccb5dda65e5fbc90eedfe7fc7fe7c92af709cfb14bf1307ee20f4 |
|
MD5 | aabfab7a2f127dc8d19d869c8f1ac096 |
|
BLAKE2b-256 | 668eb7b0aa51ab6abf9d1270b58a5b54df2138078ff4563e7f4b182476e715f5 |
Close
Hashes for data4co-0.0.1a3-cp38-cp38-manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | d1035bef50743482b822a163b80709af3b3de8c393e712436e6f0af27dfe80b9 |
|
MD5 | ac2b6e2c58b8f7e2da07f42cd47ead33 |
|
BLAKE2b-256 | e6e9fb6eca208009662f72108fda479fd15e7d0f253ecc19e5c7b6c811b33eb7 |