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

Rewiring question #3

Open
xindi-dumbledore opened this issue Nov 7, 2018 · 2 comments
Open

Rewiring question #3

xindi-dumbledore opened this issue Nov 7, 2018 · 2 comments

Comments

@xindi-dumbledore
Copy link

Hi~ Sorry I have many questions on this algorithm haha. I'm trying to fully understand the algorithm and I have a question on the REWIRE(r) function.

Suppose we already have already encounter a->b, w1 in our G, now we encounter a rule, r = b|a->c w2, and we want to rewire it. Based on the algorithm PrevSource = a, PrevTarget = b, and indeed edge(a, b|a) not in the graph, then we add the edge (a, b|a, w2) and remove (a, b). Is this correct?

So I'm confused why we make the edge (a, b|a) has weight w2, w2 can be different from w1 right? So we may overcount or undercount the transition between a and b? It seems weird that the transition between a and b is related to c. And one can also imagine, if we have b|a -> d, w3, then the weight of (a, b|a) will change if we encounter b|a -> d first and b|a->c second (since we don't need to rewire under this circumstances).

Thank you so much!

@xyjprc
Copy link
Owner

xyjprc commented Dec 2, 2018

Hi @xindi-dumbledore , thank you for your question. This does seem to be a bug in this pyHON code.

If we have a->b, w1 and b|a->c w2, then the first link a->b w1 should be rewired as a->b|a w1.

For b|a->c w2, source = b|a, PrevSource = a and PrevTarget = b.
We should assign PrevSource -> source = w1, which is G[PrevSource][PrevTarget]. My current code incorrectly assigns Graph[source][target] (w2) to a->b|a.

That's a good catch! Thank you again, and please kindly let me know if you notice any other issue.

@xyjprc
Copy link
Owner

xyjprc commented Dec 2, 2018

Also just checked the same step in the Lisp version of the code (cl-HON) which looked correct. Just pyHON's bug.

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