learning-tsp icon indicating copy to clipboard operation
learning-tsp copied to clipboard

add scripts for dataset generation

Open vpozdnyakov opened this issue 3 years ago • 1 comments

Hi, it will be great to add some examples or comments how to generate datasets, for example:

To generate train set, run it (estimated time -- 100 mins)

git clone https://github.com/jvkersch/pyconcorde.git
cd pyconcorde && pip install -e .
python 'data/tsp/generate_tsp.py' --min_nodes 20 --max_nodes 50 --num_samples 128000 --batch_size 128 --filename 'data/tsp/tsp20-50_train_concorde.txt'

vpozdnyakov avatar Dec 15 '21 18:12 vpozdnyakov

Hi @vpozdnyakov, yes, that will work -- that script will generate 128000 TSP samples of sizes between 20 and 50 nodes.

I should add some information regarding batch sizes. Thank you for the tip.

In essence, since we are not using GNN libraries like DGL/PyG, we have to ensure that the size of all graphs in a mini-batch is consistent. We ensure this during dataset creation itself in this case.

I will add more documentation.

chaitjo avatar Dec 20 '21 09:12 chaitjo