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

Help required with understanding path-degree product calculation #51

Closed
yuvaramsingh94 opened this issue Jun 15, 2024 · 2 comments
Closed

Comments

@yuvaramsingh94
Copy link

Hi,
This is Yuvaram a Master's student working on heterogeneous network. I am trying to understand the Path-degree product calculation from your Paper. I don't understand what is metaedge specific degrees along the path and why each edge contributes to 2. Can you provide an example or a simple calculation. This will help me in using your work for my project.

Thanks
Yuvaram

@dhimmel
Copy link
Member

dhimmel commented Jun 15, 2024

Figure 2D from the paper is the best visualization:

image

Since each edge has a source and target node, two degrees exist for each edge. These degrees are metaedge specific (only counting edges of the same type).

Here are two implementations from this library if this helps understand. First the networkx/python implementation:

for edge in path:
source_edges = edge.source.get_edges(edge.metaedge, exclude_masked)
target_edges = edge.target.get_edges(edge.metaedge.inverse, exclude_masked)

And second the neo4j/cypher implementation

WITH
[
size((n0)-[:BINDS_CbG]-()),
size(()-[:BINDS_CbG]-(n1)),
size((n1)-[:PARTICIPATES_GpPW]-()),
size(()-[:PARTICIPATES_GpPW]-(n2)),
size((n2)-[:PARTICIPATES_GpPW]-()),
size(()-[:PARTICIPATES_GpPW]-(n3)),
size((n3)-[:ASSOCIATES_DaG]-()),
size(()-[:ASSOCIATES_DaG]-(n4))
] AS degrees, path

@yuvaramsingh94
Copy link
Author

Thanks for quick reply any clearing the doubt.

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

No branches or pull requests

2 participants