--UTILIZED COMPUTING HARDWARE 
Experiments are carried over on 8 Intel Xeon Gold 6248 CPUs.

--NECESSARY PACKAGES
All GNN-based experiments are executed in a python 3.8.8 environment. (DGI, GCA, GRACE, NIFTY, and embedding evaluation script 'fclgraph/embedding_test.py')
PyTorch 1.8.1 is utilized to obtain results. It is installed in the Anaconda environment (python 3.8.8) through the command:	conda install -c pytorch pytorch=1.8.1
All other necessary packages can be installed with the command:	 	  	      	      	  		         pip install -r requirements.txt


To generate the results of DeepWalk, the packages in the following file should be installed:		              		deepwalk-master/requirements.txt
To generate the results of Node2Vec and Fairwalk, the packages in the following file should be installed:      		node2vec-master/requirements.txt



------------------------------------------------------------------------------------- PROPOSED SCHEMES IN FAIR CONTRASTIVE LEARNING ON GRAPHS -------------------------------------------------------



The codes to generate the results for the proposed schemes in this study are improved upon the codes provided in the URL: 'https://github.com/CRIPAC-DIG/GRACE'
An MIT license is provided for the corresponding repository.
The results in the papers can be regenerated through the codes in the directory: 'fclgraph'

1)The results of FairAug for node classification can be regenerated through the commands:

-for Pokec-z:      python fclgraph/iclr_fair_contrastive.py --drop-feature-rate-1 0 --drop-feature-rate-2 0.1 --pi 1 --pmin 0.5 --dataset 'pokec' --method 'fclgraph'

-for Pokec-n:      python fclgraph/iclr_fair_contrastive.py --drop-feature-rate-1 0 --drop-feature-rate-2 0.1 --pi 1 --pmin 0.5 --dataset 'pokec2' --method 'fclgraph'

2)The ablation results can be regenerated through the codes in the directory: 'fclgraph'

---For FairAug wo FM---

-for Pokec-z:      python fclgraph/iclr_fair_contrastive.py --drop-feature-rate-1 0 --drop-feature-rate-2 0.1 --pi 1 --pmin 0.5 --dataset 'pokec' --method 'ns_edge_del'

-for Pokec-n:      python fclgraph/iclr_fair_contrastive.py --drop-feature-rate-1 0 --drop-feature-rate-2 0.1 --pi 1 --pmin 0.5 --dataset 'pokec2' --method 'ns_edge_del'

---For FairAug wo NS---

-for Pokec-z:      python fclgraph/iclr_fair_contrastive.py --drop-feature-rate-1 0 --drop-feature-rate-2 0.1 --pi 1 --pmin 0.5 --dataset 'pokec' --method 'edge_del'

-for Pokec-n:      python fclgraph/iclr_fair_contrastive.py --drop-feature-rate-1 0 --drop-feature-rate-2 0.1 --pi 1 --pmin 0.5 --dataset 'pokec2' --method 'edge_del'

---For FairAug wo ED---

-for Pokec-z:      python fclgraph/iclr_fair_contrastive.py --drop-feature-rate-1 0 --drop-feature-rate-2 0.1 --pi 1 --pmin 0.5 --dataset 'pokec' --method 'node_sample'

-for Pokec-n:      python fclgraph/iclr_fair_contrastive.py --drop-feature-rate-1 0 --drop-feature-rate-2 0.1 --pi 1 --pmin 0.5 --dataset 'pokec2' --method 'node_sample'


---For FairAug wo EA---

-for Pokec-z:      python fclgraph/iclr_fair_contrastive.py --drop-feature-rate-1 0 --drop-feature-rate-2 0.1 --pi 1 --pmin 0.5 --dataset 'pokec' --method 'fclgraph_old'

-for Pokec-n:      python fclgraph/iclr_fair_contrastive.py --drop-feature-rate-1 0 --drop-feature-rate-2 0.1 --pi 1 --pmin 0.5 --dataset 'pokec2' --method 'fclgraph_old'


3)The results for FairAug for link prediction can be regenerated through the commands:


-for UCSD34:       python fclgraph/iclr_fair_contrastive.py --drop-feature-rate-1 0 --drop-feature-rate-2 0.1 --pi 0.8 --pmin 0.4 --dataset 'fbucsd' --method 'fclgraph'

-for Berkeley:     python fclgraph/iclr_fair_contrastive.py --drop-feature-rate-1 0 --drop-feature-rate-2 0.1 --pi 0.8 --pmin 0.4 --dataset 'fbberkeley' --method 'fclgraph'

---For FairAug wo NS---

-for UCSD34:       python fclgraph/iclr_fair_contrastive.py --drop-feature-rate-1 0 --drop-feature-rate-2 0.1 --pi 0.8 --pmin 0.4 --dataset 'fbucsd' --method 'edge_del'

-for Berkeley:     python fclgraph/iclr_fair_contrastive.py --drop-feature-rate-1 0 --drop-feature-rate-2 0.1 --pi 0.8 --pmin 0.4 --dataset 'fbberkeley' --method 'edge_del'



4)Results for Table 4 on the datasets Cora, Citeseer, Pubmed can be regenerated through the codes in the directory 'Fair_edgedel'

--Baseline results for edge dropout

-for Cora:      	python Fair_edgedel/train_dropout.py --dataset 'cora' --method 'gcn'
-for Citeseer:		python Fair_edgedel/train_dropout.py --dataset 'citeseer' --method 'gcn'
-for Pubmed: 		python Fair_edgedel/train_dropout.py --dataset 'pubmed' --method 'gcn'

--Our Fair EdgeDel scheme

-for Cora:      	python Fair_edgedel/train_gnn_ours.py --dataset 'cora' --method 'gcn'
-for Citeseer:		python Fair_edgedel/rain_gnn_ours.py --dataset 'citeseer' --method 'gcn'
-for Pubmed: 		python Fair_edgedel/train_gnn_ours.py --dataset 'pubmed' --method 'gcn'




---------------------------------------------- COMPETITOR SCHEMES FOR UNSUPERVISED NODE GENERATION ------------------------------------------------


--DGI

The codes to generate the results for DGI are based on the codes provided in the URL: 'https://github.com/PetarV-/DGI'
An MIT license is provided for the corresponding repository.
The original codes are modified to prepare the data sets utilized in this study.
Additionally, a seed is assigned for pytorch operations for reproducible results.
Lastly, the commands for the test process in the script 'DGI-master/execute.py' are commented out for a shared evaluation scheme among all baselines.

The results in the paper can be regenerated through the codes in the directory: 'DGI-master'

The embeddings for Pokec-z can be generated by setting dataset variable in line 23 in DGI-master/execute.py to 'pokec' and running the command:      python DGI-master/execute.py

The embeddings for Pokec-n can be generated by setting dataset variable in line 23 in DGI-master/execute.py to 'pokec2' and running the command:     python DGI-master/execute.py

The corresponding embeddings will be generated to the same directory as the command 'python DGI-master/execute.py' is run in.

The generated embeddings through these commands can be found in: 
-for Pokec-z        'pokec1_dgi_embeddings.npy'
-for Pokec-n        'pokec2_dgi_embeddings.npy'

Evaluation of the generated embeddings is handled with the evaluation script in the directory: 'fclgraph/embedding_test.py'.
The script needs .npy files for embeddings, labels, and sensitive attributes as arguments for node classification.
***Before evaluation with the script fclgraph/embedding_test.py, for DGI, line 47 of the script must be uncommented!

After uncommenting the line 47, for the performance evaluation of DGI embeddings following commands can be utilized: 

-for Pokec-z:   python fclgraph/embedding_test.py --input 'pokec1_dgi_embeddings.npy' --labels 'datasets/pokec_dataset/labels_pokec1.npy' --sens 'datasets/pokec_dataset/sens_pokec1.npy'

