This document provides instructions for setting up the environment, generating data, and running various tasks related to hypergraph recovery and evaluation using this project.
Create and activate the Conda environment. The primary dependency is graph-tool.
conda create --name gt -c conda-forge graph-tool
conda activate gtThis step generates the necessary graph data. The example below uses the FB-AUTO dataset and valid.txt.
python H2GN.py FB-AUTO valid.txt- Replace
FB-AUTOwith your specific dataset identifier if it differs. - Replace
valid.txtwith your relevant validation or specification file if it differs.
This task performs the fundamental hypergraph recovery process.
Execute the main script with the appropriate arguments:
python main.py --dataset_dir dataset/FB-AUTO --input_file FB-AUTO.gt --autostop --save_outputs--dataset_dir dataset/FB-AUTO: Specifies the directory containing the dataset.--input_file FB-AUTO.gt: Specifies the input graph file (e.g., generated byH2GN.pyor pre-processed).--autostop: Enables an automatic stopping criterion for the recovery process.--save_outputs: Ensures that the recovered hypergraph data is saved.
To evaluate the accuracy of the recovered hypergraph:
-
Open the
Evaluate.pyscript in a text editor. -
Modify the
original_pathvariable to point to the file containing the original/ground-truth hypergraph. -
Modify the
recovered_pathvariable to point to the recovered hypergraph file generated bymain.py. -
Run the evaluation script:
python Evaluate.py
This will output the recovery accuracy.
This section describes how to run the hypergraph recovery and evaluation under different noise conditions.
Execute the run_all_noise.sh script. This script will likely run the recovery process multiple times with varying noise parameters and save the outputs.
bash run_all_noise.shAfter run_all_noise.sh completes, you will need to evaluate each generated output:
For each recovered hypergraph file generated by the noise experiments:
-
Open
Evaluate.py. -
Ensure
original_pathis correctly set to the ground-truth hypergraph. -
Update
recovered_pathto point to the specific recovered hypergraph file from the current noise experiment iteration. -
Run the evaluation script:
python Evaluate.py
-
Repeat steps 2-4 for each output file from the noise experiments.
This section details how to perform and evaluate the Max Clique (Max_L) based tests.
Execute the run_max_L.sh script. This script will likely run experiments based on different Max_L configurations.
bash run_max_L.shAfter run_max_L.sh completes, evaluate each generated output:
For each recovered hypergraph file generated by the Max_L experiments:
-
Open
Evaluate.py. -
Ensure
original_pathis correctly set to the relevant ground-truth hypergraph. -
Update
recovered_pathto point to the specific recovered hypergraph file from the current Max_L experiment iteration. -
Run the evaluation script:
python Evaluate.py
-
Repeat steps 2-4 for each output file from the Max_L experiments.
Important Notes:
- Remember to replace placeholder names like
FB-AUTOwith your actual dataset names if they differ. - Ensure all file paths specified in commands or within scripts (
dataset_dir,input_file,original_path,recovered_path) are correct relative to your project structure and the outputs of preceding steps.