Given a directed, edge attributed graph G, where the edge attribute is a probability value, and a particular node N (with binary features f1 and f2) in G, the algorithm that I want to implement is as follows:
- List all the outgoing edges from N, let this list be called edgelist_N.
- For all the edges in edgelist_N, randomly assign to the edge attribute a probability value such that the sum of all the probabilities assigned to the edges in the edgelist_N equals to 1.
- Take the top x edges (x can be a hyperparameter).
- List the nodes in which the edges from step 3 are incoming.
- Construct a subgraph with node N, the nodes from step 4 and the edges from step 3.
- Embed the subgraph (preferably using a GNN) and obtain it's embedding and use it with a classifier to predict say f1/f2.
- Propagate the loss so as to update the edge probabilities, that was assigned randomly in step 2.
I do not understand how to do step 7, i.e. update the edge attribute with the loss, so that edges which are more relevant in constructing the subgraph can be assigned a higher probability value.
Any suggestion would be highly appreciated. Thank you very much.