nip.graph_isomorphism.dataset_generation#
Functions for generating a dataset of pairs of graphs with WL scores.
The main function is generate_gi_dataset
, which generates a dataset of pairs of
graphs with WL scores.
Graphs are generated using the Erdős-Rényi model. The dataset is generated in three steps:
Generate
prop_non_isomorphic
non-isomorphic graphs. The pairs are divided equally between the different graph sizes and edge probabilities. The number of graphs with a score of 1, 2 and greater than 2 are divided according to the proportionsnon_iso_prop_score_1
andnon_iso_prop_score_2
.Generate
(1 - prop_non_isomorphic) * iso_prop_from_non_iso
isomorphic graphs, by sampling from the non-isomorphic graph pairs and shuffling the nodes.Generate the remaining
(1 - prop_non_isomorphic) * (1 - iso_prop_from_non_iso)
isomorphic graphs, by generating new graphs and shuffling the nodes.
Functions
|
Generate isomorphic graphs. |
|
Generate non-isomorphic graphs. |
|
Generate a batch of Erdős-Rényi graphs. |
|
Generate a dataset of pairs of graphs with WL scores. |
|
Shuffle the nodes in a batch of adjacency matrices of varying sizes. |
|
Compute the Weisfeiler-Lehman scores for a batch of graphs. |
Classes
|
Configuration for a graph isomorphism dataset. |