Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support bipartite graph for utils isolated nodes #9825

Open
wants to merge 6 commits into
base: master
Choose a base branch
from

Conversation

zechengz
Copy link
Member

@zechengz zechengz commented Dec 6, 2024

  • Add bipartite graph support for contains_isolated_nodes and remove_isolated_nodes
  • For contains_isolated_nodes returns a tuple of boolean if it's a bipartite graph
  • Add num_isolated_nodes for both bipartite and normal graph
    • For bipartite graph, return (src_num_isolated_nodes, dst_num_isolated_nodes)

@zechengz zechengz requested a review from akihironitta January 11, 2025 00:50
Copy link
Member

@akihironitta akihironitta left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🚀 I'd add an entry to the changelog :)

Comment on lines +33 to +40
>>> bi_edge_index = torch.tensor([[0, 0],
... [1, 1]])
>>> num_isolated_nodes(bi_edge_index, num_nodes=(2, 2))
(0, 0)
>>> num_isolated_nodes(bi_edge_index, num_nodes=(2, 3))
(0, 1)
>>> num_isolated_nodes(bi_edge_index, num_nodes=(3, 3))
(1, 1)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this example for bipartite correct?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants