Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adding pairwise GED calculation and simple optimizations #13

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

amszymanska
Copy link

I've recently used the Graph_Edit_Distance repository to compute the matrix of pairwise GED for the database of compounds. Since this is quite a common application for molecular representation comparison or compound clustering (e.g. using Butina algorithm), I thought it would be really useful to have such functionality.

I implemented it as the third mode next to search and pair. It computes the matrix of pairwise distances between compounds from database file and saves it as a .csv file. This can be run using the following command:

./ged -d database_file -s save_file -m pairwise -p search_paradigm -l lower_bound_method
./ged -d datasets/AIDS_query100.txt -s datasets/ged_matrix2.csv -m pairwise -p astar -l LSa   # example

If query file is specified, it is ignored. If results file is not specified, the results are saved in a default location, that is datasets/pairwse_ged.csv.

Additionally, I updated a little bit the code style to be more c++-like. It resulted in lower execution times. For example, execution time for the following:

./ged -d datasets/AIDS.txt -q datasets/AIDS_query100.txt -m search -p astar -l LSa -t 5

decreased from 9,263,939 to 8,785,024 microseconds. Maybe that's not an incredible change but for sure better then nothing. And the code seems overally easier to read through, in my humble opinion.

I'd be really glad, if you consider the presented changes. Thanks in advance

@simon-forb
Copy link

Pairwise computations are also really relevant to my applications! :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants