shiralkarprashant / knowledgestream

Code to reproduce results in "Finding Streams in Knowledge Graphs to Support Fact Checking"
36 stars 18 forks source link

Possible bug in `ssp.py` #2

Closed bkj closed 6 years ago

bkj commented 6 years ago

In ssp.py, the comment here says "Increment backward edge's res. cap. by bottleneck" -- but in the code here, it looks like you're just setting the capacity of the backward edge to the bottleneck.

It seems to me like the comment is correct and the code is incorrect -- but I don't know a ton about these network flow algorithms. Any thoughts on whether this might be a bug?

Also, while you're looking at this part of the code, I think you should be able to delete line 117 completely.

shiralkarprashant commented 6 years ago

You are absolutely right. I apologize. The comments were from an old version of the code. Typically, you do increment the capacity of a backward edge as you push flow along the forward edge. However, to obtain meaningful interpretations for the capacity (which captures the notion of relational similarity between edge and target predicate), we limit the capacity to 1 in current approach. Of course, in the future, alternative ways can be explored. I have updated the comment in the code as well. Hope this helps.

And yes, line 117 was not required. I deleted it now.

Thanks for pointing out both items!

bkj commented 6 years ago

Great -- thanks! Will close now.