-for Pokec-n:   python fclgraph/embedding_test.py --input 'pokec2_dgi_embeddings.npy' --labels 'datasets/pokec_dataset/labels_pokec2.npy' --sens 'datasets/pokec_dataset/sens_pokec2.npy'



--GCA

The codes to generate the results for GCA are based on the codes provided in the URL: 'https://github.com/CRIPAC-DIG/GCA'
An MIT license is provided for the corresponding repository.
The original codes are modified to prepare the data sets utilized in this study.
Additionally, the codes for the evaluation are modified for a shared evaluation scheme among all baselines.
The results in the paper can be regenerated through the codes in the directory: 'GCA-main'

The results can be regenerated through the commands:

 -for Pokec-z (with default parameters)  python GCA-main/train.py --dataset 'pokec' --drop-feature-rate-1 0.1 --drop-feature-rate-2 0.0 --drop-edge-rate-1 0.4 --drop-edge-rate-2 0.3

 -for Pokec-n       	       	       python GCA-main/train.py --dataset 'pokec2' --drop-feature-rate-1 0.1 --drop-feature-rate-2 0.0 --drop-edge-rate-1 0.4 --drop-edge-rate-2 0.3


 -for FB-UCSD34      	       	       python GCA-main/train.py --dataset 'fbucsd' --drop-feature-rate-1 0.1 --drop-feature-rate-2 0.0 --drop-edge-rate-1 0.4 --drop-edge-rate-2 0.3

 -for FB-Berkeley13       	       python GCA-main/train.py --dataset 'fbberkeley' --drop-feature-rate-1 0.1 --drop-feature-rate-2 0.0 --drop-edge-rate-1 0.4 --drop-edge-rate-2 0.3

Note default hyperparameters for GCA are utilized.



--NIFTY

The codes to generate the results for NIFTY are based on the codes provided in the URL: 'https://github.com/chirag126/nifty'
An MIT license is provided for the corresponding repository.
The original codes are modified to prepare the data sets utilized in this study according to the scheme presented for NIFTY.
Also, the original codes are written for an objective that has both supervised and unsupervised components. The results are obtained for the unsupervised loss only.
Furthermore, the codes for the evaluation are modified for a shared evaluation scheme among all baselines.
The results in the paper can be regenerated through the codes in the directory:  'nifty-main'

The results can be regenerated through the commands:
-for Pokec-z (with default parameters)  python nifty-main/nifty_sota_gnn.py --dataset 'pokec' --drop_feature_rate_1 0.1 --drop_feature_rate_2 0 --drop_edge_rate_1 0.1 --drop_edge_rate_2 0.1
                                                    
-for Pokec-n                            python nifty-main/nifty_sota_gnn.py --dataset 'pokec2' --drop_feature_rate_1 0.1 --drop_feature_rate_2 0 --drop_edge_rate_1 0.1 --drop_edge_rate_2 0.1

Note that feature masking probabilities are kept across NIFTY, GRACE, GCA, and our approach, as all schemes randomly mask a portion of features specified by this hyperparameters (0.1/0 default parameters of GRACE&GCA). 
Remaining parameters are used as the default ones provided in each scheme.



--GRACE

The codes to generate the results for GRACE are based on the codes provided in the URL: 'https://github.com/CRIPAC-DIG/GRACE'
An MIT license is provided for the corresponding repository.
The original codes are modified to prepare the data sets utilized in this study.
The results in the paper can be regenerated through the codes in the directory: 'fclgraph'
Note that all results are obtained the default hyperparameters of GCA for a fair comparison. 

The results can be regenerated through the commands:
 
-for Pokec-z       python fclgraph/iclr_fair_contrastive.py --drop-feature-rate-view1 0 --drop-feature-rate-view2 0.1  --drop-edge-rate1-view1 0.3 --drop-edge-rate1-view2 0.4 --dataset 'pokec' --method 'grace' 

-for Pokec-n       python fclgraph/iclr_fair_contrastive.py --drop-feature-rate-view1 0 --drop-feature-rate-view2 0.1  --drop-edge-rate1-view1 0.3 --drop-edge-rate1-view2 0.4 --dataset 'pokec2' --method 'grace'


-for FB-UCSD34           python fclgraph/iclr_fair_contrastive.py --drop-feature-rate-view1 0 --drop-feature-rate-view2 0.1  --drop-edge-rate1-view1 0.3 --drop-edge-rate1-view2 0.4 --dataset 'fbucsd' --method 'grace'

-for FB-Berkeley13       python fclgraph/iclr_fair_contrastive.py --drop-feature-rate-view1 0 --drop-feature-rate-view2 0.1  --drop-edge-rate1-view1 0.3 --drop-edge-rate1-view2 0.4 --dataset 'fbberkeley' --method 'grace'


--DEEPWALK

The results for DeepWalk are obtained through codes based on the ones provided in the following URL: 'https://github.com/phanein/deepwalk'
A GPL-3.0 License is declared on the Github page.
The environment requirements to run the codes can be found in the following file:                    'deepwalk-master/requirements.txt'

Because the codes provided in the URL produce different representations at each run (something that could not be solved by assigning a seed),
the specific embeddings for which the results are presented are provided.

Generated embedding files by the codes show the node number in the first column and the remaining columns are for the generated embeddings corresponding to the nodes whose numbers are in the first column.
To be able to perform an evaluation on them with ordered label and sensitive attributes arrays,
they are ordered and saved in files:							       for Pokec-z:       deepwalk-master/example_graphs/sorted_pokec1.npy
                                       						       for Pokec-n:       deepwalk-master/example_graphs/sorted_pokec1.npy


The initial embeddings are generated from the directory 'deepwalk-master' through the commands utilizing default hyperparameters given in the Github repository:

            for Pokec-z:        deepwalk --format edgelist --input example_graphs/pokec1.edgelist --number-walks 10 --representation-size 256 --walk-length 40 --window-size 5 --output example_graphs/pokec1_10-40-5.embeddings
            for Pokec-n:        deepwalk --format edgelist --input example_graphs/pokec2.edgelist --number-walks 10 --representation-size 256 --walk-length 40 --window-size 5 --output example_graphs/pokec2_10-40-5.embeddings

Evaluation of the generated embeddings is handled with the evaluation script in the directory: 'fclgraph/embedding_test.py'.
The script needs .npy files for embeddings, labels, and sensitive attributes as arguments for node classification.
Corresponding commands are:

-for Pokec-z:       python fclgraph/embedding_test.py --input 'deepwalk-master/example_graphs/sorted_pokec1.npy' --labels 'datasets/pokec_dataset/labels_pokec1.npy' --sens 'datasets/pokec_dataset/sens_pokec1.npy'
  	      	       	    
-for Pokec-n:       python fclgraph/embedding_test.py --input 'deepwalk-master/example_graphs/sorted_pokec2.npy' --labels 'datasets/pokec_dataset/labels_pokec2.npy' --sens 'datasets/pokec_dataset/sens_pokec2.npy'





--NODE2VEC

The results for Node2Vec are obtained through the codes provided in the following URL: 'https://github.com/aditya-grover/node2vec'
The environment requirements to run the codes can be found in file:                     'node2vec-master/requirements.txt'
Because the codes provided in the URL produces different representations at each run (something that could not be solved by assigning a seed),
the specific embeddings for which the results are presented are provided. 
Generated embedding files by the codes show the node number in the first column and the remaining columns are for the generated embeddings corresponding to the nodes whose numbers are in the first column.
To be able to perform an evaluation on them with ordered label and sensitive attributes arrays,
they are ordered and saved in files:                                                          
for Pokec-z:       node2vec-master/emb/sorted_pokec1.npy
                                                                                               
for Pokec-n:       node2vec-master/emb/sorted_pokec2.npy

The initial embeddings are generated through the commands utilizing default hyperparameters given in the Github repository:

            for Pokec-z:        python node2vec-master/src/main.py --input node2vec-master/graph/pokec1.edgelist --walk-length 80 --num-walks 10 --window 10 --output node2vec-master/emb/pokec1_10-80-10.emd 
            for Pokec-n:        python node2vec-master/src/main.py --input node2vec-master/graph/pokec2.edgelist --walk-length 80 --num-walks 10 --window 10 --output node2vec-master/emb/pokec2_10-80-10.emd

Evaluation of the generated embeddings is handled with the evaluation script in the directory: 'fclgraph/embedding_test.py'.
The script needs .npy files for embeddings, labels, and sensitive attributes as arguments for node classification.
Corresponding commands are: 
-for Pokec-z:      python fclgraph/embedding_test.py --input 'node2vec-master/emb/sorted_pokec1.npy' --labels 'datasets/pokec_dataset/labels_pokec1.npy' --sens 'datasets/pokec_dataset/sens_pokec1.npy'   
                            
-for Pokec-n:      python fclgraph/embedding_test.py --input 'node2vec-master/emb/sorted_pokec2.npy' --labels 'datasets/pokec_dataset/labels_pokec2.npy' --sens 'datasets/pokec_dataset/sens_pokec2.npy' 




--FAIRWALK

The results for FairWalk are generated by slightly modifying the codes provided for Node2Vec in the following URL: 'https://github.com/aditya-grover/node2vec'
Specifically, the script in 'node2vec-master/src/main.py' is modified as 'node2vec-master/src/fairwalk_main.py' to change the probabilities in random walks according to the sensitive attributes.
The environment requirements to run the codes can be found in file: 'node2vec-master/requirements.txt'

Because the codes provided in the URL produces different representations at each run (something that could not be solved by assigning a seed),
the specific embeddings for which the results are presented are provided.

Generated embedding files by the program show the node number in the first column and the remaining columns are for the generated embeddings corresponding to the nodes whose numbers are in the first column.
To be able to perform an evaluation on them with ordered label and sensitive attributes arrays,
they are ordered and saved in files:                                                           
for Pokec-z:       node2vec-master/emb/sorted_fair_pokec1.npy
                                                                                               
for Pokec-n:       node2vec-master/emb/sorted_fair_pokec2.npy

The initial embeddings are generated through the commands utilizing the same hyperparameters as in Node2Vec:

for Pokec-z:   python node2vec-master/src/fairwalk_main.py --input node2vec-master/graph/pokec1.edgelist --walk-length 80 --num-walks 10 --window 10 --sens 'datasets/pokec_dataset/sens_pokec1.npy' --output node2vec-master/emb/fair_pokec1_10-80-10.emd
for Pokec-n:   python node2vec-master/src/fairwalk_main.py --input node2vec-master/graph/pokec2.edgelist --walk-length 80 --num-walks 10 --window 10 --sens 'datasets/pokec_dataset/sens_pokec2.npy' --output node2vec-master/emb/fair_pokec2_10-80-10.emd

Evaluation of the generated embeddings is handled with the evaluation script in the directory: 'fclgraph/embedding_test.py'.
The script needs .npy files for embeddings, labels, and sensitive attributes as arguments for node classification.
Corresponding commands are: 
-for Pokec-z:      python fclgraph/embedding_test.py --input 'node2vec-master/emb/sorted_fair_pokec1.npy' --labels 'datasets/pokec_dataset/labels_pokec1.npy' --sens 'datasets/pokec_dataset/sens_pokec1.npy'   
                            
-for Pokec-n:      python fclgraph/embedding_test.py --input 'node2vec-master/emb/sorted_fair_pokec2.npy' --labels 'datasets/pokec_dataset/labels_pokec2.npy' --sens 'datasets/pokec_dataset/sens_pokec2.npy' 
