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

How does the node attr works? #26

Closed
MikeWangWZHL opened this issue Nov 22, 2020 · 2 comments
Closed

How does the node attr works? #26

MikeWangWZHL opened this issue Nov 22, 2020 · 2 comments

Comments

@MikeWangWZHL
Copy link

I compare two graphs as follows:

g1=nx.DiGraph()
g1.add_edges_from([(0,3),(1,3),(2,3)])
g1.nodes[0]['type'] = 'Attack'
g1.nodes[1]['type'] = 'Attack'
g1.nodes[2]['type'] = 'Attack'
g1.nodes[3]['type'] = 'Die'

g2=nx.DiGraph()
g2.add_edges_from([(0,3),(1,3),(2,3)])
g2.nodes[0]['type'] = 'Die'
g2.nodes[1]['type'] = 'Die'
g2.nodes[2]['type'] = 'Die'
g2.nodes[3]['type'] = 'Attack'

ged = gm.GraphEditDistance(1,1,1,1)
ged.set_attr_graph_used('type',None)
result = ged.compare([g1,g2],None)

And the comparing result is
[[0,0],
[0,0]]
So it seems that the ged didn't consider the 'type' attribute?

@elizabethdinella
Copy link

I'm experiencing the same bug. Did you figure out how to compare using node attributes?

@MikeWangWZHL
Copy link
Author

Hi, I actually switch to using networkx graph edit distance algorithm, maybe you can try it out?

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