"to_bidirected is not well defined for unidirectional bipartite graphs" when required for GNN

Title. I am trying to convert my simple graph to test link prediction, and I come across the same issue quoted here. When I go to use the to_bidirected I get the below error.

to_bidirected is not well defined for unidirectional bipartite graphs, but (‘customer’, ‘customerBoughtProducts’, ‘product’) is unidirectional bipartite

I am not sure how to get past this, since I am testing this bipartite graph but also need the message passing to happen correctly.

Edit: Graph Dimensions

Graph(num_nodes={‘customer’: 74845, ‘product’: 1835},
num_edges={(‘customer’, ‘customerBoughtProducts’, ‘product’): 266617},
metagraph=[(‘customer’, ‘product’, ‘customerBoughtProducts’)])

you wanna add reverse edges of (‘customer’, ‘customerBoughtProducts’, ‘product’) ?
Such a new graph is still a bipartite graph?
How about constructing a new graph via dgl.heterograph.

1 Like

Yes, I did just that. Thought it’d be easier to just add another edge with the tensors in reverse positions and it worked.

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.