# ErGOT

## Reproduce Our Results
To reproduce our results in the paper, you should install `torch`, `networkx`, `sklearn`, `pot`. 

We fix random seeds so that you can get the same results. 

### Graph Alignment
`AlignmentExperiment.py` includes the codes to produce Figure 5. 
Performance of ErGOT and GOT with different sample sizes is evaluated in `SampleSizeAlignment.py`
```
python AlignmentExperiment.py
```

```
python SampleSizeAlignment.py
```
### Graph Sketching
For Graph Sketching, we adopt codes from [COPT](https://github.com/twistedcubic/copt.git). We add ErGOT objective in computing graph distance. We fix all the random seeds in codes to be 2022. We also use `joblib` to run sketching in parallel. 

In `args/sketching.txt`, we list all the arguments we use on each dataset. To reproduce our results, just run the command accordingly.

For example, to reproduce our results on PROTEINS, just run 
```
python searchGraph.py --seed 2022 --dataset_name 'PROTEINS' --algo 'ergot' --C 1 --num_epochs 350 
```
and 
```
python searchGraph.py --seed 2022 --dataset_name 'PROTEINS' --algo 'ergot' --C 2 --compress_fac 4
```
### Graph Retrieval 
We adopt codes in [graph-coarsening](https://github.com/loukasa/graph-coarsening.git) which implements *REC,Heavy,Algebraic,Affinity,Variation*. Since there is no open-source code provided by the authors of OTC, we implement *OTC* by ourselves. 

To reproduce the results, you need to run `run.py` in `./copt`