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.1a2.tar.gz
(7.5 MB
view hashes)
Built Distributions
Close
Hashes for data4co-0.0.1a2-cp310-cp310-manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 47195855bc832693de505b6c90ab0f67d239f3aba7f45e53b5538ae59bb89935 |
|
MD5 | d8ac706f4165acaca8ceaf8828f4d1dc |
|
BLAKE2b-256 | eed1a068ff5b879f00be64a9100a0ff9bbfe3a79a4d4bc070bf5f0ac122c0346 |
Close
Hashes for data4co-0.0.1a2-cp39-cp39-manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 4ab7344b651979af45627d68d9ac89f32b1b2e8b69af478a6090a8eacb2057a3 |
|
MD5 | f8854c2c0dce5ff6586b3051a927f44e |
|
BLAKE2b-256 | 787cf41c55ab8a7a68a60d09696b37fde4ff0d5d5dab1da9a84bd2060ff0edb2 |
Close
Hashes for data4co-0.0.1a2-cp38-cp38-manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | d0c4fbc03171f8e0975fd97e8f082448122400f566d1f0244012d1e724b7890c |
|
MD5 | 566990aa322e9252437546145f3a00b6 |
|
BLAKE2b-256 | 1bc76d4119973d2062376d600e53e0ebbe67f6672ac645b4bbad2e150f37f08f |