martinakaduc / xNeuSM

Explainable Neural Subgraph Matching with Graph Learnable Multi-hop Attention Networks
MIT License
13 stars 0 forks source link

Whether using GraphMatcher.subgraph_is_isomorphic() is correctly used #2

Closed wenrui-hw closed 10 months ago

wenrui-hw commented 10 months ago

Hi!I see that GraphMatcher.subgraph_is_isomorphic() is used in data_real/generate_data_v1.py to check whether two graphs are subgraph isomorphic.

However, it seems that this function is only applicable for node-induced subgraphs, and the generated graphs are not node-induced subgraphs. So is there a problem with my understanding of this function, or is this function being used incorrectly?

martinakaduc commented 10 months ago

Thank you for your insight. Your understanding is not wrong. Actually, this repository focuses on identifying induced-subgraph isomorphism. Thus, a subgraph that does not satisfy node-induced isomorphism is considered non-isomorphic in this case.

wenrui-hw commented 10 months ago

Thanks for you explanation. However, if I understand it correctly, the subgraph generated by generate_data_v1 should also be node-induced non-isomorphic?

martinakaduc commented 10 months ago

The generate_data_v1.py file is used to generate synthetic datasets for training. There are two functions in this file, one for generating isomorphic and the other for generating non-isomorphic subgraphs.

Is this answer satisfied? If not, could you please provide me more details?

wenrui-hw commented 10 months ago

Sorry for not making it clear before.

I know that one of the functions (generate_iso_subgraph) in generate_data_v1.py is for generating isomorphic subgraphs. However, due to the operation of removing edges, the generated subgraphs, I think, are also non-node-induced subgraphs. So it seems that the subgraphs generated by "generate_iso_subgraph" are also should be regarded as non-isomorphic subgraphs is this case? (But they are non-induced isomorphic subgraphs.)

I am not sure my understanding on "induced" and "isomorphic" is correct. If I have some misunderstanding, please correct me.

martinakaduc commented 10 months ago

Oh, I see. That might be a bug in synthetic subgraph generation. I have fixed in the latest commit. Thank you so much.

wenrui-hw commented 10 months ago

You're welcome! I'm glad to hear that the issue has been fixed in the latest commit